MediaWiki:Common.js: Unterschied zwischen den Versionen
Admin (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
Admin (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
| Zeile 1.244: | Zeile 1.244: | ||
/* === ADOS – Winter Schneefall ( | /* === ADOS – Dezenter Winter-Schneefall (very subtle) === */ | ||
(function() { | (function() { | ||
// Nutzer | // Nutzer mit "reduce motion" → kein Schnee | ||
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return; | |||
function initSnow() { | function initSnow() { | ||
const width = window.innerWidth; | |||
const isSmall = width < 600; | |||
const container = document.createElement('div'); | |||
container.id = 'ados-snow'; | container.id = 'ados-snow'; | ||
container.style.position = 'fixed'; | container.style.position = 'fixed'; | ||
| Zeile 1.268: | Zeile 1.267: | ||
document.body.appendChild(container); | document.body.appendChild(container); | ||
// | // Dezente, neutrale Flocken (Punkte statt Symbole) | ||
const flakeChars = ['•', '·', '∙']; | |||
// | // Weniger als vorher | ||
const flakeCount = isSmall ? 15 : 35; | |||
for ( | for (let i = 0; i < flakeCount; i++) { | ||
const flake = document.createElement('div'); | |||
flake.textContent = flakeChars[Math.floor(Math.random() * flakeChars.length)]; | flake.textContent = flakeChars[Math.floor(Math.random() * flakeChars.length)]; | ||
// Kleine Flocken | |||
flake.style.fontSize = (isSmall ? (4 + Math.random() * 4) : (5 + Math.random() * 5)) + 'px'; | |||
// Sehr dezent | |||
flake.style.opacity = (0.15 + Math.random() * 0.25).toFixed(2); | |||
flake.style.position = 'absolute'; | flake.style.position = 'absolute'; | ||
flake.style.left = Math.random() * 100 + 'vw'; | flake.style.left = Math.random() * 100 + 'vw'; | ||
flake.style.top = -(Math.random() * | flake.style.top = -(Math.random() * 15) + 'vh'; | ||
// Sehr langsames Fallen | |||
const duration = isSmall | |||
? (12 + Math.random() * 14) | |||
: (14 + Math.random() * 18); | |||
flake.style.animation = | |||
flake.style.animation = | `adosSnowSoft ${duration}s linear infinite`; | ||
// | // Leichter Versatz für natürliches Gefühl | ||
flake.style.animationDelay = (-Math.random() * | flake.style.animationDelay = (-Math.random() * duration) + 's'; | ||
container.appendChild(flake); | container.appendChild(flake); | ||
| Zeile 1.295: | Zeile 1.303: | ||
} | } | ||
// Animation | // Animation (langsam, dezenter Drift) | ||
const style = document.createElement('style'); | |||
style.textContent = ` | style.textContent = ` | ||
@keyframes | @keyframes adosSnowSoft { | ||
0% { transform: translateY(-10vh) translateX(0); } | 0% { transform: translateY(-10vh) translateX(0); } | ||
100% { transform: translateY(110vh) translateX( | 100% { transform: translateY(110vh) translateX(5px); } | ||
} | } | ||
`; | `; | ||
document.head.appendChild(style); | document.head.appendChild(style); | ||
if (document.readyState === 'loading') { | if (document.readyState === 'loading') { | ||
document.addEventListener('DOMContentLoaded', initSnow); | document.addEventListener('DOMContentLoaded', initSnow); | ||