watch.twip-network.org/scripts/pages/user/main.js

25 lines
785 B
JavaScript
Raw Normal View History

2024-01-25 15:50:51 +01:00
document.addEventListener('DOMContentLoaded', function () {
var h1 = document.querySelector('.user-index-h1');
var h2 = document.querySelector('.user-index-h2');
2024-01-25 16:05:55 +01:00
// Initial styles for fade-in effect
h1.style.opacity = '0';
h1.style.transform = 'translateX(-20px)';
h2.style.opacity = '0';
h2.style.transform = 'translateX(-20px)';
2024-01-25 16:05:13 +01:00
// Trigger the reflow to restart the CSS animation
void h1.offsetWidth;
void h2.offsetWidth;
2024-01-25 16:05:55 +01:00
// Apply the fade-in effect
h1.style.transition = 'opacity 0.8s ease, transform 0.8s ease';
h1.style.opacity = '1';
h1.style.transform = 'translateX(0)';
h2.style.transition = 'opacity 0.8s ease, transform 0.8s ease';
h2.style.opacity = '1';
h2.style.transform = 'translateX(0)';
2024-01-25 15:50:51 +01:00
});