Skip to content

Commit 646b78e

Browse files
committed
feat: Add a clock in EST
1 parent ea686f1 commit 646b78e

1 file changed

Lines changed: 66 additions & 12 deletions

File tree

src/App.svelte

Lines changed: 66 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22
import Link from "./lib/Link.svelte";
33
import CollapsableLink from "./lib/CollapsableLink.svelte";
44
import SkillChip from "./lib/SkillChip.svelte";
5+
import { onMount } from "svelte";
6+
7+
onMount(() => {
8+
const clock = document.getElementById("clock");
9+
const now = new Date();
10+
const offset = 0;
11+
12+
function updateClock() {
13+
const now = new Date(Date.now() + offset);
14+
const hours = `0${now.getHours()}`.slice(-2);
15+
const minutes = `0${now.getMinutes()}`.slice(-2);
16+
const seconds = `0${now.getSeconds()}`.slice(-2);
17+
18+
clock.textContent = `${hours}:${minutes}:${seconds}`;
19+
}
20+
21+
updateClock();
22+
setInterval(updateClock, 1000);
23+
});
524
</script>
625

726
<main
@@ -40,7 +59,9 @@
4059
<i class="ph-bold ph-map-pin"></i> USA
4160
</p>
4261
<p class="text-lg text-white font-mono">
43-
<i class="ph-bold ph-clock"></i> UTC -4:00
62+
<i class="ph-bold ph-clock"></i>
63+
<span id="clock"></span>
64+
<span class="opacity-70 text-sm">EST</span>
4465
</p>
4566
</div>
4667

@@ -202,9 +223,18 @@
202223
<div class="flex flex-row gap-2 flex-wrap">
203224
<SkillChip href="https://www.python.org/" text="Python" />
204225
<SkillChip href="https://cplusplus.com/" text="C++" />
205-
<SkillChip href="https://developer.mozilla.org/en-US/docs/Web/HTML" text="HTML" />
206-
<SkillChip href="https://developer.mozilla.org/en-US/docs/Web/CSS" text="CSS" />
207-
<SkillChip href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" text="JavaScript" />
226+
<SkillChip
227+
href="https://developer.mozilla.org/en-US/docs/Web/HTML"
228+
text="HTML"
229+
/>
230+
<SkillChip
231+
href="https://developer.mozilla.org/en-US/docs/Web/CSS"
232+
text="CSS"
233+
/>
234+
<SkillChip
235+
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript"
236+
text="JavaScript"
237+
/>
208238
</div>
209239
</div>
210240

@@ -216,13 +246,28 @@
216246
</p>
217247

218248
<div class="flex flex-row gap-2 flex-wrap">
219-
<SkillChip href="https://www.djangoproject.com/" text="Django" />
220-
<SkillChip href="https://tailwindcss.com/" text="Tailwind CSS" />
249+
<SkillChip
250+
href="https://www.djangoproject.com/"
251+
text="Django"
252+
/>
253+
<SkillChip
254+
href="https://tailwindcss.com/"
255+
text="Tailwind CSS"
256+
/>
221257
<SkillChip href="https://svelte.dev/" text="Svelte" />
222258
<SkillChip href="https://alpinejs.dev/" text="Alpine.js" />
223-
<SkillChip href="https://pocketbase.io/" text="PocketBase" />
224-
<SkillChip href="https://github.com/arp242/goatcounter" text="Goatcounter" />
225-
<SkillChip href="https://www.electronjs.org/" text="Electron" />
259+
<SkillChip
260+
href="https://pocketbase.io/"
261+
text="PocketBase"
262+
/>
263+
<SkillChip
264+
href="https://github.com/arp242/goatcounter"
265+
text="Goatcounter"
266+
/>
267+
<SkillChip
268+
href="https://www.electronjs.org/"
269+
text="Electron"
270+
/>
226271
</div>
227272
</div>
228273

@@ -237,11 +282,20 @@
237282
<SkillChip href="https://www.linux.org/" text="Linux" />
238283
<SkillChip href="https://www.docker.com/" text="Docker" />
239284
<SkillChip href="https://github.com/" text="Git & GitHub" />
240-
<SkillChip href="https://www.markdownguide.org/" text="Markdown" />
285+
<SkillChip
286+
href="https://www.markdownguide.org/"
287+
text="Markdown"
288+
/>
241289
<SkillChip href="https://godotengine.org/" text="Godot" />
242-
<SkillChip href="https://code.visualstudio.com/" text="VS Code" />
290+
<SkillChip
291+
href="https://code.visualstudio.com/"
292+
text="VS Code"
293+
/>
243294
<SkillChip href="https://www.qt.io/" text="QT" />
244-
<SkillChip href="https://textual.textualize.io/" text="Textual" />
295+
<SkillChip
296+
href="https://textual.textualize.io/"
297+
text="Textual"
298+
/>
245299
</div>
246300
</div>
247301
</div>

0 commit comments

Comments
 (0)