Krylov commited on
Commit
dd07bb5
·
verified ·
1 Parent(s): a1b26f3

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +289 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Alert
3
- emoji: 🏃
4
- colorFrom: gray
5
- colorTo: red
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: alert
3
+ emoji: 🐳
4
+ colorFrom: pink
5
+ colorTo: pink
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,289 @@
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="uk">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Повітряна тривога - Київ та область</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ @keyframes pulse {
11
+ 0% { transform: scale(1); opacity: 1; }
12
+ 50% { transform: scale(1.05); opacity: 0.8; }
13
+ 100% { transform: scale(1); opacity: 1; }
14
+ }
15
+
16
+ @keyframes shake {
17
+ 0% { transform: translateX(0); }
18
+ 25% { transform: translateX(-5px); }
19
+ 50% { transform: translateX(5px); }
20
+ 75% { transform: translateX(-5px); }
21
+ 100% { transform: translateX(0); }
22
+ }
23
+
24
+ .alert-active {
25
+ animation: pulse 1.5s infinite, shake 0.5s infinite;
26
+ }
27
+
28
+ .ukraine-gradient {
29
+ background: linear-gradient(135deg, #005BBB 50%, #FFD500 50%);
30
+ }
31
+
32
+ .countdown-digit {
33
+ background: rgba(0, 0, 0, 0.7);
34
+ color: white;
35
+ border-radius: 5px;
36
+ padding: 0.5rem;
37
+ min-width: 2rem;
38
+ display: inline-block;
39
+ text-align: center;
40
+ }
41
+ </style>
42
+ </head>
43
+ <body class="font-sans bg-gray-100">
44
+ <div class="container mx-auto max-w-md p-4">
45
+ <div class="bg-white rounded-xl shadow-xl overflow-hidden">
46
+ <!-- Header -->
47
+ <div class="ukraine-gradient text-white p-4 flex items-center justify-between">
48
+ <div class="flex items-center">
49
+ <i class="fas fa-shield-alt text-2xl mr-3"></i>
50
+ <div>
51
+ <h1 class="text-xl font-bold">Повітряна тривога</h1>
52
+ <p class="text-sm opacity-90">Київ та Київська область</p>
53
+ </div>
54
+ </div>
55
+ <div class="text-right">
56
+ <div class="text-xs opacity-90" id="current-time">--:--:--</div>
57
+ <div class="text-xs opacity-90" id="current-date">-- --- ----</div>
58
+ </div>
59
+ </div>
60
+
61
+ <!-- Main Alert Status -->
62
+ <div class="p-6 text-center" id="alert-status-container">
63
+ <div class="rounded-full bg-blue-100 text-blue-800 p-4 mx-auto w-32 h-32 flex items-center justify-center mb-4" id="alert-status-icon">
64
+ <i class="fas fa-check-circle text-5xl"></i>
65
+ </div>
66
+ <h2 class="text-2xl font-bold mb-2" id="alert-status-text">Тривоги немає</h2>
67
+ <p class="text-gray-600 mb-4" id="alert-status-description">Станом на <span id="last-update">--:--</span></p>
68
+
69
+ <div class="hidden" id="countdown-container">
70
+ <p class="text-sm text-gray-600 mb-2">Тривога триває:</p>
71
+ <div class="flex justify-center space-x-1">
72
+ <span class="countdown-digit" id="countdown-hours">00</span>
73
+ <span>:</span>
74
+ <span class="countdown-digit" id="countdown-minutes">00</span>
75
+ <span>:</span>
76
+ <span class="countdown-digit" id="countdown-seconds">00</span>
77
+ </div>
78
+ </div>
79
+ </div>
80
+
81
+ <!-- Regions Status -->
82
+ <div class="border-t border-gray-200 p-4">
83
+ <h3 class="font-semibold text-lg mb-3 flex items-center">
84
+ <i class="fas fa-map-marked-alt mr-2 text-blue-600"></i>
85
+ Статус по районах
86
+ </h3>
87
+
88
+ <div class="grid grid-cols-2 gap-2">
89
+ <div class="bg-green-100 text-green-800 p-2 rounded-lg flex items-center">
90
+ <i class="fas fa-check-circle mr-2"></i>
91
+ <span>Київ</span>
92
+ </div>
93
+ <div class="bg-green-100 text-green-800 p-2 rounded-lg flex items-center">
94
+ <i class="fas fa-check-circle mr-2"></i>
95
+ <span>Бровари</span>
96
+ </div>
97
+ <div class="bg-green-100 text-green-800 p-2 rounded-lg flex items-center">
98
+ <i class="fas fa-check-circle mr-2"></i>
99
+ <span>Ірпінь</span>
100
+ </div>
101
+ <div class="bg-green-100 text-green-800 p-2 rounded-lg flex items-center">
102
+ <i class="fas fa-check-circle mr-2"></i>
103
+ <span>Буча</span>
104
+ </div>
105
+ <div class="bg-green-100 text-green-800 p-2 rounded-lg flex items-center">
106
+ <i class="fas fa-check-circle mr-2"></i>
107
+ <span>Вишгород</span>
108
+ </div>
109
+ <div class="bg-green-100 text-green-800 p-2 rounded-lg flex items-center">
110
+ <i class="fas fa-check-circle mr-2"></i>
111
+ <span>Бориспіль</span>
112
+ </div>
113
+ </div>
114
+ </div>
115
+
116
+ <!-- Safety Instructions -->
117
+ <div class="border-t border-gray-200 p-4">
118
+ <h3 class="font-semibold text-lg mb-3 flex items-center">
119
+ <i class="fas fa-info-circle mr-2 text-blue-600"></i>
120
+ Що робити під час тривоги?
121
+ </h3>
122
+
123
+ <div class="space-y-3">
124
+ <div class="flex items-start">
125
+ <div class="bg-blue-100 text-blue-800 rounded-full w-6 h-6 flex items-center justify-center mr-2 flex-shrink-0">
126
+ <i class="fas fa-running text-xs"></i>
127
+ </div>
128
+ <p>Швидко перемістіться до найближчого укриття</p>
129
+ </div>
130
+ <div class="flex items-start">
131
+ <div class="bg-blue-100 text-blue-800 rounded-full w-6 h-6 flex items-center justify-center mr-2 flex-shrink-0">
132
+ <i class="fas fa-mobile-alt text-xs"></i>
133
+ </div>
134
+ <p>Слідкуйте за офіційними джерелами інформації</p>
135
+ </div>
136
+ <div class="flex items-start">
137
+ <div class="bg-blue-100 text-blue-800 rounded-full w-6 h-6 flex items-center justify-center mr-2 flex-shrink-0">
138
+ <i class="fas fa-first-aid text-xs"></i>
139
+ </div>
140
+ <p>Майте при собі аптечку та запас води</p>
141
+ </div>
142
+ </div>
143
+ </div>
144
+
145
+ <!-- Footer -->
146
+ <div class="border-t border-gray-200 bg-gray-50 p-3 text-center text-xs text-gray-600">
147
+ <p>Дані оновлюються автоматично</p>
148
+ <p class="mt-1">© 2023 Україна. Героям слава! <i class="fas fa-heart text-red-500"></i></p>
149
+ </div>
150
+ </div>
151
+
152
+ <!-- Test buttons (would be removed in production) -->
153
+ <div class="mt-4 flex justify-center space-x-4">
154
+ <button onclick="triggerAlert(true)" class="bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-lg">
155
+ Симулювати тривогу
156
+ </button>
157
+ <button onclick="triggerAlert(false)" class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-lg">
158
+ Відмінити тривогу
159
+ </button>
160
+ </div>
161
+ </div>
162
+
163
+ <script>
164
+ // Update time and date
165
+ function updateDateTime() {
166
+ const now = new Date();
167
+ const timeElement = document.getElementById('current-time');
168
+ const dateElement = document.getElementById('current-date');
169
+ const lastUpdateElement = document.getElementById('last-update');
170
+
171
+ const hours = String(now.getHours()).padStart(2, '0');
172
+ const minutes = String(now.getMinutes()).padStart(2, '0');
173
+ const seconds = String(now.getSeconds()).padStart(2, '0');
174
+
175
+ const days = ['Неділя', 'Понеділок', 'Вівторок', 'Середа', 'Четвер', 'Пятниця', 'Субота'];
176
+ const months = ['січня', 'лютого', 'березня', 'квітня', 'травня', 'червня', 'липня', 'серпня', 'вересня', 'жовтня', 'листопада', 'грудня'];
177
+
178
+ timeElement.textContent = `${hours}:${minutes}:${seconds}`;
179
+ dateElement.textContent = `${days[now.getDay()]}, ${now.getDate()} ${months[now.getMonth()]} ${now.getFullYear()}`;
180
+ lastUpdateElement.textContent = `${hours}:${minutes}`;
181
+ }
182
+
183
+ setInterval(updateDateTime, 1000);
184
+ updateDateTime();
185
+
186
+ // Alert simulation
187
+ let alertStartTime = null;
188
+ let countdownInterval = null;
189
+
190
+ function triggerAlert(active) {
191
+ const statusContainer = document.getElementById('alert-status-container');
192
+ const statusIcon = document.getElementById('alert-status-icon');
193
+ const statusText = document.getElementById('alert-status-text');
194
+ const statusDescription = document.getElementById('alert-status-description');
195
+ const countdownContainer = document.getElementById('countdown-container');
196
+ const regionStatuses = document.querySelectorAll('.bg-green-100');
197
+
198
+ if (active) {
199
+ // Start alert
200
+ statusContainer.classList.add('alert-active');
201
+ statusIcon.className = 'rounded-full bg-red-100 text-red-800 p-4 mx-auto w-32 h-32 flex items-center justify-center mb-4 alert-active';
202
+ statusIcon.innerHTML = '<i class="fas fa-exclamation-triangle text-5xl"></i>';
203
+ statusText.textContent = 'Повітряна тривога!';
204
+ statusText.className = 'text-2xl font-bold mb-2 text-red-600';
205
+ statusDescription.innerHTML = 'Станом на <span id="last-update">' + document.getElementById('last-update').textContent + '</span>';
206
+
207
+ countdownContainer.classList.remove('hidden');
208
+
209
+ // Change all regions to alert status
210
+ regionStatuses.forEach(el => {
211
+ el.className = 'bg-red-100 text-red-800 p-2 rounded-lg flex items-center';
212
+ el.innerHTML = '<i class="fas fa-exclamation-triangle mr-2"></i>' + el.textContent;
213
+ });
214
+
215
+ // Start countdown
216
+ alertStartTime = new Date();
217
+ updateCountdown();
218
+ countdownInterval = setInterval(updateCountdown, 1000);
219
+
220
+ // Play alert sound (simulated with a beep)
221
+ playAlertSound();
222
+ } else {
223
+ // End alert
224
+ statusContainer.classList.remove('alert-active');
225
+ statusIcon.className = 'rounded-full bg-blue-100 text-blue-800 p-4 mx-auto w-32 h-32 flex items-center justify-center mb-4';
226
+ statusIcon.innerHTML = '<i class="fas fa-check-circle text-5xl"></i>';
227
+ statusText.textContent = 'Тривоги немає';
228
+ statusText.className = 'text-2xl font-bold mb-2';
229
+ statusDescription.innerHTML = 'Станом на <span id="last-update">' + document.getElementById('last-update').textContent + '</span>';
230
+
231
+ countdownContainer.classList.add('hidden');
232
+
233
+ // Change all regions back to normal
234
+ regionStatuses.forEach(el => {
235
+ el.className = 'bg-green-100 text-green-800 p-2 rounded-lg flex items-center';
236
+ el.innerHTML = '<i class="fas fa-check-circle mr-2"></i>' + el.textContent;
237
+ });
238
+
239
+ // Stop countdown
240
+ if (countdownInterval) {
241
+ clearInterval(countdownInterval);
242
+ }
243
+ }
244
+ }
245
+
246
+ function updateCountdown() {
247
+ const now = new Date();
248
+ const diff = Math.floor((now - alertStartTime) / 1000); // difference in seconds
249
+
250
+ const hours = Math.floor(diff / 3600);
251
+ const minutes = Math.floor((diff % 3600) / 60);
252
+ const seconds = diff % 60;
253
+
254
+ document.getElementById('countdown-hours').textContent = String(hours).padStart(2, '0');
255
+ document.getElementById('countdown-minutes').textContent = String(minutes).padStart(2, '0');
256
+ document.getElementById('countdown-seconds').textContent = String(seconds).padStart(2, '0');
257
+ }
258
+
259
+ function playAlertSound() {
260
+ // In a real implementation, this would play an actual alert sound
261
+ const context = new (window.AudioContext || window.webkitAudioContext)();
262
+ const oscillator = context.createOscillator();
263
+ const gain = context.createGain();
264
+
265
+ oscillator.type = 'sine';
266
+ oscillator.frequency.value = 800;
267
+ gain.gain.value = 0.1;
268
+
269
+ oscillator.connect(gain);
270
+ gain.connect(context.destination);
271
+
272
+ oscillator.start();
273
+ setTimeout(() => {
274
+ oscillator.stop();
275
+ }, 1000);
276
+ }
277
+
278
+ // Simulate random alerts for demo purposes
279
+ setInterval(() => {
280
+ if (Math.random() > 0.95) { // 5% chance to trigger alert
281
+ triggerAlert(true);
282
+ setTimeout(() => {
283
+ triggerAlert(false);
284
+ }, 30000 + Math.random() * 120000); // End alert after 30-150 seconds
285
+ }
286
+ }, 60000); // Check every minute
287
+ </script>
288
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Krylov/alert" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
289
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ создай красивій патриотичній виджет которій буде т информировать о воздушной тревоге в киеве и области