Elias207 commited on
Commit
8e70013
·
verified ·
1 Parent(s): 7fcd646

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +746 -19
index.html CHANGED
@@ -1,19 +1,746 @@
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" dir="ltr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Global Greetings - Interactive Language Experience</title>
7
+
8
+ <!-- Font Awesome for icons -->
9
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
10
+
11
+ <!-- Google Fonts -->
12
+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&family=Noto+Sans+Arabic:wght@400;700&family=Noto+Sans:wght@400;600&display=swap" rel="stylesheet">
13
+
14
+ <style>
15
+ * {
16
+ margin: 0;
17
+ padding: 0;
18
+ box-sizing: border-box;
19
+ }
20
+
21
+ :root {
22
+ --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
23
+ --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
24
+ --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
25
+ --dark-bg: #0f0f1e;
26
+ --light-bg: #ffffff;
27
+ --text-dark: #2d3748;
28
+ --text-light: #ffffff;
29
+ --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
30
+ --hover-transform: translateY(-5px);
31
+ }
32
+
33
+ body {
34
+ font-family: 'Poppins', 'Noto Sans', sans-serif;
35
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
36
+ min-height: 100vh;
37
+ overflow-x: hidden;
38
+ position: relative;
39
+ }
40
+
41
+ /* Animated background particles */
42
+ .particles {
43
+ position: fixed;
44
+ top: 0;
45
+ left: 0;
46
+ width: 100%;
47
+ height: 100%;
48
+ overflow: hidden;
49
+ z-index: 0;
50
+ }
51
+
52
+ .particle {
53
+ position: absolute;
54
+ background: rgba(255, 255, 255, 0.1);
55
+ border-radius: 50%;
56
+ animation: float 20s infinite;
57
+ }
58
+
59
+ @keyframes float {
60
+ 0%, 100% {
61
+ transform: translateY(0) translateX(0) scale(1);
62
+ opacity: 0;
63
+ }
64
+ 10% {
65
+ opacity: 0.4;
66
+ }
67
+ 90% {
68
+ opacity: 0.4;
69
+ }
70
+ 100% {
71
+ transform: translateY(-100vh) translateX(100px) scale(0.5);
72
+ opacity: 0;
73
+ }
74
+ }
75
+
76
+ /* Header */
77
+ header {
78
+ position: relative;
79
+ z-index: 100;
80
+ padding: 1.5rem 2rem;
81
+ background: rgba(255, 255, 255, 0.1);
82
+ backdrop-filter: blur(10px);
83
+ border-bottom: 1px solid rgba(255, 255, 255, 0.2);
84
+ }
85
+
86
+ nav {
87
+ display: flex;
88
+ justify-content: space-between;
89
+ align-items: center;
90
+ max-width: 1400px;
91
+ margin: 0 auto;
92
+ }
93
+
94
+ .logo {
95
+ font-size: 1.5rem;
96
+ font-weight: 700;
97
+ color: var(--text-light);
98
+ text-decoration: none;
99
+ transition: transform 0.3s ease;
100
+ }
101
+
102
+ .logo:hover {
103
+ transform: scale(1.05);
104
+ }
105
+
106
+ .nav-links {
107
+ display: flex;
108
+ gap: 2rem;
109
+ list-style: none;
110
+ }
111
+
112
+ .nav-links a {
113
+ color: var(--text-light);
114
+ text-decoration: none;
115
+ transition: all 0.3s ease;
116
+ position: relative;
117
+ padding: 0.5rem 1rem;
118
+ border-radius: 8px;
119
+ }
120
+
121
+ .nav-links a:hover {
122
+ background: rgba(255, 255, 255, 0.2);
123
+ transform: translateY(-2px);
124
+ }
125
+
126
+ /* Main Container */
127
+ .container {
128
+ position: relative;
129
+ z-index: 10;
130
+ max-width: 1400px;
131
+ margin: 0 auto;
132
+ padding: 2rem;
133
+ }
134
+
135
+ /* Hero Section */
136
+ .hero {
137
+ text-align: center;
138
+ padding: 4rem 0;
139
+ animation: fadeInUp 1s ease;
140
+ }
141
+
142
+ @keyframes fadeInUp {
143
+ from {
144
+ opacity: 0;
145
+ transform: translateY(30px);
146
+ }
147
+ to {
148
+ opacity: 1;
149
+ transform: translateY(0);
150
+ }
151
+ }
152
+
153
+ .main-greeting {
154
+ font-size: clamp(3rem, 8vw, 6rem);
155
+ font-weight: 700;
156
+ background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
157
+ -webkit-background-clip: text;
158
+ -webkit-text-fill-color: transparent;
159
+ background-clip: text;
160
+ margin-bottom: 1rem;
161
+ animation: pulse 2s ease infinite;
162
+ }
163
+
164
+ .arabic-greeting {
165
+ font-family: 'Noto Sans Arabic', sans-serif;
166
+ font-size: clamp(4rem, 10vw, 7rem);
167
+ direction: rtl;
168
+ background: linear-gradient(135deg, #ffd700 0%, #ffed4b 100%);
169
+ -webkit-background-clip: text;
170
+ -webkit-text-fill-color: transparent;
171
+ background-clip: text;
172
+ margin: 2rem 0;
173
+ animation: slideInRight 1s ease;
174
+ }
175
+
176
+ @keyframes pulse {
177
+ 0%, 100% {
178
+ transform: scale(1);
179
+ }
180
+ 50% {
181
+ transform: scale(1.05);
182
+ }
183
+ }
184
+
185
+ @keyframes slideInRight {
186
+ from {
187
+ opacity: 0;
188
+ transform: translateX(-50px);
189
+ }
190
+ to {
191
+ opacity: 1;
192
+ transform: translateX(0);
193
+ }
194
+ }
195
+
196
+ .subtitle {
197
+ color: rgba(255, 255, 255, 0.9);
198
+ font-size: 1.5rem;
199
+ margin-bottom: 2rem;
200
+ }
201
+
202
+ /* Language Cards Grid */
203
+ .language-grid {
204
+ display: grid;
205
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
206
+ gap: 2rem;
207
+ margin: 4rem 0;
208
+ }
209
+
210
+ .language-card {
211
+ background: rgba(255, 255, 255, 0.95);
212
+ border-radius: 20px;
213
+ padding: 2rem;
214
+ box-shadow: var(--card-shadow);
215
+ transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
216
+ cursor: pointer;
217
+ position: relative;
218
+ overflow: hidden;
219
+ }
220
+
221
+ .language-card::before {
222
+ content: '';
223
+ position: absolute;
224
+ top: 0;
225
+ left: 0;
226
+ width: 100%;
227
+ height: 4px;
228
+ background: var(--primary-gradient);
229
+ transform: scaleX(0);
230
+ transition: transform 0.3s ease;
231
+ }
232
+
233
+ .language-card:hover::before {
234
+ transform: scaleX(1);
235
+ }
236
+
237
+ .language-card:hover {
238
+ transform: var(--hover-transform);
239
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
240
+ }
241
+
242
+ .greeting-text {
243
+ font-size: 2.5rem;
244
+ margin-bottom: 1rem;
245
+ background: var(--primary-gradient);
246
+ -webkit-background-clip: text;
247
+ -webkit-text-fill-color: transparent;
248
+ background-clip: text;
249
+ }
250
+
251
+ .language-name {
252
+ font-size: 1.2rem;
253
+ color: var(--text-dark);
254
+ margin-bottom: 0.5rem;
255
+ font-weight: 600;
256
+ }
257
+
258
+ .language-translation {
259
+ color: #718096;
260
+ font-size: 0.9rem;
261
+ }
262
+
263
+ .play-button {
264
+ position: absolute;
265
+ top: 1rem;
266
+ right: 1rem;
267
+ background: var(--accent-gradient);
268
+ border: none;
269
+ width: 40px;
270
+ height: 40px;
271
+ border-radius: 50%;
272
+ color: white;
273
+ cursor: pointer;
274
+ transition: all 0.3s ease;
275
+ display: flex;
276
+ align-items: center;
277
+ justify-content: center;
278
+ }
279
+
280
+ .play-button:hover {
281
+ transform: scale(1.1) rotate(10deg);
282
+ }
283
+
284
+ /* Interactive Section */
285
+ .interactive-section {
286
+ background: rgba(255, 255, 255, 0.1);
287
+ backdrop-filter: blur(10px);
288
+ border-radius: 30px;
289
+ padding: 3rem;
290
+ margin: 4rem 0;
291
+ text-align: center;
292
+ }
293
+
294
+ .input-group {
295
+ display: flex;
296
+ gap: 1rem;
297
+ max-width: 600px;
298
+ margin: 2rem auto;
299
+ flex-wrap: wrap;
300
+ justify-content: center;
301
+ }
302
+
303
+ .name-input {
304
+ flex: 1;
305
+ min-width: 250px;
306
+ padding: 1rem 1.5rem;
307
+ border: 2px solid rgba(255, 255, 255, 0.3);
308
+ border-radius: 15px;
309
+ background: rgba(255, 255, 255, 0.1);
310
+ color: white;
311
+ font-size: 1rem;
312
+ transition: all 0.3s ease;
313
+ }
314
+
315
+ .name-input::placeholder {
316
+ color: rgba(255, 255, 255, 0.7);
317
+ }
318
+
319
+ .name-input:focus {
320
+ outline: none;
321
+ border-color: white;
322
+ background: rgba(255, 255, 255, 0.2);
323
+ transform: scale(1.02);
324
+ }
325
+
326
+ .greet-btn {
327
+ padding: 1rem 2rem;
328
+ background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
329
+ border: none;
330
+ border-radius: 15px;
331
+ color: white;
332
+ font-size: 1rem;
333
+ font-weight: 600;
334
+ cursor: pointer;
335
+ transition: all 0.3s ease;
336
+ }
337
+
338
+ .greet-btn:hover {
339
+ transform: translateY(-3px);
340
+ box-shadow: 0 10px 30px rgba(240, 147, 251, 0.4);
341
+ }
342
+
343
+ .personalized-greeting {
344
+ margin-top: 2rem;
345
+ padding: 2rem;
346
+ background: rgba(255, 255, 255, 0.15);
347
+ border-radius: 20px;
348
+ min-height: 100px;
349
+ display: flex;
350
+ align-items: center;
351
+ justify-content: center;
352
+ font-size: 1.5rem;
353
+ color: white;
354
+ opacity: 0;
355
+ transform: scale(0.9);
356
+ transition: all 0.5s ease;
357
+ }
358
+
359
+ .personalized-greeting.active {
360
+ opacity: 1;
361
+ transform: scale(1);
362
+ }
363
+
364
+ /* Footer */
365
+ footer {
366
+ position: relative;
367
+ z-index: 10;
368
+ background: rgba(0, 0, 0, 0.2);
369
+ backdrop-filter: blur(10px);
370
+ padding: 2rem;
371
+ text-align: center;
372
+ color: white;
373
+ margin-top: 4rem;
374
+ }
375
+
376
+ .footer-links {
377
+ display: flex;
378
+ justify-content: center;
379
+ gap: 2rem;
380
+ margin-top: 1rem;
381
+ flex-wrap: wrap;
382
+ }
383
+
384
+ .footer-links a {
385
+ color: white;
386
+ text-decoration: none;
387
+ transition: all 0.3s ease;
388
+ }
389
+
390
+ .footer-links a:hover {
391
+ color: #ffd700;
392
+ transform: translateY(-2px);
393
+ }
394
+
395
+ /* Responsive Design */
396
+ @media (max-width: 768px) {
397
+ .nav-links {
398
+ display: none;
399
+ }
400
+
401
+ .language-grid {
402
+ grid-template-columns: 1fr;
403
+ }
404
+
405
+ .hero {
406
+ padding: 2rem 0;
407
+ }
408
+ }
409
+
410
+ /* Loading Animation */
411
+ .loader {
412
+ width: 50px;
413
+ height: 50px;
414
+ border: 3px solid rgba(255, 255, 255, 0.3);
415
+ border-top-color: white;
416
+ border-radius: 50%;
417
+ animation: spin 1s linear infinite;
418
+ margin: 0 auto;
419
+ }
420
+
421
+ @keyframes spin {
422
+ to { transform: rotate(360deg); }
423
+ }
424
+ </style>
425
+ </head>
426
+ <body>
427
+ <!-- Animated Particles Background -->
428
+ <div class="particles" id="particles"></div>
429
+
430
+ <!-- Header -->
431
+ <header>
432
+ <nav>
433
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" class="logo" target="_blank">
434
+ <i class="fas fa-globe"></i> Global Greetings
435
+ <br><small style="font-size: 0.5rem; opacity: 0.8;">Built with anycoder</small>
436
+ </a>
437
+ <ul class="nav-links">
438
+ <li><a href="#home">Home</a></li>
439
+ <li><a href="#languages">Languages</a></li>
440
+ <li><a href="#interactive">Interactive</a></li>
441
+ <li><a href="#about">About</a></li>
442
+ </ul>
443
+ </nav>
444
+ </header>
445
+
446
+ <!-- Main Container -->
447
+ <div class="container">
448
+ <!-- Hero Section -->
449
+ <section class="hero" id="home">
450
+ <h1 class="main-greeting">Hello World!</h1>
451
+ <h2 class="arabic-greeting">سلام</h2>
452
+ <p class="subtitle">Discover greetings from around the world</p>
453
+ </section>
454
+
455
+ <!-- Language Cards Grid -->
456
+ <section id="languages">
457
+ <div class="language-grid">
458
+ <div class="language-card" data-lang="arabic">
459
+ <button class="play-button" onclick="playSound('arabic')">
460
+ <i class="fas fa-play"></i>
461
+ </button>
462
+ <div class="greeting-text" style="font-family: 'Noto Sans Arabic', sans-serif; direction: rtl;">سلام</div>
463
+ <div class="language-name">Arabic</div>
464
+ <div class="language-translation">Peace / Hello</div>
465
+ </div>
466
+
467
+ <div class="language-card" data-lang="spanish">
468
+ <button class="play-button" onclick="playSound('spanish')">
469
+ <i class="fas fa-play"></i>
470
+ </button>
471
+ <div class="greeting-text">¡Hola!</div>
472
+ <div class="language-name">Spanish</div>
473
+ <div class="language-translation">Hello!</div>
474
+ </div>
475
+
476
+ <div class="language-card" data-lang="french">
477
+ <button class="play-button" onclick="playSound('french')">
478
+ <i class="fas fa-play"></i>
479
+ </button>
480
+ <div class="greeting-text">Bonjour</div>
481
+ <div class="language-name">French</div>
482
+ <div class="language-translation">Good day / Hello</div>
483
+ </div>
484
+
485
+ <div class="language-card" data-lang="japanese">
486
+ <button class="play-button" onclick="playSound('japanese')">
487
+ <i class="fas fa-play"></i>
488
+ </button>
489
+ <div class="greeting-text">こんにちは</div>
490
+ <div class="language-name">Japanese</div>
491
+ <div class="language-translation">Hello / Good day</div>
492
+ </div>
493
+
494
+ <div class="language-card" data-lang="chinese">
495
+ <button class="play-button" onclick="playSound('chinese')">
496
+ <i class="fas fa-play"></i>
497
+ </button>
498
+ <div class="greeting-text">你好</div>
499
+ <div class="language-name">Chinese (Mandarin)</div>
500
+ <div class="language-translation">Hello</div>
501
+ </div>
502
+
503
+ <div class="language-card" data-lang="hindi">
504
+ <button class="play-button" onclick="playSound('hindi')">
505
+ <i class="fas fa-play"></i>
506
+ </button>
507
+ <div class="greeting-text">नमस्ते</div>
508
+ <div class="language-name">Hindi</div>
509
+ <div class="language-translation">Greetings / Hello</div>
510
+ </div>
511
+
512
+ <div class="language-card" data-lang="russian">
513
+ <button class="play-button" onclick="playSound('russian')">
514
+ <i class="fas fa-play"></i>
515
+ </button>
516
+ <div class="greeting-text">Привет</div>
517
+ <div class="language-name">Russian</div>
518
+ <div class="language-translation">Hi / Hello</div>
519
+ </div>
520
+
521
+ <div class="language-card" data-lang="german">
522
+ <button class="play-button" onclick="playSound('german')">
523
+ <i class="fas fa-play"></i>
524
+ </button>
525
+ <div class="greeting-text">Hallo</div>
526
+ <div class="language-name">German</div>
527
+ <div class="language-translation">Hello</div>
528
+ </div>
529
+
530
+ <div class="language-card" data-lang="portuguese">
531
+ <button class="play-button" onclick="playSound('portuguese')">
532
+ <i class="fas fa-play"></i>
533
+ </button>
534
+ <div class="greeting-text">Olá</div>
535
+ <div class="language-name">Portuguese</div>
536
+ <div class="language-translation">Hello</div>
537
+ </div>
538
+ </div>
539
+ </section>
540
+
541
+ <!-- Interactive Section -->
542
+ <section class="interactive-section" id="interactive">
543
+ <h2 style="color: white; font-size: 2rem; margin-bottom: 1rem;">Personalize Your Greeting</h2>
544
+ <p style="color: rgba(255, 255, 255, 0.9); margin-bottom: 2rem;">Enter your name and get greeted in different languages!</p>
545
+
546
+ <div class="input-group">
547
+ <input type="text" class="name-input" id="nameInput" placeholder="Enter your name...">
548
+ <button class="greet-btn" onclick="generateGreeting()">
549
+ <i class="fas fa-magic"></i> Generate Greetings
550
+ </button>
551
+ </div>
552
+
553
+ <div class="personalized-greeting" id="personalizedGreeting">
554
+ Your personalized greetings will appear here...
555
+ </div>
556
+ </section>
557
+ </div>
558
+
559
+ <!-- Footer -->
560
+ <footer>
561
+ <p>&copy; 2024 Global Greetings. Connecting the world through language.</p>
562
+ <div class="footer-links">
563
+ <a href="#"><i class="fab fa-github"></i> GitHub</a>
564
+ <a href="#"><i class="fab fa-twitter"></i> Twitter</a>
565
+ <a href="#"><i class="fab fa-linkedin"></i> LinkedIn</a>
566
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">
567
+ <i class="fas fa-code"></i> Built with anycoder
568
+ </a>
569
+ </div>
570
+ </footer>
571
+
572
+ <script>
573
+ // Create animated particles
574
+ function createParticles() {
575
+ const particlesContainer = document.getElementById('particles');
576
+ const particleCount = 30;
577
+
578
+ for (let i = 0; i < particleCount; i++) {
579
+ const particle = document.createElement('div');
580
+ particle.className = 'particle';
581
+ particle.style.left = Math.random() * 100 + '%';
582
+ particle.style.animationDelay = Math.random() * 20 + 's';
583
+ particle.style.width = Math.random() * 20 + 10 + 'px';
584
+ particle.style.height = particle.style.width;
585
+ particlesContainer.appendChild(particle);
586
+ }
587
+ }
588
+
589
+ // Initialize particles on load
590
+ createParticles();
591
+
592
+ // Language data for personalized greetings
593
+ const greetings = {
594
+ arabic: { text: 'سلام', translation: 'Salam', family: 'Noto Sans Arabic', dir: 'rtl' },
595
+ spanish: { text: '¡Hola!', translation: 'Hola', family: 'Poppins', dir: 'ltr' },
596
+ french: { text: 'Bonjour', translation: 'Bonjour', family: 'Poppins', dir: 'ltr' },
597
+ japanese: { text: 'こんにちは', translation: 'Konnichiwa', family: 'Poppins', dir: 'ltr' },
598
+ chinese: { text: '你好', translation: 'Nǐ hǎo', family: 'Poppins', dir: 'ltr' },
599
+ hindi: { text: 'नमस्ते', translation: 'Namaste', family: 'Poppins', dir: 'ltr' },
600
+ russian: { text: 'Привет', translation: 'Privet', family: 'Poppins', dir: 'ltr' },
601
+ german: { text: 'Hallo', translation: 'Hallo', family: 'Poppins', dir: 'ltr' },
602
+ portuguese: { text: 'Olá', translation: 'Olá', family: 'Poppins', dir: 'ltr' }
603
+ };
604
+
605
+ // Generate personalized greeting
606
+ function generateGreeting() {
607
+ const nameInput = document.getElementById('nameInput');
608
+ const greetingDiv = document.getElementById('personalizedGreeting');
609
+ const name = nameInput.value.trim();
610
+
611
+ if (!name) {
612
+ greetingDiv.textContent = 'Please enter your name first!';
613
+ greetingDiv.classList.add('active');
614
+ return;
615
+ }
616
+
617
+ // Select random greetings
618
+ const languages = Object.keys(greetings);
619
+ const selectedLanguages = [];
620
+ const numGreetings = 3;
621
+
622
+ for (let i = 0; i < numGreetings && i < languages.length; i++) {
623
+ const randomIndex = Math.floor(Math.random() * languages.length);
624
+ const lang = languages[randomIndex];
625
+ if (!selectedLanguages.includes(lang)) {
626
+ selectedLanguages.push(lang);
627
+ }
628
+ }
629
+
630
+ // Create greeting HTML
631
+ let greetingHTML = '<div style="text-align: center;">';
632
+ greetingHTML += `<p style="font-size: 1.2rem; margin-bottom: 1rem;">Hello ${name}! Here's how to greet you in different languages:</p>`;
633
+
634
+ selectedLanguages.forEach(lang => {
635
+ const greeting = greetings[lang];
636
+ greetingHTML += `
637
+ <div style="margin: 1rem 0; padding: 1rem; background: rgba(255, 255, 255, 0.1); border-radius: 10px;">
638
+ <span style="font-family: '${greeting.family}'; font-size: 1.8rem; font-weight: bold; direction: ${greeting.dir}; display: block;">
639
+ ${greeting.text}, ${name}!
640
+ </span>
641
+ <span style="font-size: 1rem; opacity: 0.8;">(${greeting.translation})</span>
642
+ </div>
643
+ `;
644
+ });
645
+
646
+ greetingHTML += '</div>';
647
+
648
+ greetingDiv.innerHTML = greetingHTML;
649
+ greetingDiv.classList.add('active');
650
+ }
651
+
652
+ // Play sound simulation (visual feedback)
653
+ function playSound(language) {
654
+ const button = event.currentTarget;
655
+ const icon = button.querySelector('i');
656
+
657
+ // Animate button
658
+ button.style.transform = 'scale(1.2) rotate(360deg)';
659
+ icon.className = 'fas fa-volume-up';
660
+
661
+ setTimeout(() => {
662
+ button.style.transform = 'scale(1)';
663
+ icon.className = 'fas fa-play';
664
+ }, 500);
665
+
666
+ // Create a subtle notification
667
+ showNotification(`Playing pronunciation for ${language.charAt(0).toUpperCase() + language.slice(1)}`);
668
+ }
669
+
670
+ // Show notification
671
+ function showNotification(message) {
672
+ const notification = document.createElement('div');
673
+ notification.style.cssText = `
674
+ position: fixed;
675
+ top: 20px;
676
+ right: 20px;
677
+ background: rgba(255, 255, 255, 0.95);
678
+ color: #333;
679
+ padding: 1rem 1.5rem;
680
+ border-radius: 10px;
681
+ box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
682
+ z-index: 1000;
683
+ animation: slideInRight 0.3s ease;
684
+ `;
685
+ notification.textContent = message;
686
+ document.body.appendChild(notification);
687
+
688
+ setTimeout(() => {
689
+ notification.style.animation = 'fadeOut 0.3s ease';
690
+ setTimeout(() => notification.remove(), 300);
691
+ }, 2000);
692
+ }
693
+
694
+ // Add smooth scrolling
695
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
696
+ anchor.addEventListener('click', function (e) {
697
+ e.preventDefault();
698
+ const target = document.querySelector(this.getAttribute('href'));
699
+ if (target) {
700
+ target.scrollIntoView({
701
+ behavior: 'smooth',
702
+ block: 'start'
703
+ });
704
+ }
705
+ });
706
+ });
707
+
708
+ // Add animation on scroll
709
+ const observerOptions = {
710
+ threshold: 0.1,
711
+ rootMargin: '0px 0px -50px 0px'
712
+ };
713
+
714
+ const observer = new IntersectionObserver((entries) => {
715
+ entries.forEach(entry => {
716
+ if (entry.isIntersecting) {
717
+ entry.target.style.animation = 'fadeInUp 0.6s ease forwards';
718
+ }
719
+ });
720
+ }, observerOptions);
721
+
722
+ // Observe all language cards
723
+ document.querySelectorAll('.language-card').forEach(card => {
724
+ observer.observe(card);
725
+ });
726
+
727
+ // Add keyboard support for Enter key
728
+ document.getElementById('nameInput').addEventListener('keypress', function(e) {
729
+ if (e.key === 'Enter') {
730
+ generateGreeting();
731
+ }
732
+ });
733
+
734
+ // Add hover effect to language cards
735
+ document.querySelectorAll('.language-card').forEach(card => {
736
+ card.addEventListener('mouseenter', function() {
737
+ this.style.background = 'linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 240, 255, 0.95) 100%)';
738
+ });
739
+
740
+ card.addEventListener('mouseleave', function() {
741
+ this.style.background = 'rgba(255, 255, 255, 0.95)';
742
+ });
743
+ });
744
+ </script>
745
+ </body>
746
+ </html>