mirror of
https://github.com/pabloquablo/RTA-test.git
synced 2026-03-06 03:06:35 +01:00
que
This commit is contained in:
33
index.html
33
index.html
@@ -1 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>My Simple Wikipedia</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>Welcome to My Simple Wikipedia</h1>
|
||||
|
||||
<p>This is a basic example of a simple Wikipedia-like page.
|
||||
It demonstrates how to structure information using HTML.</p>
|
||||
|
||||
<h2>Article 1: The History of the Internet</h2>
|
||||
|
||||
<p>The Internet began as a project funded by the United States Department of Defense
|
||||
in the 1960s. Its initial purpose was to create a decentralized network that could
|
||||
withstand a nuclear attack.</p>
|
||||
|
||||
<p>Over time, the Internet evolved into the global network we know today, connecting
|
||||
billions of devices and people worldwide.</p>
|
||||
|
||||
<h2>Article 2: The Life Cycle of a Butterfly</h2>
|
||||
|
||||
<p>Butterflies undergo a fascinating transformation known as metamorphosis.
|
||||
It begins with an egg, which hatches into a larva (caterpillar).</p>
|
||||
|
||||
<p>The larva grows and molts several times, eventually forming a chrysalis.
|
||||
Inside the chrysalis, the larva undergoes a remarkable transformation,
|
||||
emerging as a beautiful butterfly.</p>
|
||||
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
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