Rewind Undo
Clock spins backward, everything reverses with a VHS rewind effect, a mouse trail rewinds, and the previous state is restored with a satisfying flash
Rewind Undo
by FreeCsStyles Dev's
AnimatedRetro
🌐HTML/CSS🎨Tailwind⚛️React💚Vue🅰️Angular🔥Svelte☁️LWC
#undo#rewind#clock#retro#vhs#revert#restore
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/rewind-undo.
<iframe src="/embed/rewind-undo" sandbox="allow-scripts" loading="lazy" title="Rewind Undo" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Rewind Undo, or grab a framework-specific implementation. The HTML and CSS variants are self-contained; framework variants assume that framework's project setup.
HTML
<button class="btn-rewind"><div class="vhs-overlay"><div class="scanline"></div><div class="scanline"></div><div class="scanline"></div><div class="scanline"></div><div class="scanline"></div></div><div class="clock"><div class="clock-face"><div class="clock-hand hour"></div><div class="clock-hand minute"></div><div class="clock-center"></div></div></div><div class="trail-dots"><span style="--d:0"></span><span style="--d:1"></span><span style="--d:2"></span><span style="--d:3"></span><span style="--d:4"></span></div><div class="flash-overlay"></div><span class="btn-text">⏪ Undo</span></button>CSS
.btn-rewind{width:180px;height:56px;border-radius:14px;border:none;background:linear-gradient(135deg,#2e1065,#3b0764);color:#c4b5fd;font-size:15px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;font-family:system-ui,-apple-system,sans-serif;box-shadow:0 4px 15px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.05)}.btn-rewind:hover{box-shadow:0 6px 20px rgba(0,0,0,.4)}.btn-rewind .vhs-overlay{position:absolute;inset:0;pointer-events:none;opacity:0;z-index:2}.btn-rewind .scanline{position:absolute;width:100%;height:1px;background:rgba(255,255,255,.08)}.btn-rewind .scanline:nth-child(1){top:15%}.btn-rewind .scanline:nth-child(2){top:35%}.btn-rewind .scanline:nth-child(3){top:55%}.btn-rewind .scanline:nth-child(4){top:75%}.btn-rewind .scanline:nth-child(5){top:90%}.btn-rewind .clock{position:absolute;left:12px;display:flex;align-items:center;justify-content:center;z-index:3;opacity:0;transition:all .4s cubic-bezier(.34,1.56,.64,1)}.btn-rewind .clock-face{width:28px;height:28px;border-radius:50%;border:2px solid #a78bfa;position:relative;background:rgba(139,92,246,.1)}.btn-rewind .clock-hand{position:absolute;bottom:50%;left:50%;transform-origin:bottom;border-radius:2px}.btn-rewind .clock-hand.hour{width:2px;height:8px;background:#c4b5fd;margin-left:-1px}.btn-rewind .clock-hand.minute{width:1.5px;height:10px;background:#a78bfa;margin-left:-.75px}.btn-rewind .clock-center{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:3px;height:3px;background:#c4b5fd;border-radius:50%}.btn-rewind .trail-dots{position:absolute;right:20px;display:flex;gap:4px;z-index:2}.btn-rewind .trail-dots span{width:5px;height:5px;border-radius:50%;background:#7c3aed;opacity:0;transition:all .3s}.btn-rewind .flash-overlay{position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.15),transparent);opacity:0;z-index:4;pointer-events:none}.btn-rewind .btn-text{z-index:5;transition:all .3s;position:relative}.btn-rewind.is-rewinding .vhs-overlay{opacity:1;animation:vhs-flicker .12s infinite}.btn-rewind.is-rewinding .scanline{animation:scanline-move .2s linear infinite}.btn-rewind.is-rewinding .clock{opacity:1;animation:clock-pulse .5s ease-in-out infinite}.btn-rewind.is-rewinding .clock-hand.hour{animation:rewind-hour .8s linear infinite}.btn-rewind.is-rewinding .clock-hand.minute{animation:rewind-minute .3s linear infinite}.btn-rewind.is-rewinding .trail-dots span{opacity:1;animation:dot-rewind .6s ease-out forwards;animation-delay:calc(var(--d) * .08s)}.btn-rewind.is-rewinding .btn-text{opacity:0}.btn-rewind.is-restored .flash-overlay{animation:flash-sweep .4s ease-out}.btn-rewind.is-done{background:linear-gradient(135deg,#2e1065,#1e0a3a);box-shadow:0 4px 20px rgba(139,92,246,.2)}.btn-rewind.is-done .btn-text{color:#22c55e}.btn-rewind.is-done .clock{opacity:1}.btn-rewind.is-done .clock-face{border-color:#22c55e}.btn-rewind.is-done .clock-center{background:#22c55e}@keyframes vhs-flicker{0%,100%{opacity:.6}50%{opacity:1}}@keyframes scanline-move{0%{transform:translateY(0)}100%{transform:translateY(3px)}}@keyframes clock-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.1)}}@keyframes rewind-hour{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}@keyframes rewind-minute{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}@keyframes dot-rewind{0%{opacity:0;transform:translateX(15px)}50%{opacity:1}100%{opacity:0;transform:translateX(-8px)}}@keyframes flash-sweep{0%{opacity:0;transform:translateX(-100%)}50%{opacity:1}100%{opacity:0;transform:translateX(100%)}}Tailwind CSS
<button class="w-[180px] h-[56px] rounded-[14px] border-none bg-gradient-to-br from-[#2e1065] to-[#3b0764] text-purple-300 font-bold text-[15px] cursor-pointer relative flex items-center justify-center overflow-hidden font-sans shadow-lg"><span class="relative z-10">⏪ Undo</span></button>React
import { useState } from 'react';
export function RewindUndo() {
const [phase, setPhase] = useState('idle');
const handleClick = () => {
if (phase !== 'idle') return;
setPhase('rewinding');
setTimeout(() => setPhase('restored'), 1500);
setTimeout(() => setPhase('done'), 2000);
setTimeout(() => setPhase('idle'), 3500);
};
return (
<button onClick={handleClick} disabled={phase !== 'idle'}
style={{ width: 180, height: 56, borderRadius: 14, border: 'none', background: phase === 'done' ? 'linear-gradient(135deg, #2e1065, #1e0a3a)' : 'linear-gradient(135deg, #2e1065, #3b0764)', color: phase === 'done' ? '#22c55e' : '#c4b5fd', fontSize: 15, fontWeight: 'bold', cursor: 'pointer', position: 'relative', display: 'flex', alignItems: 'center', justifyContent: 'center', overflow: 'hidden', fontFamily: 'system-ui,sans-serif', transition: 'all 0.3s', boxShadow: '0 4px 15px rgba(0,0,0,0.3)' }}>
<div style={{ position: 'absolute', inset: 0, pointerEvents: 'none', opacity: phase === 'rewinding' ? 1 : 0, zIndex: 2, transition: 'opacity 0.3s' }}>
{[15,35,55,75,90].map(top => (
<div key={top} style={{ position: 'absolute', width: '100%', height: 1, background: 'rgba(255,255,255,0.08)', top: `${top}%` }} />
))}
</div>
<span style={{ zIndex: 5, opacity: phase === 'rewinding' ? 0 : 1, transition: 'all 0.3s' }}>
{phase === 'done' ? '✓ Restored!' : '⏪ Undo'}
</span>
</button>
);
}Vue
<template>
<button class="btn-rewind" :class="phase" @click="handleClick" :disabled="phase!=='idle'">
<div class="vhs-overlay"><div class="scanline" v-for="i in 5" :key="i"></div></div>
<div class="clock">
<div class="clock-face"><div class="clock-hand hour"></div><div class="clock-hand minute"></div><div class="clock-center"></div></div>
</div>
<div class="trail-dots"><span v-for="i in 5" :key="i" :style="{ '--d': i-1 }"></span></div>
<div class="flash-overlay"></div>
<span class="btn-text">{{ label }}</span>
</button>
</template>
<script setup>
import { ref, computed } from 'vue';
const phase = ref('idle');
const label = computed(() => ({idle:'⏪ Undo',rewinding:'',restored:'',done:'✓ Restored!'}[phase.value]));
function handleClick() {
if (phase.value !== 'idle') return;
phase.value = 'rewinding';
setTimeout(() => phase.value = 'restored', 1500);
setTimeout(() => phase.value = 'done', 2000);
setTimeout(() => phase.value = 'idle', 3500);
}
</script>Svelte
<script>
let phase = 'idle';
$: label = ({idle:'⏪ Undo',rewinding:'',restored:'',done:'✓ Restored!'})[phase];
function handleClick() {
if (phase !== 'idle') return;
phase = 'rewinding';
setTimeout(() => phase = 'restored', 1500);
setTimeout(() => phase = 'done', 2000);
setTimeout(() => phase = 'idle', 3500);
}
</script>
<button class="btn-rewind" class:is-rewinding={phase==='rewinding'} class:is-restored={phase==='restored'} class:is-done={phase==='done'} on:click={handleClick} disabled={phase!=='idle'}>
<div class="vhs-overlay"><div class="scanline"></div><div class="scanline"></div><div class="scanline"></div><div class="scanline"></div><div class="scanline"></div></div>
<div class="clock"><div class="clock-face"><div class="clock-hand hour"></div><div class="clock-hand minute"></div><div class="clock-center"></div></div></div>
<div class="trail-dots"><span style="--d:0"></span><span style="--d:1"></span><span style="--d:2"></span><span style="--d:3"></span><span style="--d:4"></span></div>
<div class="flash-overlay"></div>
<span class="btn-text">{label}</span>
</button>Angular
import { Component } from '@angular/core';
@Component({
selector: 'app-rewind-undo',
template: `<button class="btn-rewind" [class.is-rewinding]="phase==='rewinding'" [class.is-restored]="phase==='restored'" [class.is-done]="phase==='done'" (click)="handleClick()" [disabled]="phase!=='idle'"><div class="vhs-overlay"><div class="scanline" *ngFor="let i of [1,2,3,4,5]"></div></div><div class="clock"><div class="clock-face"><div class="clock-hand hour"></div><div class="clock-hand minute"></div><div class="clock-center"></div></div></div><div class="trail-dots"><span *ngFor="let i of [0,1,2,3,4]" [style.--d]="i"></span></div><div class="flash-overlay"></div><span class="btn-text">{{ label }}</span></button>`,
styles: [`.btn-rewind{width:180px;height:56px;border-radius:14px;border:none;background:linear-gradient(135deg,#2e1065,#3b0764);color:#c4b5fd;font-size:15px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden}.btn-rewind .vhs-overlay{position:absolute;inset:0;pointer-events:none;opacity:0;z-index:2}.btn-rewind .clock{position:absolute;left:12px;z-index:3;opacity:0;transition:all .4s}.btn-rewind.is-rewinding .vhs-overlay{opacity:1}.btn-rewind.is-rewinding .clock{opacity:1}.btn-rewind.is-rewinding .clock-hand.hour{animation:rewind-hour .8s linear infinite}.btn-rewind.is-rewinding .clock-hand.minute{animation:rewind-minute .3s linear infinite}.btn-rewind.is-rewinding .btn-text{opacity:0}.btn-rewind.is-done{background:linear-gradient(135deg,#2e1065,#1e0a3a)}.btn-rewind.is-done .btn-text{color:#22c55e}.btn-rewind.is-done .clock{opacity:1}.btn-rewind.is-done .clock-face{border-color:#22c55e}@keyframes rewind-hour{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}@keyframes rewind-minute{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}`]
})
export class RewindUndoComponent { phase='idle'; get label() { return {idle:'⏪ Undo',rewinding:'',restored:'',done:'✓ Restored!'}[this.phase]; } handleClick() { if(this.phase!=='idle')return;this.phase='rewinding';setTimeout(()=>this.phase='restored',1500);setTimeout(()=>this.phase='done',2000);setTimeout(()=>this.phase='idle',3500); } }LWC — HTML template
<template><button class="btn-rewind" onclick={handleClick} disabled={disabled}><span class="btn-text">{label}</span></button></template>LWC — JavaScript
import { LightningElement } from 'lwc';
export default class RewindUndo extends LightningElement {
phase = 'idle';
get disabled() { return this.phase !== 'idle'; }
get label() { return {idle:'⏪ Undo',rewinding:'',restored:'',done:'✓ Restored!'}[this.phase]; }
handleClick() { if(this.phase!=='idle')return;this.phase='rewinding';setTimeout(()=>this.phase='restored',1500);setTimeout(()=>this.phase='done',2000);setTimeout(()=>this.phase='idle',3500); }
}LWC — CSS
.btn-rewind{width:180px;height:56px;border-radius:14px;border:none;background:linear-gradient(135deg,#2e1065,#3b0764);color:#c4b5fd;font-size:15px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:all .3s}.btn-rewind.is-done{background:linear-gradient(135deg,#2e1065,#1e0a3a)}.btn-rewind.is-done .btn-text{color:#22c55e}LWC — Configuration
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<isExposed>true</isExposed>
<targets><target>lightning__AppPage</target><target>lightning__RecordPage</target><target>lightning__HomePage</target></targets>
</LightningComponentBundle>Where Rewind Undo fits
- Undo
- Revert
- Back
- Restore
Interaction states & animations
- Clock Spin
- VHS Rewind
- Trail Rewind
- State Restore
Topics
- #undo
- #rewind
- #clock
- #retro
- #vhs
- #revert
- #restore
Accessibility notes
Animation is decorative. Button text remains readable. Respect reduced-motion preference.
Browser support
- All modern browsers