正在加载视频...

视频加载失败

We took the Inertia.js infinite scroll component for 2.0 and turbo boosted it: - ⬆️ Reverse infinite scroll - 👬 Multiple infinite scroll components on the same page - 🔃 *Two way* infinite scroll - 🔗 Syncing page state in URL - 🖱️ Manual mode after X requests 🚀👨‍🚀

53,143 次观看 • 1 年前 •via X (Twitter)

10 条评论

Joe Tannenbaum 的头像
Joe Tannenbaum1 年前

Oh! I want to shout out @pedroborg_es for giving me some great tips on this! He had previously done a lot of research on infinite scrolling and it was super helpful to hear his takeaways. Thank you, sir!

Daniel Weaver 的头像
Daniel Weaver1 年前

@inertiajs Does this also support virtual scrolling after a certain number of entries? Like if you are infinitely scrolling for a bit your browser will start to slow down due to the number of elements. Maybe it can unload the ones off screen?

Sébastien Dubois 的头像
Sébastien Dubois1 年前

@inertiajs Where do I sign?

Alex Maven 的头像
Alex Maven1 年前

@inertiajs

Irsyad A. Panjaitan 的头像
Irsyad A. Panjaitan1 年前

@inertiajs Is it working with react and ts. Because last time it doesn't.

Len Woodward 的头像
Len Woodward1 年前

@inertiajs Joe. Wtf. This is incredible

Chris Sev 的头像
Chris Sev1 年前

@inertiajs It’s really really rad

Ryan Chandler 的头像
Ryan Chandler1 年前

@inertiajs 🧠

why i oughta... 的头像
why i oughta...1 年前

@inertiajs This is a great demo. Good job!

Dan Matthews 的头像
Dan Matthews1 年前

@inertiajs "It's pretty rad". My guy, that's may be the understatement of the century right there.

相关视频

CSS Trick! ⚡️ You can use scroll-driven animation with background-attachment to create a dynamic glowing card scroller without JS 🔥 section { animation:vibe; animation-timeline:--list; } @​keyframes vibe { to{--hue:320;}} .glow {background: hsl(var(--hue) 80% 50%);} Here's how! 🤙 You can use the background-attachment trick used in other glow card demos 😎 article { background-attachment: fixed; } The difference here is that you aren't going to update the fixed background position with your pointer this time. It can remain fixed. The magic part is that as you scroll, the background will leave the card that's leaving and enter the card that's entering ✨ For the extra background glow, you can use a fixed pseudo element on the list container itself 💪 Once that's in place, you're only task is to change the color of the background as you scroll 🤔 Create a custom property declaration for the --hue @​property --base { inherits: true; syntax: ' '; initial-value: 0; } Then create an animation that updates this value @​keyframes accent { to { --hue: 320; }} The last piece is hooking it up to scroll and there is a little trick in here 👀 First, you need an inline scroll-timeline on the list ul { scroll-timeline: --list inline; } Then you can use timeline-scope to hoist that scroll-timeline up so a parent can use it. You then animate the custom property on this element and let the value cascade down to the places that need it 🔥 section { timeline-scope: --list; animation: accent both linear; animation-timeline: --list; } For example, the glow uses the --hue this way [data-glow] { background-image: radial-gradient( 150px 150px at 50% 50%, hsl(var(--hue) 100% 70% / 0.25), transparent ); } Lastly, scroll-snap is optional of course but plays nice with the scroll-driven animation demos ✨ The key for that is ul { scroll-snap-type: x mandatory; } li { scroll-snap-align: center; } That's it! Pretty fun trick to play with! 🤓 Any questions, let me know! Should we add it to the video walkthrough list? CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

116,625 次观看 • 2 年前

Future CSS Tip! 🍏 You can create this Apple-style photo scroller by combining CSS scroll-driven animations and CSS scroll-snap 😍 Peep those changing captions 👀 No JS! img { animation: highlight both linear; animation-timeline: view(inline); 👈 Horizontal animation-range: cover 0% cover 50%; 👈 Finish } @ keyframes highlight { 50% { translate: 0 0; scale: var(--starting-scale); 👈 props opacity: var(--starting-opacity); 👈 } 100% { translate: 0 0; scale: 1; opacity: 1; } } Without the animation support, you get a standard unordered list containing some s 🤙 How do we swap the captions though? The "trick" is to use position: absolute on the figcaption and animate their opacity based on the ViewTimeline of their parent list item 😎 figcaption { animation: show both linear; animation-timeline: --list-item; } @ keyframes show { 0%, 45%, 55%, 100% { opacity: 0; } 50% { opacity: 1; } } li { view-timeline-name: --list-item; view-timeline-axis: inline; 👈 important! } The parent of the scroll track uses position: relative so all the captions sit in the middle even though they are in the right place for the markup 🙌 The last bit is the scroll-snap 🤙 Not much to it at all. Wrap the list and make it scrollable. Then add scroll-snap-type .wrapper { scroll-snap-type: x mandatory; overflow-x: scroll; } Then make sure each list item has scroll-snap-align set on it li { scroll-snap-align: center; } That's it! Pretty cool demo to put together and see how to do this stuff with these APIs 🤓 A lot of cool little tricks to pick up for writing your CSS! ⭐️ CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

234,583 次观看 • 3 年前