mirror of
https://github.com/pabloquablo/RTA-test.git
synced 2026-03-06 03:06:35 +01:00
que
This commit is contained in:
21
script.js
Normal file
21
script.js
Normal 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));
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user