-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
72 lines (70 loc) · 2 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
72
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Soundcloud Roulette</title>
<script>
async function fetchRandomTrack() {
try {
const response = await fetch('/random');
const data = await response.text();
document.getElementById('trackContainer').innerHTML = data;
} catch (error) {
console.error('Error fetching random track:', error);
document.getElementById('trackContainer').innerText = 'Failed to load track.';
}
}
document.onload = fetchRandomTrack()
</script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: sans-serif;
}
body {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
margin: 0;
background-color: #282c34;
color: #61dafb;
font-family: Arial, sans-serif;
}
button {
background-color: #61dafb;
border: none;
border-radius: 5px;
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
margin-bottom: 20px;
transition: background-color 0.3s;
}
button:hover {
background-color: #4FA8C8;
}
#trackContainer {
width: 60%;
padding: 10px;
text-align: center;
overflow: hidden;
}
iframe {
width: 100%;
max-width: 800px;
height: 200px;
border: none;
}
</style>
</head>
<body>
<button onclick="fetchRandomTrack()">🎲 Another! 🎲</button>
<div id="trackContainer">
<!-- Soundcloud embed will be inserted here -->
</div>
</body>
</html>