All checks were successful
Deploy / Deploy to Production (push) Successful in 25s
- Remove GalleryAnimation preloading (was downloading full-size originals via new Image(), causing 5MB+ redundant downloads on top of WebP srcset) - Gallery now shows immediately, images load lazily via DOM - Force eager loading on mockup img when slide becomes active (fixes first-project gallery never showing — lazy img off-screen on bg slide) - Resize all direct ->url() calls to appropriate display dimensions: gallery src 600px, mockup src 960px, backgrounds 1920px, play lettering 500px, play preview 1000px, team photos 400px Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
858 B
PHP
30 lines
858 B
PHP
<?php
|
|
|
|
$bodyBlocks = [];
|
|
foreach ($page->body()->toBlocks() as $block) {
|
|
if ($block->type() === 'text') {
|
|
$bodyBlocks[] = [
|
|
'type' => 'text',
|
|
'html' => $block->content()->text()->value()
|
|
];
|
|
}
|
|
}
|
|
|
|
$specificData = [
|
|
'heading' => $page->heading()->value(),
|
|
'subtitle' => $page->subtitle()->value(),
|
|
'body' => $bodyBlocks,
|
|
'team' => $page->files()->template('member')->sort('sort')->map(function ($file) {
|
|
return [
|
|
'name' => $file->memberName()->value(),
|
|
'role' => $file->role()->value(),
|
|
'photo' => $file->resize(400, null, 80)->url(),
|
|
'link' => $file->link()->value() ?: null,
|
|
];
|
|
})->values()
|
|
];
|
|
|
|
$pageData = array_merge($genericData, $specificData);
|
|
|
|
header('Content-Type: application/json');
|
|
echo json_encode($pageData);
|