-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
715 lines (649 loc) · 32.4 KB
/
index.html
File metadata and controls
715 lines (649 loc) · 32.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Character Hub - Caracteres Especiais Unicode</title>
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body>
<header class="header">
<nav class="navbar">
<div class="nav-container">
<div class="nav-logo">
<h1>Character Hub</h1>
</div>
<ul class="nav-menu">
<li class="nav-item">
<a href="#home" class="nav-link">Início</a>
</li>
<li class="nav-item">
<a href="#favorites-section" class="nav-link">Favoritos</a>
</li>
<li class="nav-item">
<a href="#characters" class="nav-link">Caracteres</a>
</li>
<li class="nav-item">
<a href="#about" class="nav-link">Sobre</a>
</li>
<li class="nav-item">
<a href="#contact" class="nav-link">Contato</a>
</li>
</ul>
<div class="nav-toggle" id="mobile-menu">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</div>
</div>
</nav>
</header>
<main>
<section id="home" class="hero">
<div class="hero-container">
<h1 class="hero-title">Character Hub</h1>
<p class="hero-subtitle">Explore o mundo fascinante dos caracteres especiais Unicode</p>
<div class="hero-buttons">
<div class="search-container">
<input type="text" id="searchInput" placeholder="Pesquisar caracteres..." class="search-input">
<button class="search-btn" onclick="performSearch()">
<i class="fas fa-search"></i>
</button>
</div>
<div class="hero-buttons-row">
<a href="#characters" class="btn btn-primary">Explorar Caracteres</a>
<a href="https://whatsapp.com/channel/0029VbByq5459PwQ2uEGbn0B" target="_blank" class="btn btn-secondary">
<i class="fab fa-whatsapp"></i> WhatsApp Channel
</a>
</div>
</div>
</div>
</section>
<section id="about" class="about">
<div class="container">
<h2 class="section-title">Sobre os Caracteres Especiais</h2>
<div class="about-content">
<div class="about-features">
<div class="feature-card">
<div class="feature-icon">
<i class="fas fa-copy"></i>
</div>
<div class="feature-content">
<h4>Copie e Cole</h4>
<p>Caracteres prontos para usar em qualquer plataforma</p>
</div>
</div>
<div class="feature-card">
<div class="feature-icon">
<i class="fas fa-code"></i>
</div>
<div class="feature-content">
<h4>Informações Técnicas</h4>
<p>Codificação completa e propriedades Unicode</p>
</div>
</div>
<div class="feature-card">
<div class="feature-icon">
<i class="fas fa-share-alt"></i>
</div>
<div class="feature-content">
<h4>Compatibilidade</h4>
<p>Funciona em WhatsApp, Threads e outras plataformas</p>
</div>
</div>
<div class="feature-card">
<div class="feature-icon">
<i class="fas fa-search"></i>
</div>
<div class="feature-content">
<h4>Busca Rápida</h4>
<p>Encontre caracteres instantaneamente com nossa pesquisa</p>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="characters" class="characters">
<div class="container">
<h2 class="section-title">Caracteres Disponíveis</h2>
<div class="character-grid">
<div class="character-card" onclick="openCharacter('U+007C')">
<div class="character-display">|</div>
<h3>Vertical Line</h3>
<p>U+007C</p>
<div class="card-actions">
<button class="btn btn-sm btn-primary" onclick="copyCharacter('|', event)">
<i class="fas fa-copy"></i> Copiar
</button>
<button class="btn btn-sm btn-secondary" onclick="shareCharacter('|', 'U+007C', event)">
<i class="fas fa-share-alt"></i> Compartilhar
</button>
<button class="btn btn-sm btn-favorite" data-char="|" onclick="toggleFavorite('|', 'Vertical Line', 'U+007C', 'U+007C', event)">
<i class="far fa-heart"></i>
</button>
</div>
</div>
<div class="character-card" onclick="openCharacter('U+1160')">
<div class="character-display">ㅤ</div>
<h3>Invisível Grande</h3>
<p>U+1160</p>
<div class="card-actions">
<button class="btn btn-sm btn-primary" onclick="copyCharacter('ㅤ', event)">
<i class="fas fa-copy"></i> Copiar
</button>
<button class="btn btn-sm btn-secondary" onclick="shareCharacter('ㅤ', 'U+1160', event)">
<i class="fas fa-share-alt"></i> Compartilhar
</button>
<button class="btn btn-sm btn-favorite" data-char="ㅤ" onclick="toggleFavorite('ㅤ', 'Invisível Grande', 'U+1160', 'U+1160', event)">
<i class="far fa-heart"></i>
</button>
</div>
</div>
<div class="character-card" onclick="openCharacter('U+2000')">
<div class="character-display"> </div>
<h3>Invisível Médio</h3>
<p>U+2000</p>
<div class="card-actions">
<button class="btn btn-sm btn-primary" onclick="copyCharacter(' ', event)">
<i class="fas fa-copy"></i> Copiar
</button>
<button class="btn btn-sm btn-secondary" onclick="shareCharacter(' ', 'U+2000', event)">
<i class="fas fa-share-alt"></i> Compartilhar
</button>
<button class="btn btn-sm btn-favorite" data-char=" " onclick="toggleFavorite(' ', 'Invisível Médio', 'U+2000', 'U+2000', event)">
<i class="far fa-heart"></i>
</button>
</div>
</div>
<div class="character-card" onclick="openCharacter('U+205F')">
<div class="character-display"> </div>
<h3>Invisível Pequeno</h3>
<p>U+205F</p>
<div class="card-actions">
<button class="btn btn-sm btn-primary" onclick="copyCharacter(' ', event)">
<i class="fas fa-copy"></i> Copiar
</button>
<button class="btn btn-sm btn-secondary" onclick="shareCharacter(' ', 'U+205F', event)">
<i class="fas fa-share-alt"></i> Compartilhar
</button>
<button class="btn btn-sm btn-favorite" data-char=" " onclick="toggleFavorite(' ', 'Invisível Pequeno', 'U+205F', 'U+205F', event)">
<i class="far fa-heart"></i>
</button>
</div>
</div>
<div class="character-card" onclick="openCharacter('U+1FAEA')">
<div class="character-display"></div>
<h3>Distorted Face</h3>
<p>U+1FAEA</p>
<div class="card-actions">
<button class="btn btn-sm btn-primary" onclick="copyCharacter('', event)">
<i class="fas fa-copy"></i> Copiar
</button>
<button class="btn btn-sm btn-secondary" onclick="shareCharacter('', 'U+1FAEA', event)">
<i class="fas fa-share-alt"></i> Compartilhar
</button>
<button class="btn btn-sm btn-favorite" data-char="" onclick="toggleFavorite('', 'Distorted Face', 'U+1FAEA', 'U+1FAEA', event)">
<i class="far fa-heart"></i>
</button>
</div>
</div>
<div class="character-card" onclick="openCharacter('U+1D54F')">
<div class="character-display">𝕏</div>
<h3>Mathematical Double-Struck X</h3>
<p>U+1D54F</p>
<div class="card-actions">
<button class="btn btn-sm btn-primary" onclick="copyCharacter('𝕏', event)">
<i class="fas fa-copy"></i> Copiar
</button>
<button class="btn btn-sm btn-secondary" onclick="shareCharacter('𝕏', 'U+1D54F', event)">
<i class="fas fa-share-alt"></i> Compartilhar
</button>
<button class="btn btn-sm btn-favorite" data-char="𝕏" onclick="toggleFavorite('𝕏', 'Mathematical Double-Struck X', 'U+1D54F', 'U+1D54F', event)">
<i class="far fa-heart"></i>
</button>
</div>
</div>
</div>
<div class="view-more-container">
<button class="btn btn-outline" onclick="window.location.href='character/explore.html'">
<i class="fas fa-th"></i> Ver Mais
</button>
</div>
<div class="special-combinations">
<h3>Combinações Especiais</h3>
<div class="combination-card" onclick="window.location.href='character/Super-Stack-Character.html'" style="cursor: pointer;">
<div class="combination-display">ธิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิ์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์</div>
<h4>Super Stack Character</h4>
<p>Combinação especial de caracteres tailandeses com diacríticos empilhados</p>
<button class="btn btn-primary" onclick="copyCharacter('ธิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิิ์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์์', event)">
<i class="fas fa-copy"></i> Copiar Combo
</button>
</div>
</div>
</div>
</section>
<section id="favorites-section" class="characters">
<div class="container">
<h2 class="section-title">Meus Favoritos</h2>
<div id="favorites-container" class="character-grid">
<!-- Os favoritos serão carregados aqui dinamicamente -->
</div>
</div>
</section>
<section id="contact" class="contact">
<div class="container">
<h2 class="section-title">Participe da Comunidade</h2>
<div class="contact-content">
<div class="contact-card">
<i class="fab fa-whatsapp"></i>
<h3>WhatsApp Channel</h3>
<p>Participe do nosso canal para mais caracteres e atualizações</p>
<a href="https://whatsapp.com/channel/0029VbByq5459PwQ2uEGbn0B" target="_blank" class="btn btn-primary">
Entrar no Canal
</a>
</div>
<div class="contact-card">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" style="width: 3rem; height: 3rem; margin-bottom: 1rem; fill: url(#gradient);"><defs><linearGradient id="gradient" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:#6366f1;stop-opacity:1" /><stop offset="100%" style="stop-color:#22d3ee;stop-opacity:1" /></linearGradient></defs><path d="M427.5 299.7C429.7 300.6 431.7 301.6 433.8 302.5C463 316.6 484.4 337.7 495.6 363.9C511.3 400.4 512.8 459.7 465.3 507.1C429.1 543.3 385 559.6 322.7 560.1L322.4 560.1C252.2 559.6 198.3 536 162 489.9C129.7 448.9 113.1 391.8 112.5 320.3L112.5 319.8C113 248.3 129.6 191.2 161.9 150.2C198.2 104.1 252.2 80.5 322.4 80L322.7 80C393 80.5 447.6 104 485 149.9C503.4 172.6 517 199.9 525.6 231.6L485.2 242.4C478.1 216.6 467.4 194.6 453 177C423.8 141.2 380 122.8 322.5 122.4C265.5 122.9 222.4 141.2 194.3 176.8C168.1 210.1 154.5 258.3 154 320C154.5 381.7 168.1 429.9 194.3 463.3C222.3 498.9 265.5 517.2 322.5 517.7C373.9 517.3 407.9 505.1 436.2 476.8C468.5 444.6 467.9 405 457.6 380.9C451.5 366.7 440.5 354.9 425.7 346C422 372.9 413.9 394.3 401 410.8C383.9 432.6 359.6 444.4 328.3 446.1C304.7 447.4 282 441.7 264.4 430.1C243.6 416.3 231.4 395.3 230.1 370.8C227.6 322.5 265.8 287.8 325.3 284.4C346.4 283.2 366.2 284.1 384.5 287.2C382.1 272.4 377.2 260.6 369.9 252C359.9 240.3 344.3 234.3 323.7 234.2L323 234.2C306.4 234.2 284 238.8 269.7 260.5L235.3 236.9C254.5 207.8 285.6 191.8 323.1 191.8L323.9 191.8C386.5 192.2 423.8 231.3 427.6 299.5L427.4 299.7L427.5 299.7zM271.5 368.5C272.8 393.6 299.9 405.3 326.1 403.8C351.7 402.4 380.7 392.4 385.6 330.6C372.4 327.7 357.8 326.2 342.2 326.2C337.4 326.2 332.6 326.3 327.8 326.6C284.9 329 270.6 349.8 271.6 368.4L271.5 368.5z"/></svg>
<h3>Sugestões</h3>
<p>Comente sugestão de Caractere</p>
<a href="https://www.threads.com/@erikraft.yt/post/DVwc_IYkSmw?xmt=AQF0SDeGgkODWgdir2VIiZhUeUDvpeQVQZTRDfboHhRoOg"
target="_blank" class="btn btn-primary">
Ver no Threads
</a>
</div>
</div>
</div>
</section>
</main>
<footer class="footer">
<div class="container">
<p>© 2026 Character Hub. Todos os direitos reservados.</p>
<p>Explorando o fascinante mundo dos caracteres Unicode</p>
<p style="margin-top: 1rem;">
<a href="https://github.com/erikraft/character/" target="_blank" style="color: rgba(255, 255, 255, 0.8); text-decoration: none; transition: color 0.3s ease;"
onmouseover="this.style.color='rgba(255, 255, 255, 1)'"
onmouseout="this.style.color='rgba(255, 255, 255, 0.8)'">
<i class="fab fa-github"></i> GitHub Repository
</a>
</p>
</div>
</footer>
<script src="script.js"></script>
<audio id="successSound" preload="auto">
<source src="media/success.mp3" type="audio/mpeg">
</audio>
<audio id="popUpSound" preload="auto">
<source src="media/pop-up.mp3" type="audio/mpeg">
</audio>
<audio id="errorSound" preload="auto">
<source src="media/error.mp3" type="audio/mpeg">
</audio>
<audio id="manyErrorsSound" preload="auto">
<source src="media/many_errors.mp3" type="audio/mpeg">
</audio>
<audio id="sharingSound" preload="auto">
<source src="media/sharing.mp3" type="audio/mpeg">
</audio>
<audio id="favoriteSound" preload="auto">
<source src="media/favorite.mp3" type="audio/mpeg">
</audio>
<!-- Pop-up Propaganda WhatsApp -->
<div id="whatsappPopup" class="popup-overlay" style="display: none;">
<div class="popup-content">
<div class="popup-header">
<h3>🔔 Participe do Nosso Canal!</h3>
<button class="popup-close" onclick="closeWhatsAppPopup()">×</button>
</div>
<div class="popup-body">
<p>Receba mais caracteres especiais e atualizações exclusivas no nosso WhatsApp Channel!</p>
<div class="popup-buttons">
<button class="btn btn-primary" onclick="openWhatsAppChannel()">
<i class="fab fa-whatsapp"></i> Acessar Canal
</button>
<button class="btn btn-secondary" onclick="closeWhatsAppPopup()">
<i class="fas fa-times"></i> Fechar
</button>
</div>
</div>
</div>
</div>
<script>
function playSuccessSound() {
const audio = document.getElementById('successSound');
if (audio) {
audio.currentTime = 0;
audio.play().catch(e => console.log('Audio play failed:', e));
}
}
function playPopUpSound() {
const audio = document.getElementById('popUpSound');
if (audio) {
audio.currentTime = 0;
audio.play().catch(e => console.log('Audio play failed:', e));
}
}
function playErrorSound() {
const audio = document.getElementById('errorSound');
if (audio) {
audio.currentTime = 0;
audio.play().catch(e => console.log('Audio play failed:', e));
}
}
function playManyErrorsSound() {
const audio = document.getElementById('manyErrorsSound');
if (audio) {
audio.currentTime = 0;
audio.play().catch(e => console.log('Audio play failed:', e));
}
}
function playSharingSound() {
const audio = document.getElementById('sharingSound');
if (audio) {
audio.currentTime = 0;
audio.play().catch(e => console.log('Audio play failed:', e));
}
}
function incrementErrorCount() {
errorCount++;
// Se houver muitos erros (5+), tocar o áudio de muitos erros (apenas uma vez)
if (errorCount >= 5) {
playManyErrorsSound();
} else {
// Para erros normais, tocar o áudio de erro simples (apenas uma vez)
playErrorSound();
}
}
function copyToClipboard(text) {
navigator.clipboard.writeText(text).then(() => {
playSuccessSound();
showToast('Código copiado!', 'success');
}).catch(() => {
// Apenas tocar áudio de erro se realmente houver falha na cópia
showToast('Erro ao copiar', 'error');
});
}
function copyCharacter(character, event) {
if (event) event.stopPropagation();
navigator.clipboard.writeText(character).then(() => {
playSuccessSound();
showToast('Caractere copiado com sucesso!', 'success');
}).catch(() => {
incrementErrorCount();
playErrorSound();
showToast('Erro ao copiar caractere', 'error');
});
}
function shareCharacter(character, code, event) {
if (event) event.stopPropagation();
playSharingSound();
const shareData = {
title: `Character Hub - ${code}`,
text: `Confira este caractere especial: ${character}`,
url: window.location.href
};
if (navigator.share) {
navigator.share(shareData);
} else {
navigator.clipboard.writeText(window.location.href);
showToast('Link copiado para compartilhar!', 'success');
}
}
// Add click handlers to all code pills
document.addEventListener('DOMContentLoaded', function() {
const codePills = document.querySelectorAll('.code-pill');
codePills.forEach(pill => {
pill.style.cursor = 'pointer';
pill.addEventListener('click', function() {
const text = this.textContent;
copyToClipboard(text);
});
});
});
// WhatsApp Popup functions
let popupShown = false;
function showWhatsAppPopup() {
if (!popupShown) {
const popup = document.getElementById('whatsappPopup');
popup.style.display = 'flex';
playPopUpSound();
popupShown = true;
// Salvar no localStorage que já foi mostrado
localStorage.setItem('whatsappPopupShown', 'true');
}
}
function closeWhatsAppPopup() {
const popup = document.getElementById('whatsappPopup');
popup.style.display = 'none';
}
function openWhatsAppChannel() {
window.open('https://www.whatsapp.com/channel/0029VbByq5459PwQ2uEGbn0B', '_blank');
closeWhatsAppPopup();
}
// Mostrar pop-up apenas 1 vez
document.addEventListener('DOMContentLoaded', function() {
const popupShown = localStorage.getItem('whatsappPopupShown');
if (!popupShown) {
// Mostrar após 3 segundos na página
setTimeout(showWhatsAppPopup, 3000);
}
});
function windowFavoritesSync(e) {
if (e.key === 'characterFavorites') {
renderFavorites();
updateFavoriteButtons();
}
}
window.addEventListener('storage', windowFavoritesSync);
function loadFavorites() {
const f = localStorage.getItem('characterFavorites');
if (!f) return [];
try {
let parsed = JSON.parse(f);
let updated = false;
parsed = parsed.map(item => {
if (item.character && !item.char) {
updated = true;
return {
char: item.character,
name: item.name || '',
code: item.unicode || item.code || '',
page: item.unicode || item.page || item.code || ''
};
}
return item;
});
if (updated) localStorage.setItem('characterFavorites', JSON.stringify(parsed));
return parsed;
} catch (e) {
return [];
}
}
function toggleFavorite(char, name, code, page, event) {
if (event) event.stopPropagation();
let favorites = loadFavorites();
const exists = favorites.find(f => f.char === char);
if (exists) {
// Remover dos favoritos
favorites = favorites.filter(f => f.char !== char);
localStorage.setItem('characterFavorites', JSON.stringify(favorites));
renderFavorites();
updateFavoriteButtons();
} else {
// Adicionar aos favoritos
favorites.push({
char: char,
name: name,
code: code,
page: page || code
});
localStorage.setItem('characterFavorites', JSON.stringify(favorites));
const sound = document.getElementById("favoriteSound");
if (sound) {
sound.currentTime = 0;
sound.play().catch(e => console.log('Audio play failed:', e));
}
renderFavorites();
updateFavoriteButtons();
}
}
function updateFavoriteButtons() {
const favorites = loadFavorites();
document.querySelectorAll(".btn-favorite").forEach(btn => {
const char = btn.dataset.char;
const isFav = favorites.find(f => f.char === char);
if (isFav) {
btn.innerHTML = '<i class="fas fa-heart"></i>';
btn.classList.add('favorited');
} else {
btn.innerHTML = '<i class="far fa-heart"></i>';
btn.classList.remove('favorited');
}
});
}
function renderFavorites() {
const favoritesContainer = document.getElementById('favorites-container');
// Verificar se o elemento existe antes de tentar usar
if (!favoritesContainer) {
console.warn('Elemento #favorites-container não encontrado');
return;
}
const favorites = loadFavorites();
if (favorites.length === 0) {
favoritesContainer.innerHTML = `
<div style="grid-column: 1 / -1; text-align: center; padding: 3rem;">
<i class="fas fa-heart" style="font-size: 3rem; color: var(--text-secondary); margin-bottom: 1rem;"></i>
<h3 style="color: var(--text-secondary); margin-bottom: 0.5rem;">Nenhum favorito ainda</h3>
<p style="color: var(--text-secondary);">Adicione caracteres aos seus favoritos para vê-los aqui!</p>
</div>
`;
} else {
favoritesContainer.innerHTML = favorites.map(fav => `
<div class="character-card" onclick="openCharacter('${fav.page}')">
<div class="character-display">${fav.char}</div>
<h3>${fav.name}</h3>
<p>${fav.code}</p>
<div class="card-actions">
<button class="btn btn-sm btn-primary" onclick="copyCharacter('${fav.char}', event)">
<i class="fas fa-copy"></i> Copiar
</button>
<button class="btn btn-sm btn-secondary" onclick="shareCharacter('${fav.char}', '${fav.code}', event)">
<i class="fas fa-share-alt"></i> Compartilhar
</button>
<button class="btn btn-sm btn-favorite" data-char="${fav.char}" onclick="toggleFavorite('${fav.char}','${fav.name}','${fav.code}','${fav.page}',event)">
<i class="fas fa-heart"></i>
</button>
</div>
</div>
`).join('');
}
}
function removeFavorite(char, name, code, page, event) {
if (event) event.stopPropagation();
const favorites = loadFavorites();
const updatedFavorites = favorites.filter(fav => fav.char !== char);
localStorage.setItem('characterFavorites', JSON.stringify(updatedFavorites));
playErrorSound();
showToast('Removido dos favoritos', 'success');
renderFavorites();
}
// Carregar favoritos quando a página carregar
document.addEventListener('DOMContentLoaded', function() {
renderFavorites();
updateFavoriteButtons();
});
</script>
<style>
.popup-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
display: flex;
justify-content: center;
align-items: center;
z-index: 10000;
animation: fadeIn 0.3s ease;
}
.popup-content {
background: white;
border-radius: 1rem;
padding: 0;
max-width: 400px;
width: 90%;
box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
animation: slideUp 0.3s ease;
}
.popup-header {
background: linear-gradient(135deg, #25D366, #128C7E);
color: white;
padding: 1.5rem;
border-radius: 1rem 1rem 0 0;
display: flex;
justify-content: space-between;
align-items: center;
}
.popup-header h3 {
margin: 0;
font-size: 1.2rem;
font-weight: 600;
}
.popup-close {
background: none;
border: none;
color: white;
font-size: 1.5rem;
cursor: pointer;
padding: 0;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
transition: background 0.3s ease;
}
.popup-close:hover {
background: rgba(255, 255, 255, 0.2);
}
.popup-body {
padding: 2rem 1.5rem;
text-align: center;
}
.popup-body p {
margin-bottom: 1.5rem;
color: #374151;
line-height: 1.6;
}
.popup-buttons {
display: flex;
gap: 1rem;
justify-content: center;
}
.popup-buttons .btn {
flex: 1;
padding: 0.75rem 1rem;
font-size: 0.9rem;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
</style>
</body>
</html>