PRACTICAL WEB TIP
Festival Word — Animated Poster
A playful poster-like button brings festival typography into page navigation.
Design Preview
See the design above before trying the scroll interaction.
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.
<!-- TB-2066 / Festival Word / ポスター文字 | paste before the closing body tag (inside the footer for TB-2069) -->
<button aria-label="ページの先頭へ戻る" class="btt festival tb-btt-2066" type="button"><i class="fest-star">✳</i><span>REWIND<br/>THE DAY</span><em>← 00</em></button>
/* 2066 / production button rules only */
.tb-btt-2066{box-sizing:border-box;font:inherit;cursor:pointer}.tb-btt-2066 :is(span,i,em,b,small,img){box-sizing:border-box}
.btt.tb-btt-2066{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-2066:focus-visible{outline:3px solid #f0af43;outline-offset:5px}.tb-btt-2066 .festival{right:18px;bottom:26px;width:145px;height:91px;background:#ffed61;color:#402769;border:4px solid #472d80;box-shadow:7px 7px 0 #55389f;transform:rotate(-5deg);text-align:left;padding:10px 12px;animation:tb-btt-2066-festIdle 4.6s ease-in-out infinite}.tb-btt-2066 .festival span{display:block;font:900 17px/.9 Arial,sans-serif;letter-spacing:-.08em}.tb-btt-2066 .festival em{display:block;font:700 11px/1.2 Arial,sans-serif;margin-top:10px;font-style:normal;letter-spacing:.2em}.tb-btt-2066 .fest-star{position:absolute;right:-17px;top:-21px;font:normal 38px/1 Arial;color:#f9a1c3;animation:tb-btt-2066-starTurn 7s linear infinite}.tb-btt-2066 .festival:hover{background:#ff92be;color:#27115f;transform:rotate(4deg) scale(1.04)}@media (max-width:600px){.tb-btt-2066 .festival{width:121px;height:83px;right:12px;bottom:20px;padding:9px}.tb-btt-2066 .festival span{font-size:15px}}
@keyframes tb-btt-2066-starTurn{to{transform:rotate(360deg)}}
@keyframes tb-btt-2066-festIdle{50%{translate:0 -4px}}
@media(prefers-reduced-motion:reduce){.tb-btt-2066,.tb-btt-2066 *{animation-duration:.01ms!important;transition-duration:.01ms!important}}
(()=>{'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
Festivals, music events and pop-up campaigns.
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.