-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.html
More file actions
346 lines (325 loc) · 13.5 KB
/
popup.html
File metadata and controls
346 lines (325 loc) · 13.5 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
<!doctype html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Study AI</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@500;700&display=swap" rel="stylesheet">
<style>
:root {
--bg-overlay: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.16), transparent 30%), radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.14), transparent 28%), rgba(9, 12, 28, 0.68);
--card: rgba(255, 255, 255, 0.14);
--stroke: rgba(255, 255, 255, 0.2);
--text: #e9edf5;
--muted: #c6cfde;
--accent: #8bd0ff;
--accent-strong: #63b0ff;
--shadow: 0 18px 38px rgba(9, 19, 48, 0.45);
--radius: 18px;
}
body.light {
--bg-overlay: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.4), transparent 30%), radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.35), transparent 28%), rgba(245, 247, 252, 0.9);
--card: rgba(255, 255, 255, 0.6);
--stroke: rgba(16, 28, 60, 0.12);
--text: #0d1630;
--muted: #384967;
--accent: #2a7ef5;
--accent-strong: #1b69d8;
--shadow: 0 18px 38px rgba(13, 22, 48, 0.18);
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
min-width: 360px;
width: 360px;
min-height: 500px;
display: grid;
place-items: center;
background: #1a1a2e;
position: relative;
font-family: "Manrope", "Segoe UI", sans-serif;
color: var(--text);
overflow: hidden;
}
body::before {
content: ""; position: fixed; inset: 0; background: var(--bg-overlay); backdrop-filter: blur(2px); z-index: 0; pointer-events: none;
}
main {
position: relative;
z-index: 1;
width: 92%;
margin: 0 auto;
padding: 14px;
background: var(--card);
border-radius: 16px;
box-shadow: var(--shadow);
backdrop-filter: blur(14px);
border: 1px solid var(--stroke);
display: flex;
flex-direction: column;
gap: 10px;
box-sizing: border-box;
}
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; line-height: 1.2; }
header h1 { font-size: 16px; letter-spacing: -0.01em; margin: 0; padding: 0; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand .logo { font-size: 18px; }
.tabs {
display: flex;
gap: 6px;
padding: 5px;
background: rgba(255,255,255,0.08);
border: 1px solid var(--stroke);
border-radius: 10px;
}
.tab {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
padding: 8px 6px;
border-radius: 8px;
color: var(--muted);
background: transparent;
border: none;
cursor: pointer;
font-weight: 700;
font-size: 11px;
transition: all 160ms ease;
white-space: nowrap;
min-width: 0;
}
.tab span {
overflow: hidden;
text-overflow: ellipsis;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,0.12); }
.tab.active { color: #0a1222; background: linear-gradient(120deg, var(--accent), var(--accent-strong)); }
.section { display: none; opacity: 0; transform: translateY(6px); transition: opacity 180ms ease, transform 180ms ease; max-height: 380px; overflow-y: auto; padding-right: 4px; }
.section.active { display: block; opacity: 1; transform: translateY(0); }
.timer { display: grid; gap: 10px; }
#timer-display { font-size: 48px; letter-spacing: 0.06em; font-weight: 700; text-align: center; color: #f6f8fb; }
.controls { display: flex; gap: 6px; }
.btn { flex: 1; padding: 10px; border: 1px solid rgba(255,255,255,0.25); border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 14px; transition: transform 120ms ease, filter 120ms ease; }
.btn.primary { background: linear-gradient(120deg, var(--accent), var(--accent-strong)); color: #0a1222; box-shadow: 0 12px 26px rgba(12, 23, 48, 0.28); }
.btn.secondary { background: rgba(255,255,255,0.12); color: var(--text); box-shadow: 0 8px 18px rgba(12, 23, 48, 0.2); }
.btn.glass { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); color: var(--text); }
.btn.glass:hover { background: rgba(255,255,255,0.12); }
.btn:hover { transform: translateY(-1px); filter: brightness(1.03); }
.row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
}
.row.flex-center {
display: flex;
align-items: flex-end;
gap: 6px;
}
.field {
display: grid;
gap: 6px;
min-width: 0;
}
.select, .input {
width: 100%;
padding: 10px 12px;
border: 1px solid rgba(255,255,255,0.2);
border-radius: 10px;
background: rgba(255,255,255,0.08);
color: var(--text);
font-size: 13px;
outline: none;
box-sizing: border-box;
min-width: 0;
}
.select {
appearance: none;
background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"%3E%3Cpath fill="%23e9edf5" d="M6 9L1 4h10z"/%3E%3C/svg%3E');
background-repeat: no-repeat;
background-position: right 10px center;
padding-right: 32px;
}
.select:focus, .input:focus {
border-color: var(--accent);
background: rgba(255,255,255,0.12);
}
.hint { font-size: 11px; color: var(--muted); }
.divider { height: 1px; background: rgba(255,255,255,0.15); margin: 4px 0; }
.stats-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.stats-header h2 { font-size: 16px; font-weight: 700; }
.stats-grid { display: grid; gap: 10px; }
.card { padding: 10px; background: rgba(255,255,255,0.08); border-radius: 10px; border: 1px solid rgba(255,255,255,0.12); }
canvas { width: 100%; height: 160px; }
.actions { display: flex; gap: 8px; }
.file-input { display: none; }
.settings-grid {
display: grid;
gap: 14px;
}
.setting {
display: grid;
gap: 8px;
align-items: start;
}
.setting label {
font-weight: 600;
}
.toggle { display: flex; align-items: center; gap: 8px; }
.switch { appearance: none; width: 46px; height: 24px; border-radius: 999px; background: rgba(255,255,255,0.18); border: 1px solid var(--stroke); position: relative; cursor: pointer; }
.switch:checked { background: linear-gradient(120deg, var(--accent), var(--accent-strong)); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left 160ms ease; }
.switch:checked::after { left: 24px; }
input[type="range"] { width: 100%; cursor: pointer; }
/* Language Buttons */
.lang-btns { display: flex; gap: 6px; }
.lang-btn {
background: rgba(255,255,255,0.1);
border: 1px solid rgba(255,255,255,0.2);
border-radius: 6px;
padding: 4px 8px;
cursor: pointer;
font-size: 16px;
transition: all 160ms ease;
}
.lang-btn:hover {
background: rgba(255,255,255,0.15);
transform: scale(1.1);
}
.lang-btn.active {
background: var(--accent);
border-color: var(--accent-strong);
}
</style>
</head>
<body class="dark">
<main>
<header>
<div class="brand"><span class="logo">🧠</span><h1>Study AI</h1></div>
<div class="lang-btns">
<button class="lang-btn active" data-lang="pt-BR" title="Português">🇧🇷</button>
<button class="lang-btn" data-lang="en" title="English">🇺🇸</button>
</div>
</header>
<nav class="tabs">
<button class="tab active" data-tab="focus">🧠 <span>Foco</span></button>
<button class="tab" data-tab="stats">📈 <span>Estatísticas</span></button>
<button class="tab" data-tab="settings">⚙️ <span>Configurações</span></button>
</nav>
<!-- ABA 1: FOCO -->
<section id="tab-focus" class="section active">
<div class="timer">
<div id="timer-display">25:00</div>
<div class="controls">
<button id="btn-start-pause" class="btn primary">Iniciar</button>
<button id="btn-reset" class="btn secondary">Resetar</button>
</div>
<!-- Painel de Controle de Música Spotify -->
<div id="spotify-panel" style="display:none; margin-top: 8px; padding: 8px; background: rgba(30, 215, 96, 0.1); border: 1px solid rgba(30, 215, 96, 0.3); border-radius: 8px;">
<div style="font-size: 11px; color: var(--muted); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
<span id="spotify-track-name">Nenhuma música</span> • <span id="spotify-artist-name"></span>
</div>
<div style="display: flex; gap: 4px; justify-content: center;">
<button id="btn-spotify-prev" class="btn secondary" style="flex: 0 0 auto; padding: 6px 8px; font-size: 12px;">⏮️</button>
<button id="btn-spotify-play" class="btn primary" style="flex: 0 0 auto; padding: 6px 8px; font-size: 12px;">▶️</button>
<button id="btn-spotify-next" class="btn secondary" style="flex: 0 0 auto; padding: 6px 8px; font-size: 12px;">⏭️</button>
</div>
</div>
<div class="row">
<div class="field">
<label class="hint">Modo do Timer</label>
<select id="modeSelect" class="select">
<option value="focus">Foco (25m)</option>
<option value="shortBreak">Pausa Curta (5m)</option>
<option value="longBreak">Pausa Longa (15m)</option>
</select>
</div>
<div class="field">
<label class="hint">Tema de Estudo</label>
<select id="themeSelect" class="select"></select>
</div>
</div>
<div id="customThemeRow" class="field" style="display:none;">
<input id="customThemeInput" class="input" type="text" maxlength="50" placeholder="Digite seu tema personalizado..." />
<div class="hint">Pressione Enter para salvar</div>
</div>
<div class="hint">Tema atual: <strong id="currentTheme">Programação</strong></div>
</div>
</section>
<!-- ABA 2: ESTATÍSTICAS / DASHBOARD -->
<section id="tab-stats" class="section">
<div class="stats-grid">
<div class="stats-header">
<h2>📊 Dashboard</h2>
<select id="timeFilter" class="select" style="max-width: 140px;">
<option value="week">Semana</option>
<option value="month">Mês</option>
<option value="year">Ano</option>
</select>
</div>
<div class="card">
<canvas id="weeklyChart"></canvas>
</div>
<div class="card">
<canvas id="categoryChart"></canvas>
</div>
<div class="actions">
<button id="btn-import" class="btn secondary">Importar JSON</button>
<button id="btn-export" class="btn primary">Exportar JSON</button>
<input id="file-import" type="file" accept="application/json" class="file-input" />
</div>
</div>
</section>
<!-- ABA 3: CONFIGURAÇÕES -->
<section id="tab-settings" class="section">
<div class="settings-grid">
<div class="setting">
<label class="hint">Som de Conclusão</label>
<div style="display: flex; gap: 6px; align-items: flex-end;">
<select id="soundSelect" class="select" style="flex: 1;">
<option value="sparkle">✨ Sparkle</option>
<option value="bell">🔔 Bell</option>
<option value="chime">🎵 Chime</option>
</select>
<button id="btn-test-sound" class="btn glass" style="padding: 8px 10px; font-size: 12px; flex: 0 0 auto; white-space: nowrap;">🔊 Testar</button>
</div>
</div>
<div class="setting">
<label class="hint">Volume: <span id="volumeValue">70</span>%</label>
<input id="volumeSlider" type="range" min="0" max="100" value="70" />
</div>
<div class="divider"></div>
<div class="setting">
<label class="hint">Idioma</label>
<select id="languageSelect" class="select">
<option value="pt-BR">Português (BR)</option>
<option value="en">English</option>
<option value="es">Español</option>
</select>
</div>
<div class="divider"></div>
<div class="setting">
<label class="hint">🎵 Spotify</label>
<button id="btn-spotify-connect" class="btn primary" style="width: 100%; padding: 8px; font-size: 13px;">Conectar Spotify</button>
<div id="spotify-status" class="hint" style="text-align: center; margin-top: 4px; color: var(--accent);">Não conectado</div>
</div>
<div class="divider"></div>
<div class="setting">
<div class="toggle">
<label class="hint">Tema: <span id="themeLabel">Escuro</span></label>
<input id="themeToggle" type="checkbox" class="switch" checked />
</div>
</div>
</div>
</section>
</main>
<script src="chart.js"></script>
<script src="popup.js"></script>
</body>
</html>