-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
249 lines (235 loc) · 9.71 KB
/
index.html
File metadata and controls
249 lines (235 loc) · 9.71 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
<!DOCTYPE html>
<html class="light" lang="en">
<head>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<title>Memory Game Board</title>
<link href="https://fonts.googleapis.com" rel="preconnect" />
<link crossorigin="" href="https://fonts.gstatic.com" rel="preconnect" />
<link
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="style.css" />
<script src="https://cdn.tailwindcss.com?plugins=forms,container-queries"></script>
<script id="tailwind-config">
tailwind.config = {
darkMode: "class",
theme: {
extend: {
colors: {
primary: "#007AFF",
"background-light": "#F5F5F7",
"background-dark": "#000000",
"surface-light": "#FFFFFF",
"surface-dark": "#1C1C1E",
},
fontFamily: {
sans: [
"-apple-system",
"BlinkMacSystemFont",
"SF Pro Text",
"Segoe UI",
"Roboto",
"Helvetica",
"Arial",
"sans-serif",
],
display: [
"-apple-system",
"BlinkMacSystemFont",
"SF Pro Display",
"Segoe UI",
"Roboto",
"Helvetica",
"Arial",
"sans-serif",
],
},
borderRadius: {
"2xl": "1rem",
"3xl": "1.5rem",
"4xl": "2.5rem",
full: "9999px",
},
boxShadow: {
soft: "0 4px 12px rgba(0, 0, 0, 0.03)",
"soft-xl":
"0 24px 48px -8px rgba(0, 0, 0, 0.08), 0 12px 24px -8px rgba(0, 0, 0, 0.04)",
card: "0 1px 2px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.1)",
"card-hover":
"0 10px 20px -5px rgba(0, 0, 0, 0.1), 0 8px 8px -6px rgba(0, 0, 0, 0.04)",
"card-selected":
"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
"inner-subtle": "inset 0 2px 4px 0 rgba(0, 0, 0, 0.02)",
},
letterSpacing: {
tightest: "-0.015em",
"widest-caps": "0.08em",
},
},
},
};
</script>
</head>
<body
class="bg-background-light dark:bg-background-dark text-slate-900 dark:text-slate-50 font-sans antialiased transition-colors duration-300 selection:bg-primary/20 selection:text-primary"
>
<div class="min-h-screen flex flex-col items-center">
<header
class="w-full max-w-[960px] px-6 py-8 flex items-center justify-between z-10"
>
<div class="flex items-center gap-3">
<div
class="size-10 bg-gradient-to-br from-primary to-blue-600 text-white rounded-xl flex items-center justify-center shadow-lg shadow-blue-500/20"
>
<span class="material-symbols-outlined text-[24px]">grid_view</span>
</div>
<h1
class="text-2xl font-bold tracking-tight text-slate-900 dark:text-white font-display"
>
Memory
</h1>
</div>
<div class="relative">
<button
id="profile-btn"
class="group flex items-center gap-3 pl-3 pr-4 py-2 bg-white/80 dark:bg-surface-dark/80 backdrop-blur-md rounded-full shadow-sm hover:shadow-md transition-all border border-black/5 dark:border-white/10"
>
<div
class="size-8 rounded-full bg-slate-100 dark:bg-slate-700 overflow-hidden ring-2 ring-white dark:ring-slate-600"
style="
background-image: url('https://lh3.googleusercontent.com/aida-public/AB6AXuDLNCQ3oKyHzSRQzOhbQzBReNYpk66gGhRcLsHq-0HDzeGrbv-6FQ-lmmLF-TiXenPJeih2DcqWzLTNYgee1ofHbJv44YwXnPShNX94qohGV3YWp6Asmnd9VXR10to3pR6Lhy7Mb_lrtTNzQXlrFXWEkmeSDh9S8urmZg5_2IzehxMIybxxI3Z1B3Gjg8Qo0qy5HL1MMPYxaHII8X_SMShdlhArcZ-tG8e_l7BXt441YyoHRrj_xvKR2Qgl9oEyknhwTZ8axodvLzY');
background-size: cover;
"
></div>
<div class="flex flex-col items-start leading-none gap-0.5">
<span
class="text-xs font-semibold text-slate-700 dark:text-slate-200"
>Profile</span
>
<span
id="player-name"
class="text-[10px] text-slate-400 font-medium"
>Player 1</span
>
</div>
<span
class="material-symbols-outlined text-slate-400 text-[18px] ml-1 group-hover:translate-y-0.5 transition-transform"
>keyboard_arrow_down</span
>
</button>
<!-- Dropdown Menu -->
<div
id="profile-dropdown"
class="hidden absolute top-full right-0 mt-2 w-48 bg-white dark:bg-surface-dark rounded-xl shadow-lg border border-black/5 dark:border-white/10 overflow-hidden z-20"
>
<div class="p-3">
<p class="text-xs font-semibold text-slate-500 mb-2 px-1">
Edit Name
</p>
<div class="flex gap-2">
<input
type="text"
id="name-input"
class="w-full text-sm rounded-lg border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-800 px-2 py-1 focus:ring-2 focus:ring-primary/50 outline-none"
placeholder="Enter name"
/>
<button
id="save-name-btn"
class="bg-primary text-white rounded-lg px-2 py-1 text-xs font-medium hover:bg-primary/90 transition-colors"
>
Save
</button>
</div>
</div>
</div>
</div>
</header>
<main
class="flex-1 w-full max-w-[960px] flex flex-col items-center px-4 pb-12"
>
<div class="flex gap-8 mb-10 w-full justify-center">
<div
class="flex flex-col items-center justify-center min-w-[110px] py-3 px-5 bg-white/60 dark:bg-surface-dark/60 backdrop-blur-md rounded-2xl border border-white/40 dark:border-white/5 shadow-sm"
>
<span
class="text-[10px] font-semibold text-slate-400 uppercase tracking-widest-caps mb-0.5"
>Level</span
>
<span
id="level-display"
class="text-3xl font-semibold text-slate-800 dark:text-slate-100 leading-tight tracking-tight tabular-nums"
>1/5</span
>
</div>
<div
class="flex flex-col items-center justify-center min-w-[110px] py-3 px-5 bg-white/60 dark:bg-surface-dark/60 backdrop-blur-md rounded-2xl border border-white/40 dark:border-white/5 shadow-sm"
>
<span
class="text-[10px] font-semibold text-slate-400 uppercase tracking-widest-caps mb-0.5"
>Moves</span
>
<span
id="moves"
class="text-3xl font-semibold text-slate-800 dark:text-slate-100 leading-tight tracking-tight tabular-nums"
>0</span
>
</div>
<div
class="flex flex-col items-center justify-center min-w-[110px] py-3 px-5 bg-white/60 dark:bg-surface-dark/60 backdrop-blur-md rounded-2xl border border-white/40 dark:border-white/5 shadow-sm relative overflow-hidden"
>
<span
class="text-[10px] font-semibold text-slate-400 uppercase tracking-widest-caps mb-0.5"
>Time</span
>
<span
id="timer"
class="text-3xl font-semibold text-slate-800 dark:text-slate-100 leading-tight tracking-tight tabular-nums"
>00:00</span
>
<div class="absolute bottom-0 left-0 h-1 bg-primary/20 w-full">
<div
class="h-full bg-primary w-0 rounded-r-full transition-all duration-1000"
></div>
</div>
</div>
</div>
<div class="relative w-full max-w-[640px] aspect-square group/board">
<div
id="game-board"
class="grid grid-cols-6 grid-rows-6 gap-3 w-full h-full p-5 bg-surface-light dark:bg-surface-dark rounded-4xl shadow-soft-xl border border-black/[0.04] dark:border-white/[0.08] ring-1 ring-black/[0.02] dark:ring-white/[0.02] transform transition-transform duration-500"
>
<!-- Cards will be generated here -->
</div>
</div>
<div class="mt-10 flex flex-col items-center">
<h2
id="status-text"
class="text-slate-800 dark:text-slate-200 text-xl font-semibold tracking-tight animate-pulse"
>
Select a card
</h2>
<p
class="text-slate-400 dark:text-slate-500 text-sm mt-1 font-medium"
>
Find the matching pair.
</p>
</div>
<div class="mt-8">
<button
id="restart-btn"
class="flex items-center justify-center px-6 py-3 bg-transparent hover:bg-black/[0.04] dark:hover:bg-white/[0.05] text-primary text-sm font-bold rounded-full transition-all duration-200 group active:scale-95"
>
<span
class="material-symbols-outlined mr-2 text-[20px] group-hover:-rotate-180 transition-transform duration-500"
>refresh</span
>
<span>Restart Game</span>
</button>
</div>
</main>
</div>
<script src="script.js"></script>
</body>
</html>