Reading progress bar
Barra de progreso de lectura · Scroll progress · Reading progress bar · Scroll indicator · Indicatore di lettura
A thin bar at the top of the page fills up as you read, sometimes joined by a ring showing the percentage or time left. It tells you at a glance how far you are from the end of the article.
- Era
- 2014 – today
- Use
- Mainstream
Live demo
View code
<main class="vp">
<i class="bar"></i>
<div class="doc">
<p class="k">Cultura · 6 min</p>
<h1>La lenta arte del caffè</h1>
<p>Ogni mattina, prima che la città si svegli, i baristi del quartiere accendono le macchine e ascoltano il primo sibilo del vapore.</p>
<p>È un rito fatto di gesti precisi, tazze calde e chiacchiere a mezza voce, che si ripete uguale da generazioni.</p>
<blockquote>«Il caffè buono non ha fretta.»</blockquote>
<p>Così, tra una moka e un cappuccino, il quartiere ritrova il suo ritmo.</p>
<p class="end">— Fine —</p>
</div>
<div class="ring"><svg viewBox="0 0 40 40"><circle class="bg" cx="20" cy="20" r="16"/><circle class="fg" cx="20" cy="20" r="16"/></svg><span class="pc">0%</span></div>
</main>
<script>
const vp=document.querySelector('.vp'),pc=document.querySelector('.pc');
const setP=p=>{vp.style.setProperty('--p',p);pc.textContent=Math.round(p*100)+'%'};
if(matchMedia('(prefers-reduced-motion: no-preference)').matches){const T=7000,t0=performance.now();
const loop=n=>{const u=((n-t0)%T)/T,p=u<.08?0:u>.85?1:(u-.08)/.77;setP(p*p*(3-2*p));requestAnimationFrame(loop)};requestAnimationFrame(loop)}
else setP(.4);
</script> body{margin:0;height:100vh;display:grid;place-items:center;background:#E8E4DC;font-family:'Source Sans 3',sans-serif;color:#1D1D1F}
.vp{--p:0;position:relative;width:400px;max-width:92vw;height:280px;overflow:hidden;border-radius:14px;background:#FBFAF7;box-shadow:0 20px 40px -24px #1D1D1F66}
.bar{position:absolute;left:0;top:0;right:0;height:4px;background:#E4572E;transform:scaleX(var(--p));transform-origin:0 50%;z-index:2}
.doc{padding:22px 26px;transform:translateY(calc(var(--p)*-330px))}
.k{font-size:11px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:#E4572E;margin:0}
h1{font-family:Newsreader,serif;font-weight:600;font-size:28px;line-height:1.1;margin:6px 0 12px}
.doc p{font-size:14px;line-height:1.55;margin:0 0 12px;color:#1D1D1Fd9}
blockquote{margin:0 0 12px;padding-left:12px;border-left:3px solid #E4572E;font-family:Newsreader,serif;font-size:19px;font-style:italic}
.end{text-align:center;color:#6E6A63!important}
.ring{position:absolute;right:12px;bottom:12px;width:50px;height:50px;border-radius:50%;background:#fff;box-shadow:0 6px 16px -6px #1D1D1F55;display:grid;place-items:center}
.ring svg{position:absolute;inset:5px;transform:rotate(-90deg)}
circle{fill:none;stroke-width:3.5}
.bg{stroke:#E8E4DC}
.fg{stroke:#E4572E;stroke-linecap:round;stroke-dasharray:100.5;stroke-dashoffset:calc(100.5 - var(--p)*100.5)}
.pc{font-size:11px;font-weight:600} Characteristics
- Horizontal bar with scaleX tied to scroll
- Circular ring using stroke-dashoffset
- Percentage or minutes left
- Subtle, unobtrusive accent colour
- Back-to-top button appearing at the end
Palette
Click a swatch to copy it
Typography
Headings · Newsreader Reading progress bar
Body · Source Sans 3 A thin bar at the top of the page fills up as you read, sometimes joined by a ring showing the percentage or time left. It tells you at a glance how far you are from the end of the article.
Motion
- Easing
lineare (legato allo scroll)- Typical duration
- tutta la lunghezza della pagina
- Techniques
- CSS animation-timeline scroll(), scroll listener con requestAnimationFrame, transform scaleX con transform-origin left, SVG stroke-dashoffset, elemento progress con ruolo accessibile
Accessibility (reduced motion)
The bar can stay since it is driven directly by the user's scroll; just avoid springy transitions or bounces.
Prompt for your agent
Copy and paste into your prompt to have an agent or image generator reproduce this style.
For web pages and UI
Design the web page or interface in this style: Reading progress bar (Barra de progreso de lectura, Scroll progress). A thin bar at the top of the page fills up as you read, sometimes joined by a ring showing the percentage or time left. It tells you at a glance how far you are from the end of the article. Characteristics: Horizontal bar with scaleX tied to scroll, Circular ring using stroke-dashoffset, Percentage or minutes left, Subtle, unobtrusive accent colour, Back-to-top button appearing at the end. Palette: #FBFAF7, #1D1D1F, #E4572E, #76B041, #E8E4DC, #6E6A63. Typography: headings in Newsreader, body text in Source Sans 3 (Google Fonts or equivalents). Mood: clean, rational, subtle. Motion: easing lineare (legato allo scroll), typical duration tutta la lunghezza della pagina; techniques: CSS animation-timeline scroll(), scroll listener con requestAnimationFrame, transform scaleX con transform-origin left, SVG stroke-dashoffset, elemento progress con ruolo accessibile. With prefers-reduced-motion: The bar can stay since it is driven directly by the user's scroll; just avoid springy transitions or bounces. References: Barre di lettura dei blog e delle riviste online, scroll-driven animations su MDN, plugin di avanzamento lettura per WordPress, Medium e i tempi di lettura stimati.
Relations
Derives from
Similar to
References
- Barre di lettura dei blog e delle riviste online
- scroll-driven animations su MDN
- plugin di avanzamento lettura per WordPress
- Medium e i tempi di lettura stimati