A smooth, modern infinite-scroll web app built with HTML, CSS, and JavaScript featuring animated cards, hover effects, loaders, and dynamic content generation using the Intersection Observer API.
🎥 Watch Demo: click to watch
🌐 Live Link: https://dileep-kumawat.github.io/Infinite-Scroll-using-html-css-and-js/
/project
├── index.html # Main UI
├── style.css # Full styling + animations
└── script.js # Infinite scroll logic
- Uses IntersectionObserver
- Automatically loads 10 new cards every time the sentinel enters view
- Smooth loader animation while fetching new content
Each card includes:
- Dynamic SVG animation
- Like, comment & view buttons
- Hover animations & 3D-styled floating background
- Toggle switch UI
- Efficient DOM batching
- Minimal reflows
- Responsive grid layout
- Handles unlimited data loading
-
HTML5
-
CSS3 (Animations, Grid, 3D transforms)
-
JavaScript
- IntersectionObserver
- DOM Manipulation
- Asynchronous loading
-
A sentinel element is placed at the bottom.
-
The IntersectionObserver watches when the sentinel appears on screen.
-
When triggered,
loadElem()runs:- Shows loader
- Adds 10 new cards dynamically
- Hides loader
- Repeats infinitely
const observer = new IntersectionObserver(entries => {
if (entries[0].isIntersecting) {
loadElem();
}
});
observer.observe(document.querySelector("#sentinel"));- Clone the repo
git clone https://github.com/Dileep-kumawat/Infinite-Scroll-using-html-css-and-js.git- Open the project
cd infinite-scroll- Run it Just open index.html in your browser. No server needed.
Built by Dileep 🔥 Passionate Frontend & Full-Stack Developer
If you like this project, please ⭐ it on GitHub!
