Google Trends in the US for the past seven days shows "spotify wrapped 2026" at more than 1 million searches, up 1000%, with "youtube recap" and "apple music replay 2026" also rising. That is a useful signal: people enjoy a compact, personal summary they can swipe through and share.
We can borrow the format without borrowing anyone's branding. In this tutorial, we will build an original year-in-review story for a developer. It has full-screen cards for commits, favorite languages, and a longest coding streak, plus a final share card that can be downloaded as a PNG. The look uses a dark ink background, warm orange, and pale mint. The data is fictional sample data that you can replace with your own.
The implementation is a single index.html. CSS does most of the animation work: scroll snapping keeps the story in panels, scroll-driven timelines reveal content, and a registered integer property lets a CSS counter count up. A small script handles the parts CSS cannot do alone: a fallback for browsers without scroll timelines, the expand and collapse control, and drawing a downloadable image on a canvas.
There are a few tradeoffs worth being clear about up front. CSS counters are visual, so each animated number also has a useful text value and an accessible label. Scroll-driven animations are progressively enhanced, not required for the page to work. And the canvas image is a hand-drawn summary, not a screenshot of the HTML. That keeps it dependency-free, but means we need to draw and position its text ourselves.
Start with the story structure
A good story page has a clear sequence. For this example, the sequence is:
- An opening card that sets the year and theme.
- A total commits card.
- A top language card.
- A longest streak card.
- A share card with an image download action.
Each card gets at least one viewport of height. The <main> element becomes the vertical scroll container, and scroll-snap-type asks the browser to settle on a card after a scroll. This feels natural on touch screens and still works with a mouse wheel, keyboard, or scrollbar.
Start with this small structural sketch:
<main class="story" aria-label="Developer year in review">
<section class="story-card" id="start" aria-labelledby="start-title">
<p>Developer year in review</p>
<h1 id="start-title">A year of making things.</h1>
<a href="#commits">Start the story</a>
</section>
<section class="story-card" id="commits" aria-labelledby="commits-title">
<p>In 2026, you made</p>
<h2 id="commits-title">1,284 commits</h2>
</section>
<!-- Add the other story cards here. -->
</main>
The full page will include a small fixed navigation with links to each card. Those links are useful when a reader wants to jump to a section, and they make the story usable without relying on scroll gestures. Each section has a heading connected with aria-labelledby, so a screen reader has a sensible name for the region.
For the sample story, I am using values that are illustrative rather than claims about a real developer. If you connect this design to real activity later, decide what you want to share before collecting or displaying the data. A year-in-review page should not quietly expose private repository names or work activity.
Add snap points and a flexible visual system
Set up the base colors and card layout first. Using 100svh helps the cards fit on mobile browsers where the visible viewport changes as browser controls appear and disappear. We include 100vh before it as a fallback. The clamp() values keep the type and spacing responsive without a row of device-specific breakpoints.
:root {
color-scheme: dark;
--ink: #10191b;
--panel: #182527;
--mint: #c6f4dd;
--orange: #ff9a67;
--muted: #9eb4b1;
--display: clamp(3rem, 11vw, 8rem);
--space: clamp(1.25rem, 5vw, 4.5rem);
}
* {
box-sizing: border-box;
}
html {
background: var(--ink);
scroll-behavior: smooth;
}
body {
margin: 0;
background: var(--ink);
color: var(--mint);
font-family: system-ui, sans-serif;
}
.story {
height: 100vh;
height: 100svh;
overflow-y: auto;
scroll-snap-type: y mandatory;
}
.story-card {
min-height: 100vh;
min-height: 100svh;
padding: var(--space);
display: grid;
align-content: center;
gap: 1.5rem;
overflow: hidden;
position: relative;
scroll-snap-align: start;
scroll-snap-stop: always;
background:
radial-gradient(ellipse at 85% 15%, #31504a 0, transparent 38%),
var(--ink);
}
The second height and min-height declarations are intentional. Older browsers that do not know svh use the vh value. Browsers that do know it use the small viewport height, which avoids some of the jumping caused by changing mobile browser chrome.
scroll-snap-stop: always asks the browser not to skip over a snap point in one large scroll. It is not supported identically in every browser, so the story remains understandable if it is ignored. Avoid making a page depend on snapping to reveal essential content. A reader must still be able to scroll through the document naturally.
Add the card typography and the small navigation. The navigation is fixed to the right edge on wide screens and moves to the bottom on narrow screens.
.story-card:nth-child(even) {
background:
radial-gradient(ellipse at 15% 80%, #604130 0, transparent 38%),
var(--ink);
}
.story-card h1,
.story-card h2 {
max-width: 12ch;
margin: 0;
font-size: var(--display);
line-height: 0.98;
letter-spacing: -0.06em;
}
.story-card p {
max-width: 42rem;
margin: 0;
color: var(--muted);
font-size: clamp(1rem, 2vw, 1.35rem);
line-height: 1.6;
}
.story-nav {
position: fixed;
z-index: 5;
top: 50%;
right: 1rem;
display: grid;
gap: 0.6rem;
transform: translateY(-50%);
}
.story-nav a {
width: 0.75rem;
height: 0.75rem;
border: 1px solid var(--mint);
border-radius: 50%;
background: var(--ink);
}
.story-nav a:focus-visible,
button:focus-visible,
.story-card a:focus-visible {
outline: 3px solid var(--orange);
outline-offset: 4px;
}
@media (max-width: 38rem) {
.story-nav {
top: auto;
right: 50%;
bottom: 1rem;
grid-auto-flow: column;
transform: translateX(50%);
}
}
These links are deliberately dots rather than miniature labels. Give each one a screen-reader label in the markup, and keep a visible focus outline for keyboard users. The page itself remains a sequence of headings and text, not a custom carousel widget. That means browser scrolling and keyboard navigation retain their familiar behavior.
Build the metric cards
Each metric gets a large number, a label, and one short piece of context. Keeping the supporting sentence visible matters: a number such as 42 does not explain whether it means commits, days, or repositories.
Here is the pattern for a metric card:
<section class="story-card" id="commits" aria-labelledby="commits-title">
<p class="eyebrow">A year of small steps</p>
<h2 id="commits-title">You made</h2>
<p class="metric">
<span class="metric-count" data-target="1284" aria-label="1,284">1,284</span>
<span>commits</span>
</p>
<p>One useful change at a time added up to a lot of progress.</p>
</section>
The number is ordinary text in the HTML. That gives the page a useful default if JavaScript does not run or a browser does not support the animated counter. In the enhanced version, CSS paints the counter in a pseudo-element. The aria-label exposes the final value rather than the changing visual count.
The .metric class and count styling give each card consistent sizing:
.metric {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: 0.25em;
margin: 0;
font-size: clamp(2.5rem, 9vw, 7rem);
font-weight: 750;
letter-spacing: -0.06em;
line-height: 1;
}
.metric-count {
display: inline-block;
position: relative;
color: transparent;
counter-reset: metric var(--count);
font-variant-numeric: tabular-nums;
}
.metric-count::after {
position: absolute;
inset: 0;
color: var(--orange);
content: counter(metric);
}
At this point the counter needs a --count value, and it needs to be animatable as an integer. A regular CSS custom property is treated as an untyped value. Registering it with @property tells the browser its type, initial value, and inheritance behavior:
@property --count {
syntax: "<integer>";
inherits: false;
initial-value: 0;
}
.metric-count {
--count: 0;
--target: 0;
}
.metric-count[data-target="1284"] {
--target: 1284;
}
We do not want a CSS selector for every possible statistic. Instead, put the target value in a style attribute on each count. That keeps the markup easy to update:
<span
class="metric-count"
data-target="1284"
style="--target: 1284"
aria-label="1,284"
>1,284</span>
Now define a keyframe animation from zero to the target. For the scroll-timeline version, each metric receives its own view timeline. animation-range limits the part of that timeline during which the number changes. It starts the moment the number's top edge crosses into the scroller and completes once the whole number is inside it.
That range choice matters more than it looks. My first version used entry 0% cover 40%, which reads nicely but has a trap: cover 40% is measured against the element's whole trip across the viewport, so where the element sits inside the card changes how far along it gets. When the card snaps into place, a number near the top of its card is past 40% and finishes. A number lower in its card stops short. In testing, the streak card settled at 36 days when the target was 42, and nothing in the console said why. entry 100% means "fully visible", and on a full-screen snapped card that is always true at rest, so the count always lands on the real value.
@keyframes count-up {
from {
--count: 0;
}
to {
--count: var(--target);
}
}
@supports (animation-timeline: view()) {
.metric-count {
animation-name: count-up;
animation-timing-function: linear;
animation-fill-mode: both;
animation-timeline: view();
animation-range: entry 0% entry 100%;
}
}
counter() renders the registered integer as a number, which is why the target should be an integer. This approach is great for whole-number metrics such as commits and days. It is not a general-purpose number formatter. If your story needs decimals, currency, a suffix that changes by locale, or values with leading zeroes, format the display with JavaScript or provide a separately formatted static value.
Add scroll-driven reveals
The same view timeline idea can reveal the card's text and decorative elements. Keep the unanimated state fully visible. That way, if the browser does not support scroll-driven animations, the content is still there.
<section class="story-card" id="streak" aria-labelledby="streak-title">
<div class="reveal">
<p class="eyebrow">Your longest run</p>
<h2 id="streak-title">42 days in a row.</h2>
<p>A stretch of steady practice, with room for life outside the editor.</p>
</div>
</section>
A view() timeline follows an element as it passes through the scrollport. The range names such as entry and cover let us choose the portion of that movement that drives the animation.
@keyframes rise-in {
from {
opacity: 0;
transform: translateY(1.75rem) scale(0.98);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
@supports (animation-timeline: view()) {
.reveal {
animation-name: rise-in;
animation-timing-function: linear;
animation-fill-mode: both;
animation-timeline: view();
animation-range: entry 0% entry 100%;
}
}
A common gotcha is putting important content at opacity: 0 by default and only making it visible inside an @supports block. That turns a missing feature into missing content. Here, the default is readable, and the supported browser adds an animation. The number animation follows the same principle by keeping its final value in the text.
The animation ranges are a starting point, not universal magic values. A very tall card and a short card move through a view timeline at different rates. Adjust the ranges while testing with actual content, and avoid requiring a reader to hit a tiny scroll position to see an important label.
Add an IntersectionObserver fallback
The CSS in the previous sections works in browsers that implement scroll-driven animations. In the rest, we can use IntersectionObserver to reveal cards as they enter the story scrollport. It is a useful fallback because it responds to the same basic event without listening to every scroll frame.
First, add a CSS class that starts the simpler time-based animation:
.fallback-motion .reveal.is-visible {
animation: rise-in 650ms ease-out both;
}
.fallback-motion .metric-count {
animation: count-up 1.1s ease-out both;
}
.plain-counts .metric-count {
color: var(--orange);
animation: none;
}
.plain-counts .metric-count::after {
display: none;
}
Then check for scroll-timeline support and set up an observer only when needed. The fallback observer watches each .reveal and each .metric-count, then stops observing an element after it has appeared. When typed custom properties are unavailable too, the script leaves the supplied text visible instead of attempting a counter animation.
const supportsViewTimeline =
CSS.supports("animation-timeline: view()");
const supportsRegisteredProperties =
typeof CSS.registerProperty === "function";
if (!supportsViewTimeline) {
document.documentElement.classList.add("fallback-motion");
const counts = document.querySelectorAll(".metric-count");
if (!supportsRegisteredProperties) {
document.documentElement.classList.add("plain-counts");
counts.forEach((count) => {
count.textContent = count.dataset.target ?? count.textContent;
});
}
const observer = new IntersectionObserver(
(entries, currentObserver) => {
entries.forEach((entry) => {
if (!entry.isIntersecting) return;
entry.target.classList.add("is-visible");
currentObserver.unobserve(entry.target);
});
},
{
root: document.querySelector(".story"),
threshold: 0.18,
rootMargin: "0px 0px -8% 0px"
}
);
document.querySelectorAll(".reveal, .metric-count").forEach((item) => {
observer.observe(item);
});
}
This fallback favors reliability over exact parity. The observer triggers a conventional animation once when an item enters view. The CSS scroll timeline, in contrast, follows the reader's scroll position and can reverse as they scroll back. The two behaviors are close enough for a short story, but they are not identical, and there is no reason to pretend otherwise.
The code checks CSS.registerProperty before relying on typed custom properties in the fallback. The @property rule is the declarative registration used by the page. A browser without registered custom properties gets static numbers and visible content. The important part is graceful behavior, not making every browser perform the same effect.
Respect reduced motion
Some readers ask their operating system to reduce motion. We should make that preference meaningful here. Turn off smooth scrolling and animations, disable snap, and set the CSS counter to its final value when the browser supports the counter enhancement.
@media (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
.story {
scroll-snap-type: none;
}
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
scroll-behavior: auto !important;
transition-duration: 0.01ms !important;
}
.metric-count {
--count: var(--target);
}
}
The 0.01ms duration pattern prevents some animated states from staying at their initial keyframe when animation is disabled. The count rule is more direct: show the final target rather than making the reader watch a number change.
We will also check this preference in JavaScript before using the View Transitions API. CSS handles visual transitions on the page, but the API itself captures and animates a transition between two document states. Skipping that API call when motion reduction is requested keeps the behavior consistent.
Add an expandable share card
The final card should work as a normal part of the story and as a more prominent poster when expanded. It is still an HTML element, so it remains selectable and readable. The view-transition-name gives the browser a named visual element to animate between the two layouts.
The relevant markup will look like this:
<div class="share-shell">
<div class="share-preview" id="share-preview">
<p>Developer year in review</p>
<h2>2026, made by you.</h2>
<p>1,284 commits</p>
<p>TypeScript was your top language.</p>
<p>Longest streak: 42 days</p>
</div>
<button
class="share-toggle"
type="button"
aria-expanded="false"
aria-controls="share-preview"
>
Expand share card
</button>
<button class="download-button" type="button">
Download share image
</button>
</div>
The expanded state changes the card's aspect ratio and maximum width. The content does not disappear and reappear; it changes shape in place. That is intentional. Keeping the same element present makes the transition easier to follow and avoids hiding text from assistive technology.
.share-shell {
width: min(100%, 42rem);
margin-inline: 0;
}
.share-preview {
width: 100%;
aspect-ratio: 16 / 9;
padding: clamp(1.25rem, 5vw, 2.5rem);
display: grid;
align-content: center;
gap: 0.85rem;
overflow: hidden;
border: 1px solid #54716b;
border-radius: 1.5rem;
background:
radial-gradient(circle at 85% 12%, #ff9a67 0, transparent 30%),
linear-gradient(145deg, #203b38, #10191b 65%);
view-transition-name: share-preview;
}
.share-preview h2 {
max-width: 9ch;
margin: 0;
font-size: clamp(2rem, 7vw, 4rem);
}
.share-preview p {
margin: 0;
}
.share-shell.is-expanded .share-preview {
width: min(100%, 25rem, 40svh);
aspect-ratio: 4 / 5;
margin-inline: 0;
border-color: var(--orange);
box-shadow: 0 1.5rem 5rem #0008;
}
.share-shell button {
min-height: 2.75rem;
margin: 1rem 0.5rem 0 0;
padding: 0.65rem 1rem;
border: 1px solid var(--mint);
border-radius: 999px;
background: transparent;
color: var(--mint);
font: inherit;
cursor: pointer;
}
::view-transition-old(share-preview),
::view-transition-new(share-preview) {
animation-duration: 280ms;
animation-timing-function: ease-in-out;
}
Use document.startViewTransition() when it is available, and update the class directly when it is not. The state update is a small function so both paths do exactly the same thing. We also update the button label and aria-expanded state as part of that change.
const shareShell = document.querySelector(".share-shell");
const shareToggle = document.querySelector(".share-toggle");
const reducedMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)"
);
function setShareExpanded(expanded) {
shareShell.classList.toggle("is-expanded", expanded);
shareToggle.setAttribute("aria-expanded", String(expanded));
shareToggle.textContent = expanded
? "Collapse share card"
: "Expand share card";
}
shareToggle.addEventListener("click", () => {
const expanded = !shareShell.classList.contains("is-expanded");
const update = () => setShareExpanded(expanded);
if (
!reducedMotion.matches &&
typeof document.startViewTransition === "function"
) {
document.startViewTransition(update);
} else {
update();
}
});
A View Transition is an enhancement here, not a dependency. If the method is missing, the aspect ratio still changes immediately. The named transition can also be disabled or limited by browser settings, so do not make a control's meaning depend on the transition finishing.
For a production page, consider moving focus after the card changes only if the interaction changes the available controls or moves them somewhere unexpected. In this version, the controls stay in place and the same button remains available, so changing focus would be more disruptive than helpful.
Draw a downloadable image with canvas
A dependency-free share image is practical if its design is simple. We can draw a fixed-size PNG with the year, the commit count, the top language, and the streak. The output is a summary image, not a pixel-perfect capture of the HTML share card. That tradeoff avoids an image-rendering package and avoids cross-origin font or image problems.
The canvas does not have to be part of the visible page. Create it in memory, draw the image, convert it to a PNG blob, and trigger a download from a temporary object URL.
const downloadButton = document.querySelector(".download-button");
downloadButton.addEventListener("click", async () => {
const canvas = document.createElement("canvas");
canvas.width = 1200;
canvas.height = 1500;
const context = canvas.getContext("2d");
if (!context) {
throw new Error("Canvas 2D context is not available.");
}
const background = context.createLinearGradient(0, 0, 1200, 1500);
background.addColorStop(0, "#203b38");
background.addColorStop(1, "#10191b");
context.fillStyle = background;
context.fillRect(0, 0, 1200, 1500);
context.fillStyle = "#ff9a67";
context.beginPath();
context.arc(1020, 140, 230, 0, Math.PI * 2);
context.fill();
context.fillStyle = "#c6f4dd";
context.font = "700 42px system-ui, sans-serif";
context.fillText("DEVELOPER YEAR IN REVIEW", 90, 150);
context.font = "750 100px system-ui, sans-serif";
context.fillText("2026,", 90, 390);
context.fillText("made by you.", 90, 500);
context.fillStyle = "#ff9a67";
context.font = "750 150px system-ui, sans-serif";
context.fillText("1,284", 90, 800);
context.fillStyle = "#c6f4dd";
context.font = "500 44px system-ui, sans-serif";
context.fillText("commits", 90, 870);
context.fillText("Top language: TypeScript", 90, 1050);
context.fillText("Longest streak: 42 days", 90, 1140);
context.fillStyle = "#9eb4b1";
context.font = "400 30px system-ui, sans-serif";
context.fillText("A personal snapshot. Your year, your pace.", 90, 1370);
const blob = await new Promise((resolve) => {
canvas.toBlob(resolve, "image/png");
});
if (!blob) {
throw new Error("The share image could not be created.");
}
const url = URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = url;
link.download = "developer-year-in-review-2026.png";
link.click();
URL.revokeObjectURL(url);
});
toBlob() may return null, so the code checks before trying to download. The object URL is released after the click. For applications where a browser delays the download, revoke the URL after a short timeout instead, so it remains available while the download starts.
The drawing uses only shapes, text, gradients, and system fonts. That keeps the image same-origin and avoids the canvas security restriction that can prevent export after drawing a cross-origin image. If you add remote artwork later, check its CORS headers or draw a locally hosted asset.
In a polished app, do not hardcode the same values in the HTML and canvas. Keep one data object and render both views from it. The final self-contained example keeps the sample values explicit for readability, but the canvas action below reads key values from the page to reduce accidental mismatches.
Put the pieces together
The complete file below includes all five cards, the fallback observer, the expandable share card, reduced-motion handling, and a canvas download. Save it as index.html and open it in a current version of Chrome. The external dependencies are zero.
The first three metrics are intentionally modest. Change the data attributes, visible fallback text, accessible labels, and share drawing together when you personalize the page. If you later pull activity from a service, fetch it on a server or from a user-authorized source. Do not place a private access token in this HTML file.
The page does not call any service, and it does not transmit the displayed data. The download is generated locally by the browser. The story is entirely static until the small inline script sets up the optional behaviors.
Browser support notes
Scroll snapping is broadly available, but details such as scroll-snap-stop can vary. The page does not depend on skipping behavior or a particular snap implementation. 100svh is paired with 100vh as a fallback.
Scroll-driven animations (animation-timeline: view() and animation-range) shipped in Chrome and Edge 115, Safari 26, and Firefox 159, which turned them on by default this autumn. That makes them Baseline newly available, which is a polite way of saying a real chunk of your visitors are still on a version without them. So the @supports wrapper and the IntersectionObserver fallback stay. The fallback shows the same content but plays a timed animation once instead of tying it to scroll progress.
The @property rule has been in Chrome since 85, Safari since 16.4, and Firefox since 128. Older browsers ignore it, so the number would jump instead of count. The file keeps the real number as text and switches to that text if registered properties are unavailable.
Same-document view transitions work in Chrome and Edge 111, Safari 18, and Firefox 144. The code feature-detects document.startViewTransition(), so anything older still expands and collapses the share card, it just snaps instead of morphing.
The canvas 2D API and PNG toBlob() work everywhere that matters. One thing I did not expect: encoding the 1200 by 1500 image took close to four seconds in my test run in Chrome, which is why the "Creating your image..." status line is worth keeping. Without it, people click the button twice.
Full index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta
name="description"
content="A personal developer year-in-review story with animated stats."
>
<title>Developer year in review, 2026</title>
<style>
@property --count {
syntax: "<integer>";
inherits: false;
initial-value: 0;
}
:root {
color-scheme: dark;
--ink: #10191b;
--panel: #182527;
--mint: #c6f4dd;
--orange: #ff9a67;
--muted: #9eb4b1;
--display: clamp(3rem, 11vw, 8rem);
--space: clamp(1.25rem, 5vw, 4.5rem);
}
* {
box-sizing: border-box;
}
html {
background: var(--ink);
scroll-behavior: smooth;
}
body {
margin: 0;
background: var(--ink);
color: var(--mint);
font-family: system-ui, sans-serif;
}
.story {
height: 100vh;
height: 100svh;
overflow-y: auto;
scroll-snap-type: y mandatory;
}
.story-card {
min-height: 100vh;
min-height: 100svh;
padding: var(--space);
display: grid;
align-content: center;
gap: 1.5rem;
overflow: hidden;
position: relative;
scroll-snap-align: start;
scroll-snap-stop: always;
background:
radial-gradient(ellipse at 85% 15%, #31504a 0, transparent 38%),
var(--ink);
}
.story-card:nth-child(even) {
background:
radial-gradient(ellipse at 15% 80%, #604130 0, transparent 38%),
var(--ink);
}
.story-card h1,
.story-card h2 {
max-width: 12ch;
margin: 0;
font-size: var(--display);
line-height: 0.98;
letter-spacing: -0.06em;
}
.story-card p {
max-width: 42rem;
margin: 0;
color: var(--muted);
font-size: clamp(1rem, 2vw, 1.35rem);
line-height: 1.6;
}
.eyebrow {
text-transform: uppercase;
letter-spacing: 0.16em;
font-size: 0.8rem !important;
}
.story-card .metric {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: 0.25em;
margin: 0;
color: var(--mint);
font-size: clamp(2.5rem, 9vw, 7rem);
font-weight: 750;
letter-spacing: -0.06em;
line-height: 1;
}
.metric-count {
display: inline-block;
position: relative;
color: transparent;
counter-reset: metric var(--count);
font-variant-numeric: tabular-nums;
}
.metric-count::after {
position: absolute;
inset: 0;
color: var(--orange);
content: counter(metric);
}
.metric-label {
color: var(--mint);
}
.story-card a,
.story-shell button {
color: var(--mint);
}
.story-card > a {
width: fit-content;
padding: 0.7rem 1rem;
border: 1px solid var(--mint);
border-radius: 999px;
text-decoration: none;
}
.story-nav {
position: fixed;
z-index: 5;
top: 50%;
right: 1rem;
display: grid;
gap: 0.6rem;
transform: translateY(-50%);
}
.story-nav a {
width: 0.75rem;
height: 0.75rem;
border: 1px solid var(--mint);
border-radius: 50%;
background: var(--ink);
}
.story-nav a:focus-visible,
button:focus-visible,
.story-card a:focus-visible {
outline: 3px solid var(--orange);
outline-offset: 4px;
}
.reveal {
max-width: 52rem;
}
.share-shell {
width: min(100%, 42rem);
margin-inline: 0;
}
.share-preview {
width: 100%;
aspect-ratio: 16 / 9;
padding: clamp(1.25rem, 5vw, 2.5rem);
display: grid;
align-content: center;
gap: 0.85rem;
overflow: hidden;
border: 1px solid #54716b;
border-radius: 1.5rem;
background:
radial-gradient(circle at 85% 12%, #ff9a67 0, transparent 30%),
linear-gradient(145deg, #203b38, #10191b 65%);
view-transition-name: share-preview;
}
.share-preview h2 {
max-width: 9ch;
margin: 0;
font-size: clamp(2rem, 7vw, 4rem);
}
.share-preview p {
margin: 0;
}
.share-shell.is-expanded .share-preview {
width: min(100%, 25rem, 40svh);
aspect-ratio: 4 / 5;
margin-inline: 0;
border-color: var(--orange);
box-shadow: 0 1.5rem 5rem #0008;
}
.share-shell button {
min-height: 2.75rem;
margin: 1rem 0.5rem 0 0;
padding: 0.65rem 1rem;
border: 1px solid var(--mint);
border-radius: 999px;
background: transparent;
font: inherit;
cursor: pointer;
}
::view-transition-old(share-preview),
::view-transition-new(share-preview) {
animation-duration: 280ms;
animation-timing-function: ease-in-out;
}
@keyframes rise-in {
from {
opacity: 0;
transform: translateY(1.75rem) scale(0.98);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
@keyframes count-up {
from {
--count: 0;
}
to {
--count: var(--target);
}
}
@supports (animation-timeline: view()) {
.reveal {
animation-name: rise-in;
animation-timing-function: linear;
animation-fill-mode: both;
animation-timeline: view();
animation-range: entry 0% entry 100%;
}
.metric-count {
animation-name: count-up;
animation-timing-function: linear;
animation-fill-mode: both;
animation-timeline: view();
animation-range: entry 0% entry 100%;
}
}
.fallback-motion .reveal.is-visible {
animation: rise-in 650ms ease-out both;
}
.fallback-motion .metric-count {
animation: count-up 1.1s ease-out both;
}
.plain-counts .metric-count {
color: var(--orange);
animation: none;
}
.plain-counts .metric-count::after {
display: none;
}
@media (max-width: 38rem) {
.story-nav {
top: auto;
right: 50%;
bottom: 1rem;
grid-auto-flow: column;
transform: translateX(50%);
}
.share-preview {
aspect-ratio: 4 / 3;
}
}
@media (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
.story {
scroll-snap-type: none;
}
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
scroll-behavior: auto !important;
transition-duration: 0.01ms !important;
}
.metric-count {
--count: var(--target);
}
}
</style>
</head>
<body>
<nav class="story-nav" aria-label="Story sections">
<a href="#start" aria-label="Start"></a>
<a href="#commits" aria-label="Commits"></a>
<a href="#language" aria-label="Top language"></a>
<a href="#streak" aria-label="Longest streak"></a>
<a href="#share" aria-label="Share card"></a>
</nav>
<main class="story" aria-label="Developer year in review">
<section class="story-card" id="start" aria-labelledby="start-title">
<div class="reveal">
<p class="eyebrow">Developer year in review</p>
<h1 id="start-title">A year of making things.</h1>
<p>A small collection of the work, habits, and experiments that shaped 2026.</p>
<a href="#commits">Start the story</a>
</div>
</section>
<section class="story-card" id="commits" aria-labelledby="commits-title">
<div class="reveal">
<p class="eyebrow">A year of small steps</p>
<h2 id="commits-title">You made</h2>
<p class="metric">
<span
class="metric-count"
data-target="1284"
style="--target: 1284"
aria-label="1,284"
>1,284</span>
<span class="metric-label">commits</span>
</p>
<p>One useful change at a time added up to a lot of progress.</p>
</div>
</section>
<section class="story-card" id="language" aria-labelledby="language-title">
<div class="reveal">
<p class="eyebrow">Your most-used tool</p>
<h2 id="language-title">TypeScript took the lead.</h2>
<p>It showed up in the projects where you wanted clear contracts and room to grow.</p>
</div>
</section>
<section class="story-card" id="streak" aria-labelledby="streak-title">
<div class="reveal">
<p class="eyebrow">Your longest run</p>
<h2 id="streak-title">42 days in a row.</h2>
<p>A stretch of steady practice, with room for life outside the editor.</p>
<p class="metric">
<span
class="metric-count"
data-target="42"
style="--target: 42"
aria-label="42"
>42</span>
<span class="metric-label">days</span>
</p>
</div>
</section>
<section class="story-card" id="share" aria-labelledby="share-title">
<div class="reveal">
<p class="eyebrow">Keep a snapshot</p>
<h2 id="share-title">Your year, in one card.</h2>
<div class="share-shell">
<div class="share-preview" id="share-preview">
<p class="eyebrow">Developer year in review</p>
<h2>2026, made by you.</h2>
<p>1,284 commits</p>
<p>TypeScript was your top language.</p>
<p>Longest streak: 42 days</p>
</div>
<button
class="share-toggle"
type="button"
aria-expanded="false"
aria-controls="share-preview"
>Expand share card</button>
<button class="download-button" type="button">Download share image</button>
<p class="download-status" aria-live="polite"></p>
</div>
</div>
</section>
</main>
<script>
const supportsViewTimeline =
CSS.supports("animation-timeline: view()");
const supportsRegisteredProperties =
typeof CSS.registerProperty === "function";
if (!supportsViewTimeline) {
document.documentElement.classList.add("fallback-motion");
const counts = document.querySelectorAll(".metric-count");
if (!supportsRegisteredProperties) {
document.documentElement.classList.add("plain-counts");
counts.forEach((count) => {
count.textContent = count.dataset.target ?? count.textContent;
});
}
const story = document.querySelector(".story");
const observer = new IntersectionObserver(
(entries, currentObserver) => {
entries.forEach((entry) => {
if (!entry.isIntersecting) return;
entry.target.classList.add("is-visible");
currentObserver.unobserve(entry.target);
});
},
{
root: story,
threshold: 0.18,
rootMargin: "0px 0px -8% 0px"
}
);
document.querySelectorAll(".reveal, .metric-count").forEach((item) => {
observer.observe(item);
});
}
const shareShell = document.querySelector(".share-shell");
const shareToggle = document.querySelector(".share-toggle");
const reducedMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)"
);
function setShareExpanded(expanded) {
shareShell.classList.toggle("is-expanded", expanded);
shareToggle.setAttribute("aria-expanded", String(expanded));
shareToggle.textContent = expanded
? "Collapse share card"
: "Expand share card";
}
shareToggle.addEventListener("click", () => {
const expanded = !shareShell.classList.contains("is-expanded");
const update = () => setShareExpanded(expanded);
if (
!reducedMotion.matches &&
typeof document.startViewTransition === "function"
) {
document.startViewTransition(update);
} else {
update();
}
});
document.addEventListener("keydown", (event) => {
if (
event.key === "Escape" &&
shareShell.classList.contains("is-expanded")
) {
setShareExpanded(false);
shareToggle.focus();
}
});
const downloadButton = document.querySelector(".download-button");
const downloadStatus = document.querySelector(".download-status");
downloadButton.addEventListener("click", async () => {
downloadButton.disabled = true;
downloadStatus.textContent = "Creating your image...";
try {
const canvas = document.createElement("canvas");
canvas.width = 1200;
canvas.height = 1500;
const context = canvas.getContext("2d");
if (!context) {
throw new Error("Canvas 2D context is not available.");
}
const background = context.createLinearGradient(0, 0, 1200, 1500);
background.addColorStop(0, "#203b38");
background.addColorStop(1, "#10191b");
context.fillStyle = background;
context.fillRect(0, 0, 1200, 1500);
context.fillStyle = "#ff9a67";
context.beginPath();
context.arc(1020, 140, 230, 0, Math.PI * 2);
context.fill();
context.fillStyle = "#c6f4dd";
context.font = "700 42px system-ui, sans-serif";
context.fillText("DEVELOPER YEAR IN REVIEW", 90, 150);
context.font = "750 100px system-ui, sans-serif";
context.fillText("2026,", 90, 390);
context.fillText("made by you.", 90, 500);
const commitCount =
document.querySelector("#commits .metric-count").dataset.target;
const language =
document.querySelector("#language-title").textContent
.replace(" took the lead.", "");
const streak =
document.querySelector("#streak .metric-count").dataset.target;
context.fillStyle = "#ff9a67";
context.font = "750 150px system-ui, sans-serif";
context.fillText(Number(commitCount).toLocaleString("en-US"), 90, 800);
context.fillStyle = "#c6f4dd";
context.font = "500 44px system-ui, sans-serif";
context.fillText("commits", 90, 870);
context.fillText("Top language: " + language, 90, 1050);
context.fillText("Longest streak: " + streak + " days", 90, 1140);
context.fillStyle = "#9eb4b1";
context.font = "400 30px system-ui, sans-serif";
context.fillText("A personal snapshot. Your year, your pace.", 90, 1370);
const blob = await new Promise((resolve) => {
canvas.toBlob(resolve, "image/png");
});
if (!blob) {
throw new Error("The share image could not be created.");
}
const url = URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = url;
link.download = "developer-year-in-review-2026.png";
link.click();
window.setTimeout(() => URL.revokeObjectURL(url), 1000);
downloadStatus.textContent = "Your image is ready.";
} catch (error) {
console.error(error);
downloadStatus.textContent =
"The image could not be created in this browser.";
} finally {
downloadButton.disabled = false;
}
});
</script>
</body>
</html>