@media (prefers-reduced-motion: reduce) #dancing-bear animation: none;
async init() // Load SVG sprite const resp = await fetch('bear-sprite.svg'); this.el.innerHTML = await resp.text(); dancing bear siterip updated
watchBeat() const data = new Uint8Array(this.analyser.frequencyBinCount); const step = () => this.analyser.getByteFrequencyData(data); const avg = data.reduce((a, b) => a + b) / data.length; const speed = Math.min(2, avg / 128); // 0â2Ă normal speed this.el.style.animationDuration = `$1 / speeds`; requestAnimationFrame(step); ; step(); | Use a single SVG sprite sheet; CSS
// JavaScript core (ES6) class DancingBear constructor(container) this.el = container; this.audioCtx = null; this.analyser = null; this.init(); | | Trigger Modes | ⢠Autoâplay on
A Dancing Bear Siterip is a playful, animated overlay that turns any website into a whimsical stage where a cartoon bear dances to the pageâs rhythm. The âUpdatedâ version adds modern customization, performanceâfriendly rendering, and integration hooks. Core Elements | Element | What it does | Implementation notes | |---------|--------------|----------------------| | Bear Avatar | SVG/Canvasâbased bear that can change outfits, colors, and dance moves. | Use a single SVG sprite sheet; CSS variables control colors for lowâbandwidth swaps. | | AudioâReactive Motion | Bearâs steps sync to background music or pageâlevel audio events. | Leverage the Web Audio APIâs AnalyserNode to extract beat frequency and map to animation speed. | | Trigger Modes | ⢠Autoâplay on page load ⢠Hover â appears when cursor nears the topâright corner ⢠Keyboard shortcut (e.g., Ctrl+Shift+B ). | Event listeners attached to document ; optional userâoptâout stored in localStorage . | | Customization Panel | Small UI widget letting users pick dance style, bear costume, and volume. | Built with vanilla JS + CSS Grid; persists choices via localStorage . | | Performance Guardrails | Detects lowâend devices and falls back to a static GIF or disables animation. | navigator.hardwareConcurrency and window.matchMedia('(prefers-reduced-motion)') . | | AnalyticsâFree | No data leaves the browser; all settings stay local. | Meets Duck.aiâs privacyâfirst stance. | Technical Sketch <!-- HTML placeholder --> <div id="dancing-bear"></div> /* Basic styling â respects prefers-reduced-motion */ #dancing-bear position: fixed; bottom: 20px; right: 20px; width: 120px; height: 120px; pointer-events: none; animation: dance 1s infinite;