diff --git a/src/uix/eidos/components/scroll-frames/README.md b/src/uix/eidos/components/scroll-frames/README.md new file mode 100644 index 000000000..821ffc49e --- /dev/null +++ b/src/uix/eidos/components/scroll-frames/README.md @@ -0,0 +1,70 @@ +# ScrollFrames + +Eidos-only primitive for **scroll-driven media scrubbing**. The frame shown is a +pure function of scroll progress (0 → 1) over a tall track with a sticky viewport. + +Two mutually-exclusive modes: + +- **`frames`** — an ordered array of image URLs drawn onto a `` (cover + fit, HiDPI-aware). +- **`video`** — a clip's `currentTime` eased toward the scroll target (`smooth`). + +```svelte + + + +
+ +
+``` + +## Adapted to the framework + +Every DOM + timing touchpoint goes through **`ActiveDom`** (`eidos.dom`), so the +component is iframe / popup / happy-dom safe and its lifecycle is tracked — no bare +globals: + +| Native (draft) | Framework | +| --- | --- | +| `window.addEventListener('scroll'/'resize')` | `dom.listen` + `dom.observeResize` | +| `requestAnimationFrame` / `cancelAnimationFrame` | `dom.raf` (disposer) | +| `window.innerHeight` / `devicePixelRatio` | `dom.getWindow(node)` | +| `new Image()` | `dom.getDocument().createElement('img')` | + +The `root` prop lets the scroll come from a container instead of the window; +without it the window drives progress (the default). + +## Morfo + +`scope: ['eidos']`, **0 events**. Four structural parts: + +| part | marker | role | +| --- | --- | --- | +| `provider` | `data-scroll-frames` | the tall track (scroll travel) | +| `viewport` | `data-scroll-frames-viewport` | sticky child that pins the media | +| `media` | `data-scroll-frames-media` | `` / `