aboutsummaryrefslogtreecommitdiff
path: root/public/face.js
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2020-10-22 20:27:55 -0400
committerPaul Duncan <pabs@pablotron.org>2020-10-22 20:27:55 -0400
commitd7f387ac1f49015922aeec7f5cb8fc29af832e05 (patch)
treef783540bb06d3cbded8d76c688a313ff48d0ef31 /public/face.js
parentb280f4d8dfacffe2ac8864334c69a48cfe03070e (diff)
downloadalonzo-mood-calculator-d7f387ac1f49015922aeec7f5cb8fc29af832e05.tar.bz2
alonzo-mood-calculator-d7f387ac1f49015922aeec7f5cb8fc29af832e05.zip
add wednesday-modeHEADmaster
Diffstat (limited to 'public/face.js')
-rw-r--r--public/face.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/public/face.js b/public/face.js
index d565481..7d873ec 100644
--- a/public/face.js
+++ b/public/face.js
@@ -194,7 +194,7 @@ jQuery(function($) {
function tick() {
$('#face').css(get_frame(
(new Date()).getTime(),
- +$('#rate').val()
+ ($('#wednesday-mode').is(':checked') ? -20 : +$('#rate').val())
).css);
}
@@ -226,6 +226,18 @@ jQuery(function($) {
return false;
});
+ $('#wednesday-mode').click(function() {
+ var me = $(this);
+ setTimeout(function() {
+ $('body').toggleClass('wednesday-mode', me.is(':checked'));
+ }, 10);
+ });
+
+ // toggle wednesday mode on wednesdays
+ if ((new Date()).getDay() == 3) {
+ $('#wednesday-mode').click();
+ }
+
// fetch current price as percent and populate #rate
fetch(DATA_URL).then(function(r) {
return r.json();