horizontal-scroll-scenes
यह क्या करती है
यह स्किल एजेंट को ऐसा वेब पेज बनाना सिखाती है जहाँ ऊपर-नीचे स्क्रॉल करने पर कहानी क्षैतिज मंच पर दृश्यों से आगे बढ़ती है। यह अध्याय-आधारित प्रोडक्ट कहानियों, पोर्टफ़ोलियो और प्रदर्शनों के लिए है।
कब इस्तेमाल करें
- ✓जब आप चाहते हैं कि लोग नीचे स्क्रॉल करें तो अध्याय एक-एक दृश्य करके बगल में आगे बढ़ें।
- ✓जब कहानी में हर अध्याय के लिए ठहराव चाहिए, न कि लगातार बहाव।
- ✓जब पीछे स्क्रॉल करने, स्क्रॉलबार खींचने या रीलोड करने पर भी सही दृश्य पर पहुँचना चाहिए।
Skill का लिंक
https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/horizontal-scroll-scenes/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“चार अध्यायों वाली स्क्रॉल कहानी बनाइए, जो बाएँ से दाएँ खिसकें, दृश्यों के बीच वाइप हो और एक अध्याय सूची हो।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट एक ऐसा फ़ंक्शन इस्तेमाल करता है जो स्क्रॉल की स्थिति पढ़ता है और मौजूदा दृश्य व उसके अंदर कितनी दूर तक विज़िटर है, यह निकालता है। स्क्रीन पर जो कुछ भी दिखता है, वह इसी एक मान से बनता है, इसलिए कोई सहेजी हुई स्थिति नहीं होती जो गड़बड़ा सके।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Horizontal Scroll Scenes
The mechanism: scroll position is the only state. One pure function turns scrollY / (scrollHeight - innerHeight) into {scene, dwell 0→1, move 0→1} every frame, and everything on screen (camera, wipe line, craft clock, text, index) is written from that triple. Nothing remembers where you were, so every beat is a place on the page.
This is what Kibori does, and it is not a translateX slider. Verified by running it: the page is a 1742vh native-scroll track (15,678 px at 1440×900); a fixed stage holds one WebGL world whose camera travels 0 → 49.7 world units left to right through eight stations; between stations a ragged burn line wipes from a frozen frame of the scene being left to the live scene already framed on the next. There is no wheel handler, no snap, no stored "current chapter". Reload at depth, scrollbar drag and anchor jumps work because state is derived, not accumulated.
Reach for scroll-world-storytelling or build-threejs-scroll-worlds for the story and 3D-world side, gsap-scrolltrigger-storytelling for pinned sticky sections, scroll-progress-timeline for a progress line. Reach for this when the deliverable is discrete chapters with a resting beat each, laid along an X axis, and the hard part is making that state machine survive reverse, skip and refresh. The demo is Vanilla JavaScript + DOM/CSS + inline SVG; the source is three.js. The state machine is identical.
The pace: two weights and a track height
Every number lives in DWELL, MOVE and the track height. One unit is one screen of scrolling.
| constant | value | meaning |
|---|---|---|
DWELL |
1.15 | scroll spent inside a scene while its craft advances (about 1,030 px at 900 tall) |
MOVE |
0.85 | scroll spent crossing to the next scene (about 760 px); the last scene has none |
CYC |
2.00 | one scene per two screens |
SPAN |
N*DWELL + (N-1)*MOVE |
8 scenes: 15.15 plus a 1.35 footer = 16.5; demo, 5 scenes: 9.15 |
| track | (SPAN + 1) * 100vh |
so 1 unit ≈ 1 screen; Kibori is 1742vh for 16.5 |
function travel(sp){ // sp = scrollY / (scrollHeight - innerHeight)
const u = Math.min(SPAN - 1e-5, sp*SPAN);
const i = Math.min(N - 1, Math.floor(u/CYC));
const local = u - i*CYC;
const dw = Math.min(1, local/DWELL); // the scene's own clock
const f = i >= N-1 ? 0 : clamp01((local - DWELL)/MOVE); // the move
const rc = clamp01((f - 0.01)/0.97); // the line's own clock
return {i, u, dw, f, fe: sstep(0,1,f), L: -0.08 + 1.24*rc, // L: line, off-frame at both ends
live: Math.min(N-1, f < 0.39 ? i : i+1)}; // what the index shows
}
Normalise by scrollHeight - innerHeight, never a hard-coded pixel height: a phone's collapsing URL bar changes innerHeight mid-scroll and a px map drifts.
Rules, each with the failure it prevents
- Derive, do not accumulate. Never keep
currentSceneor add wheel deltas. Stored state desyncs on scrollbar drag,Home/End, anchor jumps, back-forward and refresh. Prove it: record a signature of every visible style at 20uvalues going forward, then again in reverse, then by jumping straight to each, then afterreload()at three depths. All must be equal (the demo run: 0 mismatches of 21, 0 skip, 0 reload). - No wheel hijack, no
scroll-snap. Hijacking breaks touch, trackpad momentum,Space/PageDownand find-in-page. Snap fights the dwell, which is already the resting plateau (1.15 screens where nothing moves but the craft). Native scrolling stays 1:1: 2,000 px of wheel gave exactlyu = 2000/(scrollHeight - vh)*SPAN. - Pin the craft clock outside its dwell. Scene
k's progress is1ifk < i,dwifk == i,0after. Then nothing snaps back behind you and reverse retraces exactly. Write it as--p{k}and eased--e{k}custom properties on the stage; both world copies read them, so it is one write per frame. - A move with nothing moving is dead scroll. Start the line at the frame's edge almost at once (
rc = (f-0.01)/0.97); starting it further off made the first eighth of every move do nothing. - The wipe hides the camera. Freeze the outgoing frame ahead of the line and have the live world already standing on the destination behind it. A camera still travelling under the line reads as a double exposure. Demo: layer A at camera
iclipped to the far side of the line, layer B at
अक्सर पूछे जाने वाले सवाल
क्या यह विज़िटर कहाँ था, यह सहेजता है?
नहीं। स्किल हर दृश्य स्क्रॉल की स्थिति से निकालती है, इसलिए रीलोड करने या कूदने पर सही दृश्य पर पहुँचते हैं।
क्या यह सिर्फ़ एक सरल क्षैतिज स्लाइडर है?
नहीं। स्किल बुनियादी स्लाइडर नहीं है, और दृश्यों के बीच वाइप इस्तेमाल करती है।
क्या इसे फ़्रेमवर्क चाहिए?
डेमो सादे JavaScript, DOM और CSS के साथ inline SVG इस्तेमाल करता है, इसलिए यह किसी फ़्रेमवर्क पर निर्भर नहीं है।
जानकारी
लेखक का मूल विवरण
Build scene-by-scene chapters that advance left to right on one fixed stage while the user scrolls vertically, with native scroll as the only input. One pure function turns scrollY into scene, dwell and move, so forward, reverse, scrollbar drags, fast skips and reload at depth all land on the right frame. Covers dwell versus transition budgets, a burn-wipe or pan between scenes, chapter index and progress UI, glide-to-scene links that skip intermediate scenes, keyboard and reduced-motion behaviour. Use for horizontal scrollytelling, multi-scene product tours, "scroll down to travel sideways",
repo: MengTo/Skills
लोकप्रियता
- GitHub स्टार
- 7.2k
- रैंकिंग में स्थान
- #13441
- लाइसेंस
- MIT
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
3d-cloth-material
7.2kआपके एजेंट को Three.js में असली बुने हुए कपड़े जैसा दिखने वाला मटीरियल बनाने में मदद करती है, जिसमें धागों की बुनाई, हल्की चमक, प्राकृतिक सिलवटें, किनारे और सीवन हों।
3d-falling-leaves
7.2kआपके एजेंट को 3D दृश्य में असली लगने वाली गिरती पत्तियाँ जोड़ने देती है, जो लुढ़कती हैं, हवा के साथ बहती हैं और कैमरा हिलने पर दोबारा इस्तेमाल होती हैं।
3d-four-seasons
7.2kआपके एजेंट को 3D दृश्य में वसंत, गर्मी, शरद और सर्दी के रूप जोड़ने देती है, जिसमें हरियाली, रोशनी, आसमान और बर्फ़ बिना दृश्य दोबारा बनाए बदलते हैं।
3d-high-poly-models
7.2kआपके एजेंट को चिकने आकार और विश्वसनीय किनारों वाले विस्तृत 3D मॉडल बनाने देती है, और फिर वेब पर अच्छे चलने वाले हल्के संस्करण तैयार करती है।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।