|
1 | 1 | <div class="flex items-center gap-3 md:gap-4"> |
2 | 2 | {% if page.url == "/" %} |
3 | | - <button data-action="scroll-to-random" class="surprise-btn bg-blue-600 text-white px-8 py-3 rounded-full font-black uppercase tracking-widest transition-all active:scale-95 shadow-lg shadow-blue-500/30"> |
| 3 | + <button onclick="scrollToRandomUser()" class="surprise-btn bg-blue-600 text-white px-8 py-3 rounded-full font-black uppercase tracking-widest transition-all active:scale-95 shadow-lg shadow-blue-500/30"> |
4 | 4 | ✨ Surprise Me |
5 | 5 | </button> |
6 | 6 | {% endif %} |
7 | 7 |
|
8 | 8 | <div id="game-stats" class="flex items-center gap-3 md:gap-4 px-3 py-1.5 md:px-4 md:py-2 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-2xl shadow-sm"> |
9 | 9 |
|
10 | | - <div id="level-badge" data-action="level-click" class="w-8 h-8 md:w-10 md:h-10 flex items-center justify-center rounded-xl text-lg md:text-xl bg-black/5 dark:bg-white/5 relative cursor-pointer hover:bg-black/10 dark:hover:bg-white/10 transition-colors"> |
| 10 | + <div id="level-badge" onclick="handleLevelClick()" class="w-8 h-8 md:w-10 md:h-10 flex items-center justify-center rounded-xl text-lg md:text-xl bg-black/5 dark:bg-white/5 relative cursor-pointer hover:bg-black/10 dark:hover:bg-white/10 transition-colors"> |
11 | 11 | 🐣 |
12 | 12 | </div> |
13 | 13 |
|
14 | 14 | <div class="hidden sm:flex flex-col"> |
15 | 15 | <div class="flex items-center gap-2"> |
| 16 | + |
16 | 17 | <div class="relative group"> |
17 | 18 | <span id="level-name" class="text-[9px] md:text-[10px] font-black uppercase tracking-widest text-[var(--text-main)] cursor-help hover:text-accent transition-colors"> |
18 | 19 | Newbie |
19 | 20 | </span> |
| 21 | + |
20 | 22 | <div id="level-tooltip" class="absolute top-full left-0 mt-2 w-56 p-3 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-xl shadow-xl opacity-0 scale-95 -translate-y-2 pointer-events-none transition-all duration-200 group-hover:opacity-100 group-hover:scale-100 group-hover:translate-y-0 z-50"> |
21 | 23 | <div id="tooltip-rarity" class="text-[7px] font-black uppercase tracking-tighter px-1.5 py-0.5 rounded mb-1.5 inline-block bg-accent/10 text-accent border border-current/20">Common</div> |
22 | 24 | <p id="tooltip-desc" class="text-[10px] leading-relaxed text-[var(--text-main)] opacity-70 italic">Just starting your cosmic journey.</p> |
23 | 25 | <div class="absolute -top-1 left-4 w-2 h-2 bg-[var(--bg-card)] border-l border-t border-[var(--border-color)] rotate-45"></div> |
24 | 26 | </div> |
25 | 27 | </div> |
| 28 | + |
26 | 29 | <span class="text-[8px] font-mono font-bold text-accent bg-accent/10 px-1.5 py-0.5 rounded"> |
27 | 30 | XP: <span id="total-xp-display">0 / 45</span> |
28 | 31 | </span> |
| 32 | + |
29 | 33 | <div class="relative group"> |
30 | 34 | <span class="text-[8px] md:text-[9px] opacity-60 font-bold bg-black/5 dark:bg-white/10 px-1.5 py-0.5 rounded cursor-help hover:text-accent transition-colors"> |
31 | 35 | LVL <span id="level-number">0</span> |
32 | 36 | </span> |
| 37 | + |
33 | 38 | <div class="absolute top-full right-0 mt-2 w-44 p-3 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-xl shadow-xl opacity-0 scale-95 -translate-y-2 pointer-events-none transition-all duration-200 group-hover:opacity-100 group-hover:scale-100 group-hover:translate-y-0 z-50"> |
34 | 39 | <div class="text-[8px] font-black uppercase tracking-widest mb-2 opacity-50 border-b border-[var(--border-color)] pb-1">Collection</div> |
35 | 40 | <div class="grid grid-cols-1 gap-1.5 text-[9px] font-bold"> |
36 | | - <div class="flex items-center justify-between"><div class="flex items-center gap-1.5"><span class="w-1.5 h-1.5 rounded-full bg-[#94a3b8]"></span> Common</div><span id="count-common" class="opacity-60 font-mono">0</span></div> |
37 | | - <div class="flex items-center justify-between"><div class="flex items-center gap-1.5"><span class="w-1.5 h-1.5 rounded-full bg-[#10b981]"></span> Uncommon</div><span id="count-uncommon" class="opacity-60 font-mono">0</span></div> |
38 | | - <div class="flex items-center justify-between"><div class="flex items-center gap-1.5"><span class="w-1.5 h-1.5 rounded-full bg-[#3b82f6]"></span> Rare</div><span id="count-rare" class="opacity-60 font-mono">0</span></div> |
39 | | - <div class="flex items-center justify-between"><div class="flex items-center gap-1.5"><span class="w-1.5 h-1.5 rounded-full bg-[#a855f7]"></span> Epic</div><span id="count-epic" class="opacity-60 font-mono">0</span></div> |
40 | | - <div class="flex items-center justify-between"><div class="flex items-center gap-1.5"><span class="w-1.5 h-1.5 rounded-full bg-[#fbbf24]"></span> Legend</div><span id="count-legendary" class="opacity-60 font-mono">0</span></div> |
41 | | - <div class="flex items-center justify-between"><div class="flex items-center gap-1.5"><span class="w-1.5 h-1.5 rounded-full bg-[#ef4444]"></span> Mythic</div><span id="count-mythic" class="opacity-60 font-mono">0</span></div> |
42 | | - <div class="flex items-center justify-between"><div class="flex items-center gap-1.5"><span class="w-1.5 h-1.5 rounded-full bg-[#ffffff] shadow-[0_0_5px_#fff]"></span> Absolute</div><span id="count-absolute" class="opacity-60 font-mono">0</span></div> |
| 41 | + <div class="flex items-center justify-between"> |
| 42 | + <div class="flex items-center gap-1.5"><span class="w-1.5 h-1.5 rounded-full bg-[#94a3b8]"></span> Common</div> |
| 43 | + <span id="count-common" class="opacity-60 font-mono">0</span> |
| 44 | + </div> |
| 45 | + <div class="flex items-center justify-between"> |
| 46 | + <div class="flex items-center gap-1.5"> |
| 47 | + <span class="w-1.5 h-1.5 rounded-full bg-[#10b981]"></span> |
| 48 | + Uncommon |
| 49 | + </div> |
| 50 | + <span id="count-uncommon" class="opacity-60 font-mono">0</span> |
| 51 | + </div> |
| 52 | + <div class="flex items-center justify-between"> |
| 53 | + <div class="flex items-center gap-1.5"><span class="w-1.5 h-1.5 rounded-full bg-[#3b82f6]"></span> Rare</div> |
| 54 | + <span id="count-rare" class="opacity-60 font-mono">0</span> |
| 55 | + </div> |
| 56 | + <div class="flex items-center justify-between"> |
| 57 | + <div class="flex items-center gap-1.5"><span class="w-1.5 h-1.5 rounded-full bg-[#a855f7]"></span> Epic</div> |
| 58 | + <span id="count-epic" class="opacity-60 font-mono">0</span> |
| 59 | + </div> |
| 60 | + <div class="flex items-center justify-between"> |
| 61 | + <div class="flex items-center gap-1.5"><span class="w-1.5 h-1.5 rounded-full bg-[#fbbf24]"></span> Legend</div> |
| 62 | + <span id="count-legendary" class="opacity-60 font-mono">0</span> |
| 63 | + </div> |
| 64 | + |
| 65 | + <div class="flex items-center justify-between"> |
| 66 | + <div class="flex items-center gap-1.5"><span class="w-1.5 h-1.5 rounded-full bg-[#ef4444]"></span> Mythic</div> |
| 67 | + <span id="count-mythic" class="opacity-60 font-mono">0</span> |
| 68 | + </div> |
| 69 | + |
| 70 | + <div class="flex items-center justify-between"> |
| 71 | + <div class="flex items-center gap-1.5"><span class="w-1.5 h-1.5 rounded-full bg-[#ffffff] shadow-[0_0_5px_#fff]"></span> Absolute</div> |
| 72 | + <span id="count-absolute" class="opacity-60 font-mono">0</span> |
| 73 | + </div> |
43 | 74 | </div> |
44 | 75 | <div class="absolute -top-1 right-4 w-2 h-2 bg-[var(--bg-card)] border-l border-t border-[var(--border-color)] rotate-45"></div> |
45 | 76 | </div> |
46 | 77 | </div> |
| 78 | + |
47 | 79 | </div> |
48 | 80 | <div class="w-full h-1 md:h-1.5 bg-black/10 dark:bg-white/10 rounded-full mt-1.5 md:mt-2 overflow-hidden"> |
49 | 81 | <div id="level-progress" class="h-full bg-accent transition-all duration-1000" style="width: 0%"></div> |
50 | 82 | </div> |
| 83 | + |
| 84 | + {# Per-game high score mini-strip (hidden on xs) #} |
51 | 85 | <div class="hidden md:flex items-center gap-3 mt-1.5"> |
52 | 86 | <span class="text-[7px] font-mono text-[var(--text-muted)] uppercase tracking-widest opacity-60">HS:</span> |
53 | 87 | <span class="text-[7px] font-mono font-bold text-[var(--text-muted)]">👾 <span id="hs-si" class="text-accent">—</span></span> |
|
58 | 92 |
|
59 | 93 | <div class="w-px h-6 md:h-8 bg-[var(--border-color)] ml-1"></div> |
60 | 94 |
|
61 | | - <button data-action="toggle-theme" class="text-base md:text-lg p-1 md:p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded-full transition-all" id="theme-icon"> |
| 95 | + <button onclick="toggleTheme()" class="text-base md:text-lg p-1 md:p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded-full transition-all" id="theme-icon"> |
62 | 96 | 🌙 |
63 | 97 | </button> |
64 | | - <div id="achievement-badges" class="hidden sm:flex items-center gap-1 ml-1"></div> |
| 98 | + |
| 99 | + {# Achievement badges — shown when earned, read from localStorage #} |
| 100 | + <div id="achievement-badges" class="hidden sm:flex items-center gap-1 ml-1"> |
| 101 | + </div> |
65 | 102 | </div> |
66 | 103 | </div> |
| 104 | + |
67 | 105 | <script> |
68 | 106 | (function refreshGameStats() { |
| 107 | + // High scores |
69 | 108 | var hs = { |
70 | 109 | "hs-si": localStorage.getItem("hs_space-invaders"), |
71 | 110 | "hs-cb": localStorage.getItem("hs_code-breaker"), |
|
75 | 114 | var el = document.getElementById(id); |
76 | 115 | if (el && hs[id]) el.textContent = hs[id]; |
77 | 116 | }); |
| 117 | +
|
| 118 | + // Achievement badges |
78 | 119 | var badgeContainer = document.getElementById("achievement-badges"); |
79 | 120 | if (!badgeContainer) return; |
80 | 121 | var earned = {}; |
|
0 commit comments