This commit is contained in:
vista-man
2025-01-25 21:25:36 +01:00
parent a56c55ad8e
commit 8010876630
3 changed files with 76 additions and 0 deletions

21
script.js Normal file
View File

@@ -0,0 +1,21 @@
window.onload = function() {
const articles = document.querySelectorAll('h2 + p');
articles.forEach(article => {
article.style.opacity = '0';
const fadeIn = () => {
let opacity = 0;
const interval = setInterval(() => {
opacity += 0.05;
article.style.opacity = opacity;
if (opacity >= 1) {
clearInterval(interval);
}
}, 30);
};
setTimeout(fadeIn, 500 * articles.indexOf(article));
});
};