-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
410 lines (375 loc) · 11.8 KB
/
index.html
File metadata and controls
410 lines (375 loc) · 11.8 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Randoro: Turn work into a game of chance!</title>
<!-- Favicon -->
<link
rel="icon"
type="image/png"
sizes="192x192"
href="./img/icon-192.png"
/>
<link
rel="icon"
type="image/png"
sizes="512x512"
href="./img/icon-512.png"
/>
<link rel="apple-touch-icon" href="./img/icon-192.png" />
<!-- Tailwind CSS CDN (fallback if offline build is missing) -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Local Tailwind build (overrides CDN) -->
<link rel="stylesheet" href="./css/tailwind.css" />
<style>
/* Balatro theme font*/
@font-face {
font-family: "m6x11";
src: url("./fonts/m6x11.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
/* Balatro theme colors */
.color-red {
background-color: #fd5f55;
color: #ffffff;
border: none;
}
.color-orange {
background-color: #fda200;
color: #ffffff;
border: none;
}
.color-blue {
background-color: #009cfd;
color: #ffffff;
border: none;
}
.color-dark {
background-color: #4f6367;
color: #ffffff;
border: none;
}
.color-green {
background-color: #28a745; /* nice vivid green */
color: #ffffff;
border: none;
}
.color-pink {
background-color: #d58ac0;
color: #ffffff;
border: none;
}
.color-white {
background-color: #ffffff;
color: #4f6367;
border: none;
}
.container-bg {
background: linear-gradient(145deg, #4f6367, #009cfd, #fd5f55);
color: #ffffff;
}
.container-bg-light {
background: rgba(79, 99, 103, 0.8);
color: #ffffff;
}
</style>
<!-- Manifest for PWA -->
<link rel="manifest" href="./manifest.json" />
<meta name="theme-color" content="#f87171" />
</head>
<body class="font-['m6x11'] min-h-screen flex flex-col items-center p-6">
<!-- Canvas Starfield -->
<canvas
id="starfield"
class="fixed top-0 left-0 w-full h-full -z-10"
></canvas>
<!-- Main container -->
<div class="w-full max-w-lg space-y-2">
<img
src="./img/randoro-logo.png"
srcset="
./img/randoro-logo.png 1x,
./img/randoro-logo@2x.png 2x,
./img/randoro-logo@4x.png 4x
"
alt="Randoro Logo"
class="mx-auto mt-4 mb-6 h-auto w-[180px] sm:w-[220px] md:w-[260px]"
style="image-rendering: pixelated"
/>
<div
class="pomodoro flex flex-col space-y-4 p-4 rounded bg-gray-700 w-full max-w-lg mx-auto"
>
<!-- Mode Buttons -->
<div class="pomodoro-modes flex space-x-2">
<button
id="classic-btn"
class="flex-1 color-red py-4 rounded hover:opacity-90 text-xl"
>
Classic Mode
</button>
<button
id="random-btn"
class="flex-1 color-dark py-4 rounded hover:opacity-90 text-xl"
>
Random Mode
</button>
</div>
<!-- Dynamic container -->
<div id="mode-container" class="rounded w-full">
<!-- Classic Settings -->
<div id="classic-settings-container">
<button
id="toggle-classic-settings"
class="color-blue hover:opacity-90 px-2 py-1 rounded w-full"
>
Show Settings
</button>
<div
id="classic-settings"
class="hidden flex flex-col space-y-2 mt-2"
>
<label class="text-white font-medium"
>Pomodoro Time (minutes)
<input
id="classic-pomodoro"
type="number"
min="1"
value="25"
class="w-full px-2 py-1 rounded color-orange text-white-800"
/>
</label>
<label class="text-white font-medium"
>Short Break (minutes)
<input
id="classic-short"
type="number"
min="1"
value="5"
class="w-full px-2 py-1 rounded color-orange text-white-800"
/>
</label>
<label class="text-white font-medium"
>Long Break (minutes)
<input
id="classic-long"
type="number"
min="1"
value="15"
class="w-full px-2 py-1 rounded color-orange text-white-800"
/>
</label>
</div>
</div>
<!-- Random Settings -->
<div id="random-settings-container" class="hidden">
<button
id="toggle-random-settings"
class="color-blue px-2 py-1 rounded w-full"
>
Show Settings
</button>
<div
id="random-settings"
class="hidden flex flex-col space-y-2 mt-2"
>
<p class="text-[13px] text-gray-400 mt-2 text-center">
Pomodoro duration is randomly generated between your chosen
minimum and maximum.<br />
Breaks adjust based on the Pomodoro length.
</p>
<label class="text-white font-medium"
>Pomodoro Min (minutes)
<input
id="random-pomodoro-min"
type="number"
min="1"
value="20"
class="w-full px-2 py-1 rounded color-orange text-white-800"
/>
</label>
<label class="text-white font-medium"
>Pomodoro Max (minutes)
<input
id="random-pomodoro-max"
type="number"
min="1"
value="30"
class="w-full px-2 py-1 rounded color-orange text-white-800"
/>
</label>
</div>
</div>
</div>
<!-- Timer -->
<div
class="timer p-4 container-bg-light border rounded shadow space-y-2"
>
<p
id="timer-state"
class="text-xl text-center color-pink p-1 rounded"
>
State: Pomodoro
</p>
<p
id="timer-count"
class="text-7xl color-red py-20 rounded text-center text"
>
25:00
</p>
</div>
</div>
<!-- Task List -->
<div
id="todo-container"
class="todo flex flex-col space-y-2 p-4 rounded bg-gray-700 w-full max-w-lg mx-auto"
>
<div class="todo-modes flex space-x-2 mb-2">
<button
id="pomodoro-tasks-btn"
class="flex-1 color-dark py-1 rounded hover:opacity-90"
>
Pomodoro Tasks
</button>
<button
id="day-list-btn"
class="flex-1 color-dark py-1 rounded hover:opacity-90"
>
Day List
</button>
</div>
<div id="pomodoro-tasks-container">
<ul id="pomodoro-list" class="space-y-1"></ul>
<p class="text-[13px] text-gray-400 mt-2 text-center">
Only 3 tasks per pomodoro list to promote focus.
</p>
</div>
<div id="day-tasks-container" class="hidden">
<ul id="day-list" class="space-y-1"></ul>
</div>
</div>
<!-- Notification Sound Section -->
<div
class="sounds flex flex-col space-y-2 p-4 rounded bg-gray-700 w-full max-w-lg mx-auto"
>
<span
class="text-white font-medium text-center w-full block text-lg -mb-3"
>Notification Sound</span
>
<p class="text-xs text-gray-400 text-center">
Sound will loop until input.
</p>
<div class="border-b border-gray-500 w-full"></div>
<div class="flex justify-between space-x-2">
<select
id="sound-selector"
class="color-orange rounded px-2 py-1 text-white-800 w-4/5"
>
<option value="african-tabla.mp3">African Tabla</option>
<option value="car-horn.mp3">Car Horn</option>
<option value="lofi.mp3">LoFi</option>
<option value="level-up-07.mp3">Level Up 07</option>
</select>
<button
id="test-sound"
class="color-blue px-3 py-1 rounded hover:opacity-80 w-1/5"
>
Play
</button>
</div>
<input
type="file"
id="upload-sound"
accept=".mp3,.wav,.ogg,.m4a,.aac,.flac"
class="border rounded px-2 py-1 text-white bg-gray-600"
/>
<p class="text-[13px] text-gray-400 mt-2">
Uploaded sounds are saved in your browser. Clearing cache will remove
them.
</p>
</div>
<div class="options flex space-x-2">
<button
id="reset-all-btn"
class="flex-1 color-red py-2 rounded hover:opacity-90"
>
New Game
</button>
<button
id="info-btn"
class="flex-1 color-blue py-2 rounded hover:opacity-90"
onclick="window.location.href='./info.html'"
>
Info
</button>
<button
id="font-btn"
class="flex-1 color-orange py-2 rounded hover:opacity-90"
>
Fonts
</button>
<button
id="install-btn"
class="flex-1 color-green py-2 rounded hover:opacity-90"
>
Download
</button>
</div>
</div>
<!-- Starfield Script -->
<script>
document.addEventListener("DOMContentLoaded", () => {
const canvas = document.getElementById("starfield");
const ctx = canvas.getContext("2d");
const stars = [];
function resizeCanvas() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
}
function initStars() {
stars.length = 0;
const starCount =
canvas.width < 500 ? 150 : canvas.width < 800 ? 300 : 500;
for (let i = 0; i < starCount; i++) {
stars.push({
x: Math.random() * canvas.width,
y: Math.random() * canvas.height,
r: Math.random() * 2 + 1,
alpha: Math.random() * 0.8 + 0.2,
offset: Math.random() * 1000,
});
}
}
function drawStars() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
const gradient = ctx.createLinearGradient(0, 0, 0, canvas.height);
gradient.addColorStop(0, "#001f3f");
gradient.addColorStop(1, "#003366");
ctx.fillStyle = gradient;
ctx.fillRect(0, 0, canvas.width, canvas.height);
const time = Date.now() * 0.002;
for (let star of stars) {
const alpha = star.alpha + Math.sin(time + star.offset) * 0.3;
ctx.beginPath();
ctx.arc(star.x, star.y, star.r, 0, Math.PI * 2);
ctx.fillStyle = `rgba(255,255,255,${Math.max(
0,
Math.min(1, alpha)
)})`;
ctx.fill();
}
requestAnimationFrame(drawStars);
}
function startStarfield() {
resizeCanvas();
initStars();
drawStars();
}
window.addEventListener("resize", startStarfield);
startStarfield();
});
</script>
<script type="module" src="./js/main.js"></script>
</body>
</html>