aboutsummaryrefslogtreecommitdiff
path: root/examples/clock/style.css
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-01-21 19:34:49 +0530
committerAkshay Nair <phenax5@gmail.com>2024-01-21 19:34:49 +0530
commite4db8ebdd6a36df0b3d76504d18d8f183fe46ba9 (patch)
tree807071e55e97d8169158c896822cc57c023c9af1 /examples/clock/style.css
parentc9075367a178644d12a179919aa07616938b7315 (diff)
downloadcss-everything-e4db8ebdd6a36df0b3d76504d18d8f183fe46ba9.tar.gz
css-everything-e4db8ebdd6a36df0b3d76504d18d8f183fe46ba9.zip
feat: adds example for calculator
Diffstat (limited to 'examples/clock/style.css')
-rw-r--r--examples/clock/style.css26
1 files changed, 17 insertions, 9 deletions
diff --git a/examples/clock/style.css b/examples/clock/style.css
index 110d95b..4115723 100644
--- a/examples/clock/style.css
+++ b/examples/clock/style.css
@@ -15,6 +15,13 @@
));
}
+html, body {
+ margin: 0;
+ padding: 0;
+ background-color: #0f172a;
+ color: #e2e8f0;
+}
+
body * { box-sizing: border-box; }
#digital {
@@ -38,7 +45,7 @@ body * { box-sizing: border-box; }
#digital::after { content: var(--text); }
#analog {
- border: 1px solid red;
+ background-color: #1e293b;
width: 200px;
height: 200px;
margin: 1rem auto;
@@ -50,25 +57,26 @@ body * { box-sizing: border-box; }
--cssx-on-mount: update(--date, call(--get-date));
--cssx-on-update:
- update('[data-element=seconds]', --angle, js-eval("360 * new Date().getSeconds() / 60 - 90"))
- update('[data-element=minutes]', --angle, js-eval("360 * new Date().getMinutes() / 60 - 90"))
- update('[data-element=hours]', --angle,
- js-eval("360 * (new Date().getHours() % 12) / 12 - 90 + (30 * new Date().getMinutes() / 60)")
- )
+ update('[data-element=seconds]', --angle, calc(360 * js-eval("new Date().getSeconds()")/60 - 90))
+ update('[data-element=minutes]', --angle, calc(360 * js-eval("new Date().getMinutes()")/60 - 90))
+ update('[data-element=hours]', --angle, calc(
+ 360 * js-eval("new Date().getHours() % 12")/12 - 90
+ + (30 * js-eval("new Date().getMinutes()")/60)
+ ))
delay(1s)
update(--date, call(--get-date));
}
[data-element=seconds].analog-clock-hand {
- --color: pink;
+ --color: #cbd5e1;
--size: 70px;
}
[data-element=minutes].analog-clock-hand {
- --color: red;
+ --color: #991b1b;
--size: 60px;
}
[data-element=hours].analog-clock-hand {
- --color: blue;
+ --color: #4f46e5;
--size: 40px;
height: 4px;
}