TipsBlocks Web Technique Library

PRACTICAL WEB TIP

← Back to library

Vinyl Return — Replay the Intro

A slow-spinning record leads listeners back to the page introduction.

Design Preview

See the design above before trying the scroll interaction.

LOOK CLOSELY
IN PAGE CONTEXT

Live Demo

Press Try scrolling inside the frame, or scroll inside it. The button appears at the lower right and returns you to the top.

Source Code

Copy the HTML, CSS or JavaScript you need for your project.

HTML
<!-- TB-2067 / Vinyl Return / レコード | paste before the closing body tag (inside the footer for TB-2069) -->
<button aria-label="ページの先頭へ戻る" class="btt vinyl tb-btt-2067" type="button"><span class="disc"><span class="disc-label">SIDE<br/><b>A</b></span></span><span class="caption">REPLAY INTRO</span></button>
CSS
/* 2067 / production button rules only */
.tb-btt-2067{box-sizing:border-box;font:inherit;cursor:pointer}.tb-btt-2067 :is(span,i,em,b,small,img){box-sizing:border-box}
.btt.tb-btt-2067{position:fixed;z-index:90;border:0;cursor:pointer;-webkit-tap-highlight-color:transparent;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .28s ease,visibility .28s ease,transform .35s ease}.btt.tb-btt-2067:focus-visible{outline:3px solid #f0af43;outline-offset:5px}.tb-btt-2067 .vinyl{left:20px;bottom:17px;width:118px;background:transparent;color:#fff}.tb-btt-2067 .disc{width:102px;height:102px;border-radius:50%;display:grid;place-items:center;margin:auto;background:repeating-radial-gradient(circle at center,#101418 0 4px,#232a2e 5px 6px,#101418 7px 11px);border:4px solid #101419;box-shadow:0 12px 23px #0008;animation:tb-btt-2067-recordTurn 9s linear infinite}.tb-btt-2067 .disc-label{width:56px;height:56px;border-radius:50%;background:#da5f4d;border:2px solid #e49d83;color:#181d1d;display:grid;place-items:center;align-content:center;font:750 10px/1.05 Arial,sans-serif;letter-spacing:.11em}.tb-btt-2067 .disc-label b{font-size:22px}.tb-btt-2067 .caption{display:block;margin:8px auto 0;background:#e0a851;color:#252a23;font:800 9px/1 Arial,sans-serif;padding:6px 5px;width:max-content;letter-spacing:.12em}.tb-btt-2067 .vinyl:hover .disc{animation-duration:1.3s}@media  (max-width:600px){.tb-btt-2067 .vinyl{width:100px;left:12px}.tb-btt-2067 .disc{width:86px;height:86px}.tb-btt-2067 .disc-label{width:48px;height:48px}}
@keyframes tb-btt-2067-recordTurn{to{rotate:360deg}}
@media(prefers-reduced-motion:reduce){.tb-btt-2067,.tb-btt-2067 *{animation-duration:.01ms!important;transition-duration:.01ms!important}}
JavaScript
(()=>{'use strict';const target=document.querySelector('.btt, .footer-return');if(!target)return;const isFooter=target.classList.contains('footer-return');const reduced=matchMedia('(prefers-reduced-motion: reduce)');let active=false;const update=()=>{const y=window.scrollY;const p=Math.max(0,Math.min(1,y/Math.max(1,document.documentElement.scrollHeight-innerHeight)));if(!isFooter){const visible=y>160;target.classList.toggle('is-visible',visible);target.setAttribute('aria-hidden',String(!visible));target.tabIndex=visible?0:-1;}target.style.setProperty('--pct',p.toFixed(3));const txt=target.querySelector('[data-progress]');if(txt)txt.textContent=String(Math.round(100*p)).padStart(2,'0')+'%';};const scroll=()=>{if(active)return;active=true;requestAnimationFrame(()=>{active=false;update()})};target.addEventListener('click',()=>window.scrollTo({top:0,behavior:reduced.matches?'instant':'smooth'}));addEventListener('scroll',scroll,{passive:true});addEventListener('resize',scroll,{passive:true});update();})();

How to Use

Insert the HTML button near the end of body, load the CSS, and include JavaScript using defer. Test scrolling, returning to the top, and positioning on mobile.

Use Case

Music labels, independent record shops and cultural projects.

Technical Notes

Keep controls usable on touch devices. Test keyboard focus and reduced-motion preferences.

Mobile:Check tap target, visibility and positioning on small screens.

Browser:Designed for current Chrome, Edge, Firefox and Safari.

Reduced Motion:CSS animations respect the reduced-motion preference.