From 8010876630918f7e0de0fbfe0588e17954fe063f Mon Sep 17 00:00:00 2001 From: vista-man <524715@vistacollege.nl> Date: Sat, 25 Jan 2025 21:25:36 +0100 Subject: [PATCH] que --- index.html | 33 +++++++++++++++++++++++++++++++++ script.js | 21 +++++++++++++++++++++ style.css | 22 ++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 script.js create mode 100644 style.css diff --git a/index.html b/index.html index 8b13789..bfa42e7 100644 --- a/index.html +++ b/index.html @@ -1 +1,34 @@ + + + + My Simple Wikipedia + + + +

Welcome to My Simple Wikipedia

+ +

This is a basic example of a simple Wikipedia-like page. + It demonstrates how to structure information using HTML.

+ +

Article 1: The History of the Internet

+ +

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.

+ +

Over time, the Internet evolved into the global network we know today, connecting + billions of devices and people worldwide.

+ +

Article 2: The Life Cycle of a Butterfly

+ +

Butterflies undergo a fascinating transformation known as metamorphosis. + It begins with an egg, which hatches into a larva (caterpillar).

+ +

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.

+ + + + \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..4799b2d --- /dev/null +++ b/script.js @@ -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)); + }); +}; \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..8c16d1b --- /dev/null +++ b/style.css @@ -0,0 +1,22 @@ +body { + font-family: sans-serif; + margin: 20px; +} + +h1 { + color: #333; +} + +p { + color: #555; + line-height: 1.6; +} + +a { + color: #007bff; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} \ No newline at end of file