Miguel197702 commited on
Commit
c3dcf76
·
verified ·
1 Parent(s): 5d3d92c

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +1 -520
index.html CHANGED
@@ -1,520 +1 @@
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>Dynamic Greeting Studio</title>
7
-
8
- <!-- Import Google Fonts -->
9
- <link rel="preconnect" href="https://fonts.googleapis.com">
10
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11
- <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;900&family=Poppins:wght@300;400;600&display=swap" rel="stylesheet">
12
-
13
- <!-- Import FontAwesome for Icons -->
14
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
15
-
16
- <style>
17
- /* --- CSS Variables & Reset --- */
18
- :root {
19
- --bg-color: #f0f2f5;
20
- --card-bg: rgba(255, 255, 255, 0.75);
21
- --text-primary: #333;
22
- --text-secondary: #666;
23
- --accent-color: #ff6b6b;
24
- --glass-border: rgba(255, 255, 255, 0.5);
25
- --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
26
-
27
- /* Dynamic Theme Colors (Default Morning) */
28
- --sky-top: #FFD194;
29
- --sky-bottom: #D1913C;
30
- --sun-color: #ffdb4d;
31
- }
32
-
33
- * {
34
- margin: 0;
35
- padding: 0;
36
- box-sizing: border-box;
37
- }
38
-
39
- body {
40
- font-family: 'Poppins', sans-serif;
41
- background: linear-gradient(to bottom, var(--sky-top), var(--sky-bottom));
42
- min-height: 100vh;
43
- display: flex;
44
- flex-direction: column;
45
- align-items: center;
46
- justify-content: center;
47
- transition: background 1s ease;
48
- overflow-x: hidden;
49
- position: relative;
50
- }
51
-
52
- /* --- Background Animation Elements --- */
53
- .sun {
54
- position: absolute;
55
- width: 120px;
56
- height: 120px;
57
- background: var(--sun-color);
58
- border-radius: 50%;
59
- top: 20%;
60
- left: 50%;
61
- transform: translate(-50%, -50%);
62
- box-shadow: 0 0 40px 10px rgba(255, 219, 77, 0.6);
63
- transition: top 1s cubic-bezier(0.4, 0.0, 0.2, 1), background 1s ease, box-shadow 1s ease;
64
- z-index: 0;
65
- }
66
-
67
- .cloud {
68
- position: absolute;
69
- background: rgba(255, 255, 255, 0.8);
70
- border-radius: 50px;
71
- opacity: 0.8;
72
- z-index: 0;
73
- animation: floatCloud linear infinite;
74
- }
75
-
76
- .cloud::after, .cloud::before {
77
- content: '';
78
- position: absolute;
79
- background: inherit;
80
- border-radius: 50%;
81
- }
82
-
83
- @keyframes floatCloud {
84
- 0% { transform: translateX(-200px); }
85
- 100% { transform: translateX(100vw); }
86
- }
87
-
88
- /* --- Main Container --- */
89
- .container {
90
- position: relative;
91
- z-index: 10;
92
- width: 90%;
93
- max-width: 500px;
94
- background: var(--card-bg);
95
- backdrop-filter: blur(12px);
96
- -webkit-backdrop-filter: blur(12px);
97
- border: 1px solid var(--glass-border);
98
- border-radius: 24px;
99
- padding: 40px;
100
- box-shadow: var(--shadow);
101
- text-align: center;
102
- animation: slideUp 0.8s ease-out;
103
- }
104
-
105
- @keyframes slideUp {
106
- from { transform: translateY(30px); opacity: 0; }
107
- to { transform: translateY(0); opacity: 1; }
108
- }
109
-
110
- /* --- Header & Branding --- */
111
- header {
112
- margin-bottom: 30px;
113
- }
114
-
115
- .brand-link {
116
- font-size: 0.8rem;
117
- color: var(--text-secondary);
118
- text-decoration: none;
119
- opacity: 0.7;
120
- transition: opacity 0.3s;
121
- display: inline-flex;
122
- align-items: center;
123
- gap: 5px;
124
- }
125
-
126
- .brand-link:hover {
127
- opacity: 1;
128
- color: var(--accent-color);
129
- }
130
-
131
- /* --- Greeting Display --- */
132
- .greeting-display {
133
- margin-bottom: 30px;
134
- min-height: 100px;
135
- display: flex;
136
- flex-direction: column;
137
- justify-content: center;
138
- align-items: center;
139
- }
140
-
141
- .greeting-label {
142
- font-size: 0.9rem;
143
- text-transform: uppercase;
144
- letter-spacing: 2px;
145
- color: var(--text-secondary);
146
- margin-bottom: 10px;
147
- }
148
-
149
- .greeting-text {
150
- font-family: 'Montserrat', sans-serif;
151
- font-size: 2.5rem;
152
- font-weight: 900;
153
- color: var(--text-primary);
154
- background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-color) 100%);
155
- -webkit-background-clip: text;
156
- background-clip: text;
157
- color: transparent;
158
- min-height: 3.5rem;
159
- line-height: 1.2;
160
- }
161
-
162
- /* --- Controls --- */
163
- .controls {
164
- background: rgba(255, 255, 255, 0.5);
165
- padding: 20px;
166
- border-radius: 16px;
167
- border: 1px solid rgba(255, 255, 255, 0.4);
168
- }
169
-
170
- .control-group {
171
- margin-bottom: 20px;
172
- }
173
-
174
- .control-group:last-child {
175
- margin-bottom: 0;
176
- }
177
-
178
- label {
179
- display: block;
180
- font-size: 0.85rem;
181
- font-weight: 600;
182
- margin-bottom: 8px;
183
- color: var(--text-primary);
184
- }
185
-
186
- input[type="text"] {
187
- width: 100%;
188
- padding: 12px 15px;
189
- border: 2px solid transparent;
190
- border-radius: 12px;
191
- background: rgba(255, 255, 255, 0.8);
192
- font-family: 'Poppins', sans-serif;
193
- font-size: 1rem;
194
- transition: all 0.3s ease;
195
- outline: none;
196
- box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
197
- }
198
-
199
- input[type="text"]:focus {
200
- border-color: var(--accent-color);
201
- background: #fff;
202
- box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
203
- }
204
-
205
- /* Slider Styling */
206
- .time-slider-container {
207
- display: flex;
208
- align-items: center;
209
- gap: 15px;
210
- }
211
-
212
- input[type="range"] {
213
- -webkit-appearance: none;
214
- width: 100%;
215
- height: 6px;
216
- background: rgba(0,0,0,0.1);
217
- border-radius: 5px;
218
- outline: none;
219
- cursor: pointer;
220
- }
221
-
222
- input[type="range"]::-webkit-slider-thumb {
223
- -webkit-appearance: none;
224
- width: 20px;
225
- height: 20px;
226
- border-radius: 50%;
227
- background: var(--accent-color);
228
- cursor: pointer;
229
- transition: transform 0.2s;
230
- box-shadow: 0 2px 6px rgba(0,0,0,0.2);
231
- }
232
-
233
- input[type="range"]::-webkit-slider-thumb:hover {
234
- transform: scale(1.2);
235
- }
236
-
237
- .time-display {
238
- font-family: 'Montserrat', sans-serif;
239
- font-weight: 700;
240
- min-width: 60px;
241
- }
242
-
243
- /* --- Buttons --- */
244
- .actions {
245
- display: flex;
246
- gap: 10px;
247
- margin-top: 25px;
248
- }
249
-
250
- .btn {
251
- flex: 1;
252
- padding: 12px;
253
- border: none;
254
- border-radius: 12px;
255
- font-family: 'Poppins', sans-serif;
256
- font-weight: 600;
257
- cursor: pointer;
258
- transition: all 0.3s ease;
259
- display: flex;
260
- align-items: center;
261
- justify-content: center;
262
- gap: 8px;
263
- }
264
-
265
- .btn-primary {
266
- background: var(--accent-color);
267
- color: white;
268
- box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
269
- }
270
-
271
- .btn-primary:hover {
272
- background: #ff5252;
273
- transform: translateY(-2px);
274
- box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
275
- }
276
-
277
- .btn-primary:active {
278
- transform: translateY(0);
279
- }
280
-
281
- /* --- Toast Notification --- */
282
- .toast {
283
- position: fixed;
284
- bottom: 30px;
285
- left: 50%;
286
- transform: translateX(-50%) translateY(100px);
287
- background: #333;
288
- color: #fff;
289
- padding: 12px 24px;
290
- border-radius: 50px;
291
- font-size: 0.9rem;
292
- box-shadow: 0 5px 15px rgba(0,0,0,0.2);
293
- opacity: 0;
294
- transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
295
- z-index: 100;
296
- display: flex;
297
- align-items: center;
298
- gap: 10px;
299
- }
300
-
301
- .toast.show {
302
- transform: translateX(-50%) translateY(0);
303
- opacity: 1;
304
- }
305
-
306
- /* --- Responsive --- */
307
- @media (max-width: 480px) {
308
- .container {
309
- width: 95%;
310
- padding: 25px;
311
- }
312
- .greeting-text {
313
- font-size: 2rem;
314
- }
315
- .sun {
316
- width: 80px;
317
- height: 80px;
318
- }
319
- }
320
- </style>
321
- </head>
322
- <body>
323
-
324
- <!-- Dynamic Background Elements -->
325
- <div class="sun" id="sun"></div>
326
- <div class="cloud" style="width: 100px; height: 40px; top: 15%; left: -100px; animation-duration: 25s;"></div>
327
- <div class="cloud" style="width: 140px; height: 50px; top: 30%; left: -150px; animation-duration: 35s; animation-delay: 5s;"></div>
328
-
329
- <main class="container">
330
- <header>
331
- <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="brand-link">
332
- Built with anycoder <i class="fa-solid fa-code"></i>
333
- </a>
334
- </header>
335
-
336
- <section class="greeting-display">
337
- <div class="greeting-label" id="timeLabel">Current Time</div>
338
- <h1 class="greeting-text" id="greetingText">Loading...</h1>
339
- </section>
340
-
341
- <section class="controls">
342
- <div class="control-group">
343
- <label for="customMessage">Your Message</label>
344
- <input type="text" id="customMessage" placeholder="Type something nice..." value="Olá, Bom dia!">
345
- </div>
346
-
347
- <div class="control-group">
348
- <label for="timeSlider">Simulate Time of Day</label>
349
- <div class="time-slider-container">
350
- <span style="font-size: 0.8rem">00:00</span>
351
- <input type="range" id="timeSlider" min="0" max="23" value="8" step="1">
352
- <span style="font-size: 0.8rem">23:00</span>
353
- </div>
354
- </div>
355
-
356
- <div class="actions">
357
- <button class="btn btn-primary" id="updateBtn">
358
- <i class="fa-solid fa-wand-magic-sparkles"></i> Update
359
- </button>
360
- </div>
361
- </section>
362
- </main>
363
-
364
- <!-- Toast Notification Element -->
365
- <div class="toast" id="toast">
366
- <i class="fa-solid fa-circle-check" style="color: #4caf50;"></i>
367
- <span>Greeting updated successfully!</span>
368
- </div>
369
-
370
- <script>
371
- document.addEventListener('DOMContentLoaded', () => {
372
- // DOM Elements
373
- const greetingText = document.getElementById('greetingText');
374
- const timeSlider = document.getElementById('timeSlider');
375
- const timeLabel = document.getElementById('timeLabel');
376
- const customMessageInput = document.getElementById('customMessage');
377
- const updateBtn = document.getElementById('updateBtn');
378
- const sun = document.getElementById('sun');
379
- const toast = document.getElementById('toast');
380
-
381
- // State
382
- let currentHour = new Date().getHours();
383
- let isTypingEffect = false;
384
-
385
- // Theme Configurations (Gradients and Sun Position)
386
- const themes = {
387
- night: {
388
- top: '#0f2027',
389
- bottom: '#203a43',
390
- sunColor: '#4b6cb7',
391
- sunTop: '95%',
392
- label: 'Night'
393
- },
394
- morning: {
395
- top: '#FFD194',
396
- bottom: '#D1913C',
397
- sunColor: '#ffdb4d',
398
- sunTop: '20%',
399
- label: 'Morning'
400
- },
401
- afternoon: {
402
- top: '#56CCF2',
403
- bottom: '#2F80ED',
404
- sunColor: '#fff',
405
- sunTop: '50%',
406
- label: 'Afternoon'
407
- },
408
- evening: {
409
- top: '#2c3e50',
410
- bottom: '#fd746c',
411
- sunColor: '#ff6b6b',
412
- sunTop: '15%',
413
- label: 'Evening'
414
- }
415
- };
416
-
417
- // Initialize
418
- function init() {
419
- // Set slider to current hour
420
- timeSlider.value = currentHour;
421
- updateTimeTheme(currentHour);
422
- typeText(customMessageInput.value);
423
- }
424
-
425
- // Determine Theme based on Hour
426
- function updateTimeTheme(hour) {
427
- let themeKey = 'morning';
428
- if (hour >= 0 && hour < 5) themeKey = 'night';
429
- else if (hour >= 5 && hour < 12) themeKey = 'morning';
430
- else if (hour >= 12 && hour < 17) themeKey = 'afternoon';
431
- else if (hour >= 17 && hour < 21) themeKey = 'evening';
432
- else themeKey = 'night';
433
-
434
- const theme = themes[themeKey];
435
-
436
- // Apply styles to body
437
- document.body.style.background = `linear-gradient(to bottom, ${theme.top}, ${theme.bottom})`;
438
-
439
- // Apply styles to Sun
440
- sun.style.background = theme.sunColor;
441
- sun.style.boxShadow = `0 0 40px 10px ${theme.sunColor}80`; // 80 is hex opacity
442
- sun.style.top = theme.sunTop;
443
-
444
- // Update Label
445
- timeLabel.textContent = `${theme.label} - ${padTime(hour)}`;
446
-
447
- return themeKey;
448
- }
449
-
450
- // Typing Effect Function
451
- function typeText(text) {
452
- if (isTypingEffect) return;
453
- isTypingEffect = true;
454
-
455
- greetingText.textContent = '';
456
- let i = 0;
457
- const speed = 50; // ms per char
458
-
459
- function type() {
460
- if (i < text.length) {
461
- greetingText.textContent += text.charAt(i);
462
- i++;
463
- setTimeout(type, speed);
464
- } else {
465
- isTypingEffect = false;
466
- }
467
- }
468
- type();
469
- }
470
-
471
- // Helper: Pad time with leading zero
472
- function padTime(num) {
473
- return num.toString().padStart(2, '0');
474
- }
475
-
476
- // Show Toast Notification
477
- function showToast(message) {
478
- toast.querySelector('span').textContent = message;
479
- toast.classList.add('show');
480
- setTimeout(() => {
481
- toast.classList.remove('show');
482
- }, 3000);
483
- }
484
-
485
- // Event Listeners
486
-
487
- // 1. Slider Input (Real-time preview)
488
- timeSlider.addEventListener('input', (e) => {
489
- const hour = parseInt(e.target.value);
490
- updateTimeTheme(hour);
491
- });
492
-
493
- // 2. Update Button
494
- updateBtn.addEventListener('click', () => {
495
- const message = customMessageInput.value.trim() || "Hello World";
496
-
497
- // Trigger animation on button
498
- updateBtn.style.transform = "scale(0.95)";
499
- setTimeout(() => updateBtn.style.transform = "scale(1)", 100);
500
-
501
- // Re-render text
502
- typeText(message);
503
-
504
- // Show toast
505
- showToast(`Updated to: ${message}`);
506
- });
507
-
508
- // 3. Input Enter Key
509
- customMessageInput.addEventListener('keypress', (e) => {
510
- if (e.key === 'Enter') {
511
- updateBtn.click();
512
- }
513
- });
514
-
515
- // Run Init
516
- init();
517
- });
518
- </script>
519
- </body>
520
- </html>
 
1
+ **Important Note:** The `Remove-Item` command at the top is commented out to prevent errors if the file does not exist yet. If you want to force the cleanup, simply remove the `#` symbol at the beginning of that line.