-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
223 lines (196 loc) · 13.7 KB
/
index.html
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
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<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=Inter:wght@400;500;600;700;800&family=Rajdhani:wght@700&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@phosphor-icons/web@2.0.3/src/light/style.css"/>
<link rel="stylesheet" href="styles.css">
<script src="src/scripts.js" type="module"></script>
<title>Ballerini - Pomodoro</title>
</head>
<body class="grid place-items-center h-screen bg-zinc-50 dark:bg-zinc-900 transition-colors">
<div x-data="app" class="container mx-auto">
<header class="flex items-center justify-between">
<div>
<h1 x-cloak x-text="messages.header.title" class="font-extrabold text-4xl text-zinc-800 dark:text-zinc-200"></h1>
<p x-cloak x-text="messages.header.subtitle" class="font-medium text-xl text-zinc-500 dark:text-zinc-400"></p>
<span class="skeleton w-72 h-9 rounded-full animate-pulse block bg-zinc-600"></span>
<span class="skeleton w-96 h-6 rounded-full animate-pulse block bg-zinc-500 mt-2"></span>
</div>
<div>
<button @click="$theme.toggleTheme" class="bg-zinc-100 p-2 rounded leading-none dark:bg-zinc-800">
<i class="ph-light ph-sun leading-none text-zinc-400 text-2xl dark:text-zinc-500"></i>
</button>
<a class="bg-zinc-100 p-2 rounded leading-none inline-block dark:bg-zinc-800" href="https://github.com/joaomsl/ballerini-pomodoro" target="_blank" rel="noopener noreferrer">
<i class="ph-light ph-github-logo leading-none text-zinc-400 text-2xl dark:text-zinc-500"></i>
</a>
<button @click="toggleLanguage" class="bg-zinc-100 p-2 rounded leading-none dark:bg-zinc-800">
<i class="ph-light ph-translate leading-none text-zinc-400 text-2xl dark:text-zinc-500"></i>
</button>
</div>
</header>
<main x-data="pomodoro($mode.getCurrentMode(), $mode.getNextMode())" class="mt-12 grid grid-cols-2 gap-x-9">
<section class="p-6 border border-zinc-200 rounded-xl dark:border-zinc-800 dark:bg-zinc-900">
<header class="flex items-center justify-between">
<div>
<h1 x-cloak x-text="messages.session.title" class="font-bold text-2xl text-zinc-600 dark:text-zinc-400"></h1>
<p x-cloak x-text="messages.session.subtitle" class="text-zinc-500 dark:text-zinc-500"></p>
<span class="skeleton w-72 h-8 rounded-full animate-pulse block bg-zinc-500"></span>
<span class="skeleton w-96 h-6 rounded-full animate-pulse block bg-zinc-300 mt-2"></span>
</div>
<span class="bg-zinc-100 p-2 text-2xl rounded dark:bg-zinc-800 w-12 text-center">⏳</span>
</header>
<hr class="my-6 bg-zinc-200 border-zinc-200 dark:bg-zinc-800 dark:border-zinc-800">
<article class="flex items-center justify-between">
<div>
<h1 x-cloak x-text="messages.session.current_mode.title" class="font-semibold text-lg text-zinc-500 dark:text-zinc-400"></h1>
<p x-cloak x-text="messages.session.current_mode.subtitle" class="font-medium text-sm text-zinc-400 dark:text-zinc-500"></p>
<span class="skeleton w-72 h-6 rounded-full animate-pulse block bg-zinc-500"></span>
<span class="skeleton w-96 h-4 rounded-full animate-pulse block bg-zinc-300 mt-2"></span>
</div>
<div x-cloak class="border flex items-center gap-2 px-2 py-1 rounded transition-colors bg-opacity-10" :class="Object.values(currentMode.styleClasses)">
<i class="ph-light text-xl leading-none" :class="currentMode.iconName"></i>
<p x-text="messages.mode_names[currentMode.nameTranslationKey]" class="font-semibold text-sm"></p>
</div>
<span class="skeleton w-20 h-6 bg-zinc-400 animate-pulse rounded-md"></span>
</article>
<article class="my-6 flex items-center justify-between">
<div>
<h1 x-cloak x-text="messages.session.next_mode.title" class="font-semibold text-lg text-zinc-500 dark:text-zinc-400"></h1>
<p x-cloak x-text="messages.session.next_mode.title" class="font-medium text-sm text-zinc-400 dark:text-zinc-500"></p>
<span class="skeleton w-72 h-6 rounded-full animate-pulse block bg-zinc-500"></span>
<span class="skeleton w-96 h-4 rounded-full animate-pulse block bg-zinc-300 mt-2"></span>
</div>
<div x-cloak class="border flex items-center gap-2 px-2 py-1 rounded transition-colors bg-opacity-10" :class="Object.values(nextMode.styleClasses)">
<i class="ph-light text-xl leading-none" :class="nextMode.iconName"></i>
<p x-text="messages.mode_names[nextMode.nameTranslationKey]" class="font-semibold text-sm"></p>
</div>
<span class="skeleton w-20 h-6 bg-zinc-400 animate-pulse rounded-md"></span>
</article>
<div class="skeleton w-56 aspect-square mx-auto border-[0.9rem] border-zinc-400 rounded-full mt-12 animate-pulse grid place-items-center">
<span class="font-timer text-6xl text-zinc-400">00:00</span>
</div>
<article x-cloak class="flex items-center justify-center gap-x-8">
<section class="relative w-fit">
<div
x-show="showActions"
x-transition.scale
@mouseleave="showActions = false"
class="absolute -inset-2 -bottom-4 backdrop-blur z-20 flex items-end justify-center"
>
<button class="p-3 bg-transparent transition hover:bg-zinc-200 hover:scale-125 rounded leading-none">
<i class="ph-light ph-gear text-3xl text-zinc-400 leading-none"></i>
</button>
<button @click="toggleRun" class="p-3 bg-transparent transition hover:bg-zinc-200 hover:scale-125 rounded leading-none">
<i class="ph-light text-3xl text-zinc-400 leading-none" :class="{'ph-pause': isRunning(), 'ph-play': isStopped()}"></i>
</button>
<button @click="reset" class="p-3 bg-transparent transition hover:bg-zinc-200 hover:scale-125 rounded leading-none">
<i class="ph-light ph-clock-clockwise text-3xl text-zinc-400 leading-none"></i>
</button>
</div>
<span
x-text="getFormattedTime"
class="font-timer text-6xl absolute top-1/2 right-1/2 translate-x-1/2 -translate-y-1/2 z-10 transition-colors"
:class="isFinished() ? 'text-zinc-300 dark:text-zinc-700' : 'text-zinc-600 dark:text-zinc-100'"
></span>
<svg
x-data="circularProgressBar(initialTimestamp)"
@mouseenter="showActions = !isFinished()"
@reset-timer.document="handleTimerResetEvent($event)"
class="w-56 aspect-square -rotate-90"
>
<circle
class="text-zinc-100 dark:text-zinc-800"
stroke-width="5%"
stroke="currentColor"
fill="transparent"
:r="radius"
cx="50%"
cy="50%" />
<circle
class="transition-all"
:class="currentMode.styleClasses.textColor"
stroke-width="5%"
stroke="currentColor"
fill="transparent"
:r="radius"
cx="50%"
cy="50%"
stroke-linecap="round"
:stroke-dasharray="circumference"
:stroke-dashoffset="offset"
/>
</svg>
</section>
<section x-show="isFinished" x-transition>
<h1 x-text="messages.session.finished.title" class="font-bold text-3xl text-zinc-700 dark:text-zinc-100"></h1>
<p x-text="messages.session.finished.subtitle" class="text-zinc-500 mt-2"></p>
<button
@click="goToNextModeAndRun"
x-text="messages.session.finished.button.replace('%mode%', messages.mode_names[nextMode.nameTranslationKey])"
class="mt-4 block w-full p-3 font-semibold text-zinc-50 text-sm rounded transition hover:brightness-[1.03]"
:class="nextMode.styleClasses.background"
></button>
</section>
</article>
</section>
<section x-data="tasks" class="flex flex-col justify-between p-6 border border-zinc-200 rounded-xl dark:border-zinc-800 dark:bg-zinc-900">
<div>
<header class="flex items-center justify-between">
<div>
<h1 x-text="messages.tasks.title" x-cloak class="font-bold text-2xl text-zinc-600 dark:text-zinc-400"></h1>
<p x-text="messages.tasks.subtitle" x-cloak class="text-zinc-500 dark:text-zinc-500"></p>
<span class="skeleton w-72 h-8 rounded-full animate-pulse block bg-zinc-500"></span>
<span class="skeleton w-96 h-6 rounded-full animate-pulse block bg-zinc-300 mt-2"></span>
</div>
<span class="bg-zinc-100 p-2 text-2xl rounded dark:bg-zinc-800 w-12 text-center">🚀</span>
</header>
<hr class="my-6 bg-zinc-200 border-zinc-200 dark:bg-zinc-800 dark:border-zinc-800">
<ul class="flex flex-col gap-y-4">
<template x-transition x-for="(task, index) in tasks" :key="index">
<li x-id="['taskId']" class="flex items-center gap-x-2">
<input
@click="toggle(index)"
:checked="task.isCompleted"
class="w-5 h-5 rounded border bg-zinc-100 border-zinc-200 transition-colors focus:transition-shadow hover:cursor-pointer dark:border-zinc-700"
:class="makeClassesForCheckbox(task, currentMode)"
type="checkbox"
:id="$id('taskId')"
>
<label x-text="task.text" class="font-medium text-zinc-500 hover:cursor-pointer dark:text-zinc-500" :for="$id('taskId')"></label>
</li>
</template>
<span class="skeleton w-72 h-6 rounded-full animate-pulse block bg-zinc-300"></span>
<span class="skeleton w-80 h-6 rounded-full animate-pulse block bg-zinc-300"></span>
<span class="skeleton w-60 h-6 rounded-full animate-pulse block bg-zinc-300"></span>
<span class="skeleton w-96 h-6 rounded-full animate-pulse block bg-zinc-300"></span>
</ul>
</div>
<div x-cloak class="flex gap-x-3">
<input
x-ref="taskInput"
class="block w-full p-2 border-none bg-zinc-100 rounded placeholder-zinc-400 font-medium text-sm focus:transition-shadow dark:bg-zinc-800 dark:placeholder-zinc-600 dark:text-zinc-100"
:class="currentMode.styleClasses.focusRing"
type="text"
:placeholder="messages.tasks.input_placeholder"
>
<button
x-text="messages.tasks.add_button"
@click="handleAddTaskButtonClick"
class="basis-[20%] block w-full px-3 py-2 font-semibold text-zinc-50 text-sm rounded transition hover:brightness-[1.03]"
:class="currentMode.styleClasses.background"
></button>
</div>
<div class="skeleton grid grid-cols-5 gap-x-3 animate-pulse">
<span class="col-span-4 h-8 rounded-md block bg-zinc-300"></span>
<span class="h-8 rounded-md block bg-zinc-300"></span>
</div>
</section>
</main>
</div>
</body>
</html>