Aktuelle Themen:

Filterliste

Nana Mouskouri – Only Love
Läuft gerade
Only Love
Nana Mouskouri · Love Songs
Zuvor
Katja Ebstein – Wunder gibt es immer wieder
Wunder gibt es immer wieder
Katja Ebstein · Wunder gibt es immer wieder
Davor
Reinhard Mey – Zeugnistag
Zeugnistag
Reinhard Mey · Keine ruhige Minute
/* ========================================================= HS Cursor Trail Dezente nachlaufende Punkte ========================================================= */ document.addEventListener('DOMContentLoaded', function () { const supportsFinePointer = window.matchMedia( '(hover: hover) and (pointer: fine)' ).matches; const reduceMotion = window.matchMedia( '(prefers-reduced-motion: reduce)' ).matches; if (!supportsFinePointer || reduceMotion) { return; } const numberOfDots = 5; const dots = []; let mouseX = window.innerWidth / 2; let mouseY = window.innerHeight / 2; let cursorVisible = false; /* --------------------------------------------------------- Punkte erzeugen --------------------------------------------------------- */ for (let i = 0; i < numberOfDots; i++) { const dot = document.createElement('span'); dot.className = 'hs-cursor-dot'; dot.setAttribute('aria-hidden', 'true'); document.body.appendChild(dot); dots.push({ element: dot, x: mouseX, y: mouseY }); } /* --------------------------------------------------------- Mausposition erfassen --------------------------------------------------------- */ document.addEventListener( 'mousemove', function (event) { mouseX = event.clientX; mouseY = event.clientY; if (!cursorVisible) { cursorVisible = true; dots.forEach(function (dot) { dot.element.style.opacity = '1'; }); } }, { passive: true } ); /* --------------------------------------------------------- Cursor ausblenden, wenn Maus Fenster verlässt --------------------------------------------------------- */ document.addEventListener('mouseleave', function () { cursorVisible = false; dots.forEach(function (dot) { dot.element.style.opacity = '0'; }); }); document.addEventListener('mouseenter', function () { cursorVisible = true; }); /* --------------------------------------------------------- Animation --------------------------------------------------------- */ function animateCursor() { let targetX = mouseX; let targetY = mouseY; dots.forEach(function (dot, index) { const easing = 0.34 - (index * 0.035); dot.x += (targetX - dot.x) * easing; dot.y += (targetY - dot.y) * easing; dot.element.style.left = dot.x + 'px'; dot.element.style.top = dot.y + 'px'; targetX = dot.x; targetY = dot.y; }); requestAnimationFrame(animateCursor); } animateCursor(); });