Starchik1 commited on
Commit
7b4e5c4
·
verified ·
1 Parent(s): fb28358

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +248 -18
index.html CHANGED
@@ -1,19 +1,249 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Music Stream</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ margin: 0;
11
+ background-color: #121212;
12
+ color: #B2B2B2;
13
+ display: flex;
14
+ flex-direction: column;
15
+ align-items: center;
16
+ justify-content: center;
17
+ height: 100vh;
18
+ overflow: hidden;
19
+ }
20
+
21
+ header {
22
+ width: 100%;
23
+ background-color: #1DB954;
24
+ padding: 10px 20px;
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: space-between;
28
+ }
29
+
30
+ header h1 {
31
+ margin: 0;
32
+ font-size: 24px;
33
+ text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7); /* Тёмный контур для текста */
34
+ }
35
+
36
+ .stop-button {
37
+ background-color: #4A4A4A;
38
+ color: #B3B3B3;
39
+ border: none;
40
+ padding: 10px 20px;
41
+ border-radius: 5px;
42
+ cursor: pointer;
43
+ font-size: 16px;
44
+ }
45
+
46
+ .stop-button:hover {
47
+ background-color: #C5303A;
48
+ }
49
+
50
+ .genre-container {
51
+ margin: 20px;
52
+ padding: 20px;
53
+ background-color: #282828;
54
+ border-radius: 10px;
55
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
56
+ width: 90%;
57
+ max-width: 600px;
58
+ }
59
+
60
+ .genre-title {
61
+ font-size: 20px;
62
+ margin-bottom: 10px;
63
+ }
64
+
65
+ .track-list {
66
+ list-style: none;
67
+ padding: 0;
68
+ margin: 0;
69
+ }
70
+
71
+ .track-list li {
72
+ display: flex;
73
+ justify-content: space-between;
74
+ align-items: center;
75
+ padding: 10px;
76
+ background-color: #333;
77
+ margin-bottom: 10px;
78
+ border-radius: 5px;
79
+ transition: all 0.3s ease;
80
+ }
81
+
82
+ .track-list li:last-child {
83
+ margin-bottom: 0;
84
+ }
85
+
86
+ .track-list li:hover {
87
+ background-color: #444;
88
+ transform: scale(1.05);
89
+ }
90
+
91
+ .track-list button {
92
+ background-color: #1DB954;
93
+ color: #FFF;
94
+ border: none;
95
+ padding: 5px 10px;
96
+ border-radius: 3px;
97
+ cursor: pointer;
98
+ font-size: 14px;
99
+ transition: background-color 0.3s ease;
100
+ }
101
+
102
+ .track-list button:hover {
103
+ background-color: #1AA34A;
104
+ }
105
+
106
+ .playing {
107
+ background-color: #555;
108
+ cursor: not-allowed;
109
+ }
110
+
111
+ footer {
112
+ margin-top: auto;
113
+ padding: 10px;
114
+ text-align: center;
115
+ font-size: 14px;
116
+ background-color: #1E1E1E;
117
+ width: 100%;
118
+ color: #B3B3B3;
119
+ }
120
+
121
+ .firework {
122
+ position: absolute;
123
+ width: 10px;
124
+ height: 10px;
125
+ border-radius: 50%;
126
+ animation: explode 2s ease-out forwards;
127
+ }
128
+
129
+ @keyframes explode {
130
+ 0% {
131
+ transform: translateY(0) scale(1);
132
+ opacity: 1;
133
+ }
134
+ 50% {
135
+ transform: translateY(-300px) scale(1.5);
136
+ opacity: 1;
137
+ }
138
+ 100% {
139
+ transform: translateY(-400px) scale(0);
140
+ opacity: 0;
141
+ }
142
+ }
143
+ </style>
144
+ </head>
145
+ <body>
146
+ <header>
147
+ <h1>Stream</h1>
148
+ <button class="stop-button" onclick="stopMusic()">Stop All</button>
149
+ </header>
150
+
151
+ <div class="genre-container">
152
+ <div class="genre-title"></div>
153
+ <ul class="track-list">
154
+ <li class="lo-fi">
155
+ Lo-Fi
156
+ <button class="play-button" onclick="playMusic('jfKfPfyJRdk', this)">Play</button>
157
+ </li>
158
+ <li class="rock">
159
+ Rock
160
+ <button class="play-button" onclick="playMusic('N5M1kIdcKhE', this)">Play</button>
161
+ </li>
162
+ <li class="rock">
163
+ Dubstep
164
+ <button class="play-button" onclick="playMusic('sR-sbG98ldM', this)">Play</button>
165
+ </li>
166
+ </ul>
167
+ </div>
168
+
169
+ <div id="player" style="display:none;"></div>
170
+
171
+ <footer>
172
+ <div>&copy; 2025 Music Stream | Made with ❤️</div>
173
+ <div id="current-time"></div>
174
+ </footer>
175
+
176
+ <script>
177
+ var tag = document.createElement('script');
178
+ tag.src = "https://www.youtube.com/iframe_api";
179
+ var firstScriptTag = document.getElementsByTagName('script')[0];
180
+ firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
181
+
182
+ var player;
183
+ var fireworkInterval;
184
+
185
+ function onYouTubeIframeAPIReady() {
186
+ player = new YT.Player('player', {
187
+ height: '0',
188
+ width: '0',
189
+ events: {
190
+ 'onStateChange': onPlayerStateChange
191
+ }
192
+ });
193
+ }
194
+
195
+ function createFirework() {
196
+ const firework = document.createElement('div');
197
+ firework.className = 'firework';
198
+ firework.style.left = `${Math.random() * window.innerWidth}px`;
199
+ firework.style.bottom = '0';
200
+ firework.style.backgroundColor = Math.random() < 0.2 ? '#FF0000' : '#FFD700';
201
+ document.body.appendChild(firework);
202
+ setTimeout(() => {
203
+ document.body.removeChild(firework);
204
+ }, 2000);
205
+ }
206
+
207
+ function onPlayerStateChange(event) {
208
+ if (event.data === YT.PlayerState.PLAYING) {
209
+ fireworkInterval = setInterval(createFirework, 500);
210
+ } else {
211
+ clearInterval(fireworkInterval);
212
+ }
213
+ }
214
+
215
+ function playMusic(videoId, button) {
216
+ if (player) {
217
+ // Сначала останавливаем текущий трек, если он играет
218
+ stopMusic();
219
+ player.loadVideoById(videoId);
220
+ player.playVideo();
221
+ // Заменяем кнопку на "Серую"
222
+ button.classList.add('playing');
223
+ button.textContent = "Playing...";
224
+ }
225
+ }
226
+
227
+ function stopMusic() {
228
+ if (player) {
229
+ player.stopVideo();
230
+ }
231
+ clearInterval(fireworkInterval);
232
+ // Возвращаем все кнопки Play в исходное состояние
233
+ document.querySelectorAll('.play-button').forEach(button => {
234
+ button.classList.remove('playing');
235
+ button.textContent = "Play";
236
+ });
237
+ }
238
+
239
+ function updateTime() {
240
+ const now = new Date();
241
+ const timeString = now.toLocaleTimeString();
242
+ document.getElementById('current-time').textContent = `${timeString}`;
243
+ }
244
+
245
+ setInterval(updateTime, 1000);
246
+ updateTime();
247
+ </script>
248
+ </body>
249
  </html>