-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
71 lines (57 loc) · 2.69 KB
/
index.html
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Scalable CSS Scrolling -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- Favicon and other icon links -->
<link rel="icon" href="./assets/favicon/favicon-32x32.png" sizes="32x32">
<link rel="apple-touch-icon" href="./assets/favicon/apple-touch-icon.png" sizes="180x180">
<link rel="icon" sizes="192x192" href="./assets/favicon/android-chrome-192x192.png">
<link rel="icon" sizes="512x512" href="./assets/favicon/android-chrome-512x512.png">
<script src="https://d3js.org/d3.v7.min.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Random Genre of the Day</title>
<!-- Link to the external CSS file -->
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<!-- Title for Genre of the Day -->
<div id="title" class="title">Title</div>
<!-- Genre Title -->
<div class="genre" id="genre">Genre Title</div>
<!-- Spotify Link Button -->
<a id="spotify-link" class="spotify-button" href="#" target="_blank">Open Spotify Playlist</a>
<div id="spotify-link-text" class="spotify-link-text"></div>
<!-- Genre Description -->
<div class="description-container">
<div class="description-title">Genre Description</div>
<p id="description" class="description-text"></p>
</div>
<!-- Add the "Next" Button Here -->
<a href="./locations" class="location-button">Location of the Day</a>
</div>
<!-- Wikipedia Fetch Section -->
<!-- <div class="fetch-container">
<input type="text" id="searchTerm" placeholder="Enter a topic">
<button class="fetch-button" onclick="fetchWikipediaDescription()">Fetch Description</button>
<p id="wiki-description"></p>
</div> -->
</div>
<script src="https://d3js.org/d3.v7.min.js"></script>
<script src="script.js"></script>
<script>
async function fetchWikipediaDescription() {
const searchTerm = document.getElementById('searchTerm').value;
const response = await fetch(`https://en.wikipedia.org/api/rest_v1/page/summary/${encodeURIComponent(searchTerm)}`);
const data = await response.json();
if (data.extract) {
document.getElementById('wiki-description').innerText = data.extract;
} else {
document.getElementById('wiki-description').innerText = 'No description found.';
}
}
</script>
</body>
</html>