Scroll Progress Indicator CSS Generator - Online
Create a sticky scroll progress bar for blog posts. Choose colors and height. Copy the minimal CSS and HTML.
UD5 Toolkit
š Demo Content ā Scroll down inside this box
This is a demonstration area. On a real page, the monitor tracks window.scrollY and window.scrollX globally. Scroll this page up and down to see the values change live.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet.
š Tip: Scroll the main page now and watch the numbers update in real-time above!
scrollTop / scrollY?
scrollTop (or window.scrollY) represents the number of pixels the document has been scrolled vertically from the top. It's the distance between the top edge of the viewport and the top edge of the document. A value of 0 means you're at the very top of the page.
scrollLeft / scrollX?
scrollLeft (or window.scrollX) measures horizontal scrolling ā how many pixels the document has been scrolled from the left edge. This is less common on responsive websites but can occur on wide tables, code blocks, or fixed-width layouts.
Scroll percentage = scrollTop / (scrollHeight - clientHeight) Ć 100. The denominator represents the maximum scrollable distance. When this value reaches 100%, you've scrolled to the very bottom of the page. If the page fits entirely within the viewport, the percentage is 0% (or NaN, which we display as 0%).
The most reliable modern approach: window.scrollY for vertical and window.scrollX for horizontal scroll position. Legacy alternatives include window.pageYOffset and document.documentElement.scrollTop. All major browsers support scrollY/scrollX.
scrollHeight and clientHeight?
scrollHeight is the total height of the document including content not visible in the viewport. clientHeight is the visible height of the viewport (the browser window's content area). Their difference gives the maximum scrollable distance.
Store the previous scrollY value and compare it with the current one. If current > previous, the user is scrolling down. If current < previous, they're scrolling up. This monitor tracks direction in real-time using this exact technique.
Smooth scrolling animates the transition between scroll positions. Use window.scrollTo({ top: value, behavior: 'smooth' }) or CSS scroll-behavior: smooth on the html element. The "Jump to" feature in this tool uses smooth scrolling for a polished experience.
Real-time scroll monitoring is essential for debugging scroll-based animations, implementing lazy loading, triggering events at specific scroll depths, measuring user engagement (how far users scroll), and building features like sticky headers, progress indicators, and infinite scroll.
scrollTopMax and maximum scroll values?
The maximum scroll value equals scrollHeight - clientHeight for vertical and scrollWidth - clientWidth for horizontal scrolling. Some browsers support the non-standard scrollTopMax property, but calculating it manually is more reliable across all browsers.
Horizontal scrolling is generally discouraged in web design as it creates a poor user experience, especially on mobile devices. It can also negatively impact SEO if content is hidden off-screen. Google's mobile-first indexing penalizes sites that require horizontal scrolling to access content. Always ensure your layout is responsive.
Use window.addEventListener('scroll', callback) but consider performance: scroll events fire rapidly. Debounce or throttle your handler, or use requestAnimationFrame for visual updates. For non-visual work, consider IntersectionObserver as a more performant alternative.
All scroll position values are displayed in CSS pixels (px). On high-DPI/Retina displays, CSS pixels may differ from device pixels. The monitor reflects what JavaScript reports via window.scrollY and window.scrollX, which always use CSS pixels regardless of device pixel ratio.
Create a sticky scroll progress bar for blog posts. Choose colors and height. Copy the minimal CSS and HTML.
Enter any live URL and view it through eight different color vision deficiency filters. Identify contrast issues and improve your siteās accessibility.
Enter a URL and click to check if it's reachable from your browser (CORS-limited, uses no-cors fetch). Quick manual test. Local only.
Drag and drop pieces to set up a chess position. Generate FEN string and copy to share. Analyze openings. Local only.
Scan QR codes using your device camera. Decodes text, URLs, and WiāFi credentials directly in the browser. No data sent to server.
Create a pure CSS scroll progress indicator using animationātimeline: scroll(). No JavaScript. Copy the complete code.
Send a test CSP violation report and see the ReportingObserver in action. Understand how monitoring works.
Write a media query and see if it matches as you resize the iframe. Understand width, height, and resolution queries.
Watch for updates to ariaālive regions and log what a screen reader would announce. Debug live regions.
Select any element on the test page and monitor its size changes with ResizeObserver. See log of all entries.
Drag a positioned box and see the top/right/bottom/left values change. Understand containing blocks. Visual.
See how overflow: visible, hidden, scroll, and auto behave with real content. Clone to test with your text.
Use CSS masks and fixed backgrounds to create a unique parallax reveal effect. Copy the code. No JavaScript.
Connect a MIDI controller and see every message in a log. Filter by channel and type. Essential for debugging music apps.
Play an audio file or use mic to see realātime frequency bars. Choose colors. Great for music videos. Canvas.
Point your camera at an object and see the dominant color in real time. Click to copy the hex. Fun tool for designers.
See the current time displayed in binary and hexadecimal. Dark theme, fullāscreen mode. A geeky desk decoration.
Create a shadow that appears when a container is scrollable. Pure CSS using background attachments. Copy the style easily.
Speak into the mic and see a live transcript with word count. Uses the Web Speech API. Nothing is stored.
Request permission and detect when the user is idle (away from keyboard). See screen lock state. For nativeālike apps.
See the International Space Stationās current position on a world map in real time. Uses public API. No refresh.
Point your camera at a barcode and decode it live. Works with multiple formats. Pure JavaScript barcode detection.
View recent earthquakes worldwide on a map. Fetches public USGS GeoJSON feed directly from browser. Real-time data.