-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathindex.html
More file actions
45 lines (40 loc) Β· 1.29 KB
/
index.html
File metadata and controls
45 lines (40 loc) Β· 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hacktoberfest Workshop Demo</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h1>Welcome to Hacktoberfest Workshop π</h1>
<p>
This is a demo project for beginners to make their first Pull Request.
</p>
<h2>Contributors β¨</h2>
<ul id="contributors">
<li>π Your Name Here</li>
</ul>
<h2>Motivational Quotes π‘</h2>
<div id="quotes"></div>
<button id="colorBtn">Click me for magic β¨</button>
<script>
fetch("quotes.json")
.then((response) => response.json())
.then((data) => {
const container = document.getElementById("quotes");
data.forEach((q) => {
const p = document.createElement("p");
p.textContent = `β${q.quote}β β ${q.author}`;
container.appendChild(p);
});
});
// Button color change demo
document.getElementById("colorBtn").addEventListener("click", () => {
document.body.style.backgroundColor =
document.body.style.backgroundColor === "lightblue"
? "white"
: "lightblue";
});
</script>
</body>
</html>