Adds the Lifestyle fotografie section to the homepage
Adds the first block below the hero: heading, intro and a staggered gallery of four live photos. Brings in the shared section building blocks (HomeSection, SectionHeading, Reveal) and DeferredImage, which holds back below-the-fold photos until the page has loaded so they do not compete with the hero for bandwidth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
// A controllable IntersectionObserver for tests: install it with
|
||||
// vi.stubGlobal('IntersectionObserver', FakeIntersectionObserver) and call
|
||||
// trigger() to simulate an element coming into view.
|
||||
export class FakeIntersectionObserver {
|
||||
static instances: FakeIntersectionObserver[] = [];
|
||||
observed: Element[] = [];
|
||||
disconnected = false;
|
||||
readonly callback: IntersectionObserverCallback;
|
||||
readonly options?: IntersectionObserverInit;
|
||||
|
||||
constructor(
|
||||
callback: IntersectionObserverCallback,
|
||||
options?: IntersectionObserverInit,
|
||||
) {
|
||||
this.callback = callback;
|
||||
this.options = options;
|
||||
FakeIntersectionObserver.instances.push(this);
|
||||
}
|
||||
|
||||
observe(element: Element) {
|
||||
this.observed.push(element);
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
this.disconnected = true;
|
||||
}
|
||||
|
||||
trigger(isIntersecting: boolean) {
|
||||
this.callback(
|
||||
[{ isIntersecting } as IntersectionObserverEntry],
|
||||
this as unknown as IntersectionObserver,
|
||||
);
|
||||
}
|
||||
|
||||
static reset() {
|
||||
FakeIntersectionObserver.instances = [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user