diff options
| author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-07-03 21:13:11 -0700 |
|---|---|---|
| committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-07-03 21:13:11 -0700 |
| commit | ba27fd58baadc7c83276b5bf9af19c65744fff25 (patch) | |
| tree | 2b878cf29e217129f405b5264db724134527c168 /timers.org | |
| parent | 5619ad61667dd1a974bf491107b3e73ed333c358 (diff) | |
| download | simponic.xyz-main.tar.gz simponic.xyz-main.zip | |
Diffstat (limited to 'timers.org')
| -rw-r--r-- | timers.org | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/timers.org b/timers.org new file mode 100644 index 0000000..de76361 --- /dev/null +++ b/timers.org @@ -0,0 +1,39 @@ +#+TITLE: simponic's timers + +#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="/css/style.css" /> +#+HTML_HEAD_EXTRA: <meta name="viewport" content="width=device-width, initial-scale=1"> + +#+OPTIONS: inlineimages toc:nil +#+STARTUP: fold + +#+BEGIN_EXPORT html +<script> + +const timers = [ +['see riley :3', '2023-08-01'], +['20th birthday', '2023-08-18'], +['graduation', '2023-12-15'], +]; + +timers.map( +([title, date]) => ([title, new Date( +date.toLocaleString('en-US', { timeZone: 'America/Boise' }) +)]) +).forEach(([title, date]) => { + +const titleId = `${title}-title`; +const timerId = `${title}-timer`; + +const template = `<div><h1 id='${titleId}'>${title}</h1><p>in: <span id='${timerId}'></span> ms</p></div>`; +document.getElementById("content").innerHTML += template; + +setInterval(() => { +const msTill = date.getTime() - new Date().getTime(); +document.getElementById(timerId).innerHTML = msTill; + +}, 60 / 1000); +} +); + +</script> +#+END_EXPORT |
