HTMX + Flask: Modern Python Web Apps, Hold the JavaScript Transcripts
Chapter: Feature 3: Infinite scroll
Lecture: Popular sites using infinite scroll

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Even if the term "Infinite Scroll" doesn't connect with you,
0:02 if you're not exactly sure what this is,
0:04 you've definitely seen it. Popular social media sites like Facebook or Instagram,
0:10 they don't have pages, you just keep scrolling,
0:12 especially on mobile. Similarly, with Twitter,
0:16 here's my personal Twitter feed, and you can see if you just scroll,
0:20 the scroll bar is however big it is,
0:22 but if you get to the bottom it's not done,
0:24 it just pulls in more content and more content.
0:28 Even places like search engines, like Duck,
0:30 Duck go, one of their options is to do infinite scroll for the search results.
0:34 I don't remember if this is the default,
0:36 but if you go in here you can see like here's page one and page two
0:39 and they just put this divider, and you just keep scrolling,
0:41 keep scrolling to figure out where the thing you're looking for goes up in the results.
0:45 So Infinite Scroll is very,
0:48 very common. It's great on these sites that have tons of content and they really
0:52 don't end. How does that apply to our video collector app?
0:57 Well, we have this feed.
0:59 Remember we saw the feed, and it was really slow.
1:02 I had to pull it up, and it took about five seconds to render this feat
1:05 of all of the videos on the site.
1:07 Well, first of all, do you want to show them all of the videos?
1:09 Probably not, like let them go see the new ones and the popular ones and
1:13 then if they keep scrolling, just keep providing them more.
1:15 So what we want to do is when they get to the end of the feed,
1:18 the ones we've displayed so far.
1:21 We want to show this little, this bar thing at the bottom that's animated,
1:25 this little working, thinking type of animated thing as we're pulling in more videos and then boom
1:30 more of the videos just falling, and we just keep scrolling and keep scrolling.
1:34 So that's what this chapter is about.
1:36 We're going to add that feature right there.
1:38 This infinite scroll to the video feed,
1:40 which shows the most recent or most popular videos,
1:43 something like that. I don't remember exactly what the sort is,
1:45 but it shows all the videos on the site in some sort of ranked order.
1:49 Our video collector users are going to love it.