snoofm commited on
Commit
f7eedb8
·
verified ·
1 Parent(s): 6dbeac1

make it good it's not aligned, choose a nice font and buttons - Initial Deployment

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +354 -19
  3. prompts.txt +2 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Egg Timer
3
- emoji: 📉
4
- colorFrom: yellow
5
- colorTo: gray
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: egg-timer
3
+ emoji: 🐳
4
+ colorFrom: purple
5
+ colorTo: yellow
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,354 @@
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>7-Minute Countdown Timer</title>
7
+ <style>
8
+ @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
9
+
10
+ body {
11
+ margin: 0;
12
+ padding: 0;
13
+ font-family: 'Poppins', sans-serif;
14
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
15
+ display: flex;
16
+ justify-content: center;
17
+ align-items: center;
18
+ min-height: 100vh;
19
+ color: white;
20
+ }
21
+
22
+ .timer-container {
23
+ text-align: center;
24
+ background: rgba(255, 255, 255, 0.15);
25
+ backdrop-filter: blur(12px);
26
+ border-radius: 24px;
27
+ padding: 60px 40px;
28
+ box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
29
+ border: 1px solid rgba(255, 255, 255, 0.25);
30
+ max-width: 480px;
31
+ width: 90%;
32
+ }
33
+
34
+ h1 {
35
+ font-weight: 600;
36
+ margin-bottom: 30px;
37
+ font-size: 2rem;
38
+ }
39
+
40
+ .timer-display {
41
+ font-size: 5rem;
42
+ font-weight: 600;
43
+ margin: 40px 0;
44
+ text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
45
+ font-family: 'Poppins', sans-serif;
46
+ letter-spacing: 1px;
47
+ }
48
+
49
+ .controls {
50
+ margin: 40px 0;
51
+ display: flex;
52
+ justify-content: center;
53
+ flex-wrap: wrap;
54
+ gap: 15px;
55
+ }
56
+
57
+ button {
58
+ background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
59
+ border: none;
60
+ color: white;
61
+ padding: 16px 32px;
62
+ border-radius: 12px;
63
+ font-size: 1.1rem;
64
+ font-weight: 500;
65
+ cursor: pointer;
66
+ transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
67
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
68
+ min-width: 120px;
69
+ }
70
+
71
+ button:hover {
72
+ transform: translateY(-3px);
73
+ box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
74
+ }
75
+
76
+ button:active {
77
+ transform: translateY(1px);
78
+ }
79
+
80
+ button:disabled {
81
+ opacity: 0.7;
82
+ cursor: not-allowed;
83
+ transform: none;
84
+ background: linear-gradient(45deg, #bdc3c7, #2c3e50);
85
+ }
86
+
87
+ .time-input {
88
+ margin: 30px 0;
89
+ display: flex;
90
+ justify-content: center;
91
+ align-items: center;
92
+ gap: 15px;
93
+ }
94
+
95
+ .time-input input {
96
+ width: 80px;
97
+ padding: 12px;
98
+ border-radius: 8px;
99
+ border: none;
100
+ text-align: center;
101
+ font-size: 1.1rem;
102
+ background: rgba(255, 255, 255, 0.2);
103
+ color: white;
104
+ font-weight: 500;
105
+ }
106
+
107
+ .time-input label {
108
+ font-weight: 400;
109
+ font-size: 1.1rem;
110
+ }
111
+
112
+ .progress-bar {
113
+ width: 100%;
114
+ height: 10px;
115
+ background: rgba(255, 255, 255, 0.2);
116
+ border-radius: 5px;
117
+ margin: 30px 0;
118
+ overflow: hidden;
119
+ }
120
+
121
+ .progress-fill {
122
+ height: 100%;
123
+ background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
124
+ border-radius: 5px;
125
+ transition: width 1s linear;
126
+ width: 100%;
127
+ }
128
+
129
+ .status {
130
+ font-size: 1.3rem;
131
+ margin: 30px 0;
132
+ font-weight: 400;
133
+ }
134
+
135
+ .alarm-modal {
136
+ display: none;
137
+ position: fixed;
138
+ top: 0;
139
+ left: 0;
140
+ width: 100%;
141
+ height: 100%;
142
+ background: rgba(0, 0, 0, 0.85);
143
+ z-index: 1000;
144
+ }
145
+
146
+ .alarm-content {
147
+ position: absolute;
148
+ top: 50%;
149
+ left: 50%;
150
+ transform: translate(-50%, -50%);
151
+ background: linear-gradient(135deg, #ff4d4d, #f94336);
152
+ padding: 50px;
153
+ border-radius: 24px;
154
+ text-align: center;
155
+ box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
156
+ animation: bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
157
+ max-width: 90%;
158
+ width: 400px;
159
+ }
160
+
161
+ @keyframes bounce {
162
+ 0% { transform: translate(-50%, -50%) scale(0.5); }
163
+ 100% { transform: translate(-50%, -50%) scale(1); }
164
+ }
165
+
166
+ .alarm-content h2 {
167
+ font-size: 2.8rem;
168
+ margin: 0 0 25px 0;
169
+ animation: pulse 1.2s infinite;
170
+ }
171
+
172
+ @keyframes pulse {
173
+ 0%, 100% { transform: scale(1); }
174
+ 50% { transform: scale(1.05); }
175
+ }
176
+
177
+ .dismiss-btn {
178
+ background: white;
179
+ color: #ff4757;
180
+ margin-top: 25px;
181
+ padding: 14px 28px;
182
+ border-radius: 10px;
183
+ font-weight: 600;
184
+ }
185
+
186
+ @media (max-width: 480px) {
187
+ .timer-display {
188
+ font-size: 3.5rem;
189
+ }
190
+
191
+ .controls {
192
+ flex-direction: column;
193
+ gap: 12px;
194
+ }
195
+
196
+ button {
197
+ width: 100%;
198
+ }
199
+ }
200
+ </style>
201
+ </head>
202
+ <body>
203
+ <div class="timer-container">
204
+ <h1>Perfect Egg Timer</h1>
205
+ <div class="time-input">
206
+ <label for="minutes">Minutes:</label>
207
+ <input type="number" id="minutes" min="0" max="59" value="7">
208
+ <label for="seconds">Seconds:</label>
209
+ <input type="number" id="seconds" min="0" max="59" value="0">
210
+ </div>
211
+ <div class="timer-display" id="timerDisplay">07:00</div>
212
+ <div class="progress-bar">
213
+ <div class="progress-fill" id="progressFill"></div>
214
+ </div>
215
+ <div class="status" id="status">Ready to start</div>
216
+ <div class="controls">
217
+ <button onclick="startTimer()" id="startBtn">Start</button>
218
+ <button onclick="pauseTimer()" id="pauseBtn" disabled>Pause</button>
219
+ <button onclick="resetTimer()" id="resetBtn">Reset</button>
220
+ <button onclick="setCustomTime()" id="setTimeBtn">Set Time</button>
221
+ </div>
222
+ </div>
223
+
224
+ <div class="alarm-modal" id="alarmModal">
225
+ <div class="alarm-content">
226
+ <h2>⏰ TIME'S UP! ⏰</h2>
227
+ <p>Your 7-minute timer has finished!</p>
228
+ <button class="dismiss-btn" onclick="dismissAlarm()">Dismiss</button>
229
+ </div>
230
+ </div>
231
+
232
+ <script>
233
+ let totalTime = 7 * 60; // 7 minutes in seconds
234
+ let currentTime = totalTime;
235
+ let isRunning = false;
236
+ let timerInterval;
237
+ let audioContext;
238
+ let alarmSound;
239
+
240
+ // Initialize audio context for alarm sound
241
+ function initAudio() {
242
+ audioContext = new (window.AudioContext || window.webkitAudioContext)();
243
+ }
244
+
245
+ // Create alarm sound using Web Audio API
246
+ function createAlarmSound() {
247
+ const oscillator = audioContext.createOscillator();
248
+ const gainNode = audioContext.createGain();
249
+
250
+ oscillator.connect(gainNode);
251
+ gainNode.connect(audioContext.destination);
252
+
253
+ oscillator.frequency.setValueAtTime(800, audioContext.currentTime);
254
+ oscillator.type = 'sine';
255
+
256
+ gainNode.gain.setValueAtTime(0, audioContext.currentTime);
257
+ gainNode.gain.linearRampToValueAtTime(0.3, audioContext.currentTime + 0.1);
258
+ gainNode.gain.linearRampToValueAtTime(0, audioContext.currentTime + 0.5);
259
+
260
+ oscillator.start(audioContext.currentTime);
261
+ oscillator.stop(audioContext.currentTime + 0.5);
262
+ }
263
+
264
+ function playAlarm() {
265
+ if (!audioContext) initAudio();
266
+
267
+ // Play multiple beeps
268
+ for (let i = 0; i < 6; i++) {
269
+ setTimeout(() => createAlarmSound(), i * 600);
270
+ }
271
+ }
272
+
273
+ function updateDisplay() {
274
+ const minutes = Math.floor(currentTime / 60);
275
+ const seconds = currentTime % 60;
276
+ document.getElementById('timerDisplay').textContent =
277
+ `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
278
+
279
+ // Update progress bar
280
+ const progress = ((totalTime - currentTime) / totalTime) * 100;
281
+ document.getElementById('progressFill').style.width = `${progress}%`;
282
+ }
283
+
284
+ function startTimer() {
285
+ if (!audioContext) initAudio();
286
+
287
+ isRunning = true;
288
+ document.getElementById('startBtn').disabled = true;
289
+ document.getElementById('pauseBtn').disabled = false;
290
+ document.getElementById('status').textContent = 'Timer running...';
291
+
292
+ timerInterval = setInterval(() => {
293
+ if (currentTime > 0) {
294
+ currentTime--;
295
+ updateDisplay();
296
+ } else {
297
+ // Timer finished
298
+ clearInterval(timerInterval);
299
+ isRunning = false;
300
+ document.getElementById('startBtn').disabled = false;
301
+ document.getElementById('pauseBtn').disabled = true;
302
+ document.getElementById('status').textContent = 'Time\'s up!';
303
+
304
+ // Show alarm modal and play sound
305
+ document.getElementById('alarmModal').style.display = 'block';
306
+ playAlarm();
307
+ }
308
+ }, 1000);
309
+ }
310
+
311
+ function pauseTimer() {
312
+ clearInterval(timerInterval);
313
+ isRunning = false;
314
+ document.getElementById('startBtn').disabled = false;
315
+ document.getElementById('pauseBtn').disabled = true;
316
+ document.getElementById('status').textContent = 'Timer paused';
317
+ }
318
+
319
+ function resetTimer() {
320
+ clearInterval(timerInterval);
321
+ isRunning = false;
322
+ currentTime = totalTime;
323
+ updateDisplay();
324
+ document.getElementById('startBtn').disabled = false;
325
+ document.getElementById('pauseBtn').disabled = true;
326
+ document.getElementById('status').textContent = 'Ready to start';
327
+ }
328
+
329
+ function dismissAlarm() {
330
+ document.getElementById('alarmModal').style.display = 'none';
331
+ resetTimer();
332
+ }
333
+
334
+ // Initialize display
335
+ updateDisplay();
336
+
337
+ // Handle browser tab visibility to continue timer
338
+ document.addEventListener('visibilitychange', function() {
339
+ if (document.hidden && isRunning) {
340
+ // Store the time when tab becomes hidden
341
+ localStorage.setItem('timerStartTime', Date.now() - (totalTime - currentTime) * 1000);
342
+ } else if (!document.hidden && isRunning) {
343
+ // Recalculate time when tab becomes visible
344
+ const startTime = localStorage.getItem('timerStartTime');
345
+ if (startTime) {
346
+ const elapsed = Math.floor((Date.now() - parseInt(startTime)) / 1000);
347
+ currentTime = Math.max(0, totalTime - elapsed);
348
+ updateDisplay();
349
+ }
350
+ }
351
+ });
352
+ </script>
353
+ </body>
354
+ </html>
prompts.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ add a function to customize the time not just 7minutes, and it's a egg boiling reminder so the time might change everytime
2
+ make it good it's not aligned, choose a nice font and buttons