/* Stories: rings that open a full-screen viewer the way Instagram's stories play. */ /* * A ring as Instagram draws one: a band of color with a gap of page around the picture. The colors are this site's own * (the one place it uses color as decoration, on the owner's say): lime through cyan to blue. Once every story in a * ring has been watched it turns grey, and with nothing to watch there's none. */ .story-ring { --ring: transparent; display: block; flex: none; width: var(--ring-size, 72px); height: var(--ring-size, 72px); padding: 2.5px; border-radius: 50%; background: var(--ring); } .story-ring img { display: block; width: 100%; height: 100%; border: 3px solid var(--bg); border-radius: 50%; object-fit: cover; background: rgb(128 128 128 / 10%); } .dark .story-ring img { border-color: var(--bg-dark); } [data-state="unseen"] > .story-ring { --ring: linear-gradient(45deg, #a3e635, #34d399 35%, #22d3ee 65%, #3b82f6); } [data-state="seen"] > .story-ring { --ring: var(--secondary-text); } .story-day { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; } .story-day:disabled { cursor: default; } /* a picture without a caption under it, as beside the feed's header, takes only its ring's width */ .story-day:not(:has(.story-day-label)) { width: auto; } .story-day:not(:disabled):hover .story-ring img { opacity: .85; } .story-day-label { max-width: 100%; font-size: 12px; color: var(--secondary-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* the row of rings on /videos, with the Bluesky sign-in beside it */ .stories-block { margin: 0 0 40px; } .stories { display: flex; align-items: flex-start; gap: 16px; } .stories-tray { display: flex; flex: 1; min-width: 0; gap: 14px; margin: 0; padding: 4px 2px 8px; list-style: none; overflow-x: auto; scrollbar-width: none; } .stories-tray::-webkit-scrollbar { display: none; } .stories-account { display: flex; flex: none; align-items: center; gap: 8px; margin-left: auto; } .stories-status { align-self: center; font-size: 12px; color: var(--secondary-text); white-space: nowrap; } /* the owner's calendar, as Instagram's archive lays stories out: a month to a grid, each day with stories showing one */ .stories-calendar { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 32px 28px; margin-top: 20px; } .stories-calendar[hidden] { display: none; } .story-month h2 { margin: 0 0 10px; font-size: 14px; font-weight: 400; } .story-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; } .story-weekday { padding-bottom: 4px; font-size: 11px; text-align: center; color: var(--secondary-text); } .story-date { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 8px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--secondary-text); } .story-date-has { overflow: hidden; padding: 0; border: 0; background: rgb(128 128 128 / 10%); color: #fff; cursor: pointer; } .story-date-has img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 150ms; } .story-date-has span { position: relative; font-weight: 600; text-shadow: 0 1px 3px rgb(0 0 0 / 70%); } .story-date-has:hover img { opacity: .8; } /* The viewer dims the page rather than hiding it, and opens with the story growing out of the ring that was pressed. */ html[data-story-open] { overflow: hidden; } .story-viewer { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; gap: 20px; background: rgb(0 0 0 / 80%); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #f4f1ed; outline: none; animation: story-dim 200ms var(--ease-out); } .story-viewer[hidden] { display: none; } .story-frame { position: relative; height: min(100svh - 32px, 900px); max-width: 100vw; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 12px; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; animation: story-grow 300ms var(--ease-out); } @keyframes story-dim { from { opacity: 0; } } @keyframes story-grow { from { opacity: 0; transform: scale(.6); } } .story-media, .story-media img, .story-media video { position: absolute; inset: 0; width: 100%; height: 100%; } .story-media img, .story-media video { object-fit: contain; pointer-events: none; } .story-media[data-fit="cover"] img, .story-media[data-fit="cover"] video { object-fit: cover; } .story-top { position: absolute; inset: 0 0 auto; padding: 10px 10px 28px; background: linear-gradient(rgb(0 0 0 / 45%), transparent); } .story-bars { display: flex; gap: 4px; } .story-bar { position: relative; flex: 1; height: 2px; overflow: hidden; border-radius: 1px; background: rgb(255 255 255 / 35%); } .story-bar::after { content: ""; position: absolute; inset: 0; background: #fff; transform: scaleX(var(--progress, 0)); transform-origin: left; } .story-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; } .story-author { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; text-shadow: 0 1px 2px rgb(0 0 0 / 40%); } .story-author img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; } .story-time { color: rgb(255 255 255 / 70%); font-size: 13px; white-space: nowrap; } .story-controls { display: flex; align-items: center; } .story-controls button, .story-controls a { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; } .story-controls button:hover, .story-controls a:hover { background: rgb(255 255 255 / 14%); } .story-frame[data-paused="true"] [data-pause-icon], .story-frame:not([data-paused="true"]) [data-play-icon] { display: none; } .story-frame[data-muted="true"] [data-volume-icon], .story-frame:not([data-muted="true"]) [data-muted-icon] { display: none; } .story-step { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / 14%); color: inherit; cursor: pointer; transition: background 150ms; } .story-step:hover { background: rgb(255 255 255 / 26%); } @media (max-width: 760px) { .stories-block { margin-bottom: 28px; } .stories-tray { gap: 12px; } .story-day { width: 68px; } .stories .story-ring { --ring-size: 64px; } /* a phone gives the story the whole screen */ .story-frame { width: 100%; height: 100%; border-radius: 0; aspect-ratio: auto; } .story-step { display: none; } } @media (prefers-reduced-motion: reduce) { .story-step, .story-date-has img { transition: none; } .story-viewer, .story-frame { animation: none; } }