Infinity Scroll requires no build pipeline, no package bundler, and no back-end server. The only external dependency is a free Unsplash API key. Follow the steps below and you’ll have a working gallery open in your browser in minutes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ClaytonSeager/InifinityScroll/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites: You need a modern browser that supports ES2017+ (
async/await, fetch) — Chrome, Firefox, Edge, or Safari all work. You also need a free Unsplash Developer account to obtain an API key. If you want to use the npm start live-server option, Node.js must be installed.Get an Unsplash API key
Infinity Scroll fetches images directly from the Unsplash API, so you need your own Access Key:
- Go to https://unsplash.com/developers and sign in or create a free account.
- Click Your apps → New Application.
- Accept the API use guidelines, give your app a name and description, then click Create application.
- Scroll down to the Keys section and copy the Access Key.
Configure the API key
Open Replace the value of Save the file. You can also change
Infinity.js in any text editor. The configuration constants are at the very top of the file:KEY with the Access Key you copied from the Unsplash dashboard:count to control how many images are fetched per scroll batch (see Configuration for details).Open the gallery
You have two options for launching the gallery:The
npm start script uses live-server, which is declared as the sole dependency in package.json. It opens http://127.0.0.1:8080 automatically and hot-reloads whenever you edit any project file — handy when experimenting with the configuration.Verify it works
Once the gallery opens you should see the following sequence:- Loader appears — A semi-transparent white overlay with a spinning SVG animation covers the full page while the first API request is in flight.
- 10 images render — As each image finishes loading, the live counter in the sticky header increments. Once all 10 images have loaded the loader overlay disappears and the gallery becomes scrollable.
- Scroll to fetch more — Scroll down toward the bottom of the page. When you are within 1000px of the page end the loader reappears briefly and another 10 images are appended below the existing ones. The counter continues to increment with each new image.
KEY value is correct and that you haven’t exceeded the Unsplash free-tier rate limit of 50 requests/hour.