diff --git a/index.html b/index.html index 03947d6..1802c0b 100644 --- a/index.html +++ b/index.html @@ -1242,6 +1242,8 @@ width: 90%; max-width: 420px; padding: 20px; + position: relative; + z-index: 1; } .login-screen-logo { text-align: center; @@ -1275,6 +1277,29 @@ background: #4CAF50; color: white; } + /* Login screen monster background */ + .login-monsters-bg { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + overflow: hidden; + pointer-events: none; + opacity: 0.6; + } + .login-monster { + position: absolute; + width: 80px; + height: 80px; + transition: transform 0.3s ease; + } + .login-monster img { + width: 100%; + height: 100%; + object-fit: contain; + filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)); + } .login-version { text-align: center; margin-top: 20px; @@ -3235,6 +3260,7 @@
`;
+ container.appendChild(monster);
+ }
+
+ // Start random animations
+ animateLoginMonsters();
+ loginMonstersInterval = setInterval(animateLoginMonsters, 2500);
+ }
+
+ function animateLoginMonsters() {
+ const monsters = document.querySelectorAll('.login-monster img');
+ if (!monsters.length || typeof MONSTER_ANIMATIONS === 'undefined') return;
+
+ monsters.forEach(img => {
+ // 40% chance to animate each monster per cycle
+ if (Math.random() > 0.4) return;
+
+ const animName = loginMonsterAnimations[Math.floor(Math.random() * loginMonsterAnimations.length)];
+ const anim = MONSTER_ANIMATIONS[animName];
+ if (!anim) return;
+
+ // Generate unique animation name and apply
+ const uniqueAnimName = `login-${animName}-${Date.now()}-${Math.random().toString(36).substr(2, 5)}`;
+ const styleSheet = document.styleSheets[0];
+ try {
+ styleSheet.insertRule(`@keyframes ${uniqueAnimName} { ${anim.keyframes} }`, styleSheet.cssRules.length);
+ } catch (e) { return; }
+
+ img.style.animation = `${uniqueAnimName} ${anim.duration}ms ${anim.easing || 'ease'} ${anim.loop ? 'infinite' : '1'}`;
+
+ // Clean up after animation
+ if (!anim.loop) {
+ setTimeout(() => {
+ img.style.animation = '';
+ }, anim.duration + 100);
+ }
+ });
+ }
+
+ function stopLoginMonsters() {
+ if (loginMonstersInterval) {
+ clearInterval(loginMonstersInterval);
+ loginMonstersInterval = null;
+ }
+ }
+
+ // Initialize login monsters when page loads
+ initLoginMonsters();
+
// Login screen tab switching
document.getElementById('loginScreenLoginTab').addEventListener('click', () => {
document.getElementById('loginScreenLoginTab').classList.add('active');