From a544fa48e2248996002e059ca07ad620d2aec3a8 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Sat, 18 Jan 2020 20:19:52 -0500 Subject: [PATCH] v0.3.5 --- DESCRIPTION | 2 +- NEWS.md | 8 +++++++ docs/default-timer/index.html | 2 +- .../default-timer/lib/countdown/countdown.css | 1 - docs/default-timer/lib/countdown/countdown.js | 21 +++++++----------- docs/fullscreen/index.html | 2 +- docs/fullscreen/lib/countdown/countdown.css | 1 - docs/fullscreen/lib/countdown/countdown.js | 21 +++++++----------- docs/index.html | 22 +++++++++---------- docs/libs/countdown/countdown.css | 1 - docs/libs/countdown/countdown.js | 21 +++++++----------- 11 files changed, 46 insertions(+), 56 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4d6b27e..518de2b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: countdown Title: A Countdown Timer for R Markdown HTML Presentations and Documents -Version: 0.3.4 +Version: 0.3.5 Authors@R: person(given = "Garrick", family = "Aden-Buie", diff --git a/NEWS.md b/NEWS.md index 70e06c0..c825abe 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +# countdown 0.3.5 + +* Any sound file hosted online can no be played in place of the default sound + by setting `play_sound` to the absolute or relative URL of the sound file. + +* The default CSS styles were updated for better automatic vertical centering + of the countdown digits. + # countdown 0.3.3 * Added `.countdown-time` class to `` element of timer. Renamed `.digits` diff --git a/docs/default-timer/index.html b/docs/default-timer/index.html index e5cb80b..45d8385 100644 --- a/docs/default-timer/index.html +++ b/docs/default-timer/index.html @@ -8,7 +8,7 @@ -
+
00:15
diff --git a/docs/default-timer/lib/countdown/countdown.css b/docs/default-timer/lib/countdown/countdown.css index 39ce7cc..1780578 100644 --- a/docs/default-timer/lib/countdown/countdown.css +++ b/docs/default-timer/lib/countdown/countdown.css @@ -26,7 +26,6 @@ } .countdown-digits { color: inherit; - vertical-align: text-bottom; } .countdown.running { border-color: #3C9A5F; diff --git a/docs/default-timer/lib/countdown/countdown.js b/docs/default-timer/lib/countdown/countdown.js index e87e657..0423eaa 100644 --- a/docs/default-timer/lib/countdown/countdown.js +++ b/docs/default-timer/lib/countdown/countdown.js @@ -100,8 +100,9 @@ var counter_update_all = function() { update_timer(counters.timer[i]); // Play countdown sound if data-audio=true on container div - if (counters.timer[i].div.dataset.audio && counters.timer[i].value == 5) { - counter_play_sound(); + let audio = counters.timer[i].div.dataset.audio + if (audio && counters.timer[i].value == 5) { + counter_play_sound(audio); } } } @@ -117,18 +118,12 @@ var counter_update_all = function() { } } -var counter_play_sound = function() { - try { - var finished_sound = new Audio('libs/countdown/smb_stage_clear.mp3'); - finished_sound.play(); - } catch (e) { - try { - var finished_sound = new Audio('smb_stage_clear.mp3'); - finished_sound.play(); - } catch (e) { - console.log("Unable to locate sound file smb_stage_clear.mp3.") - } +var counter_play_sound = function(url) { + if (typeof url === 'boolean') { + url = 'libs/countdown/smb_stage_clear.mp3'; } + sound = new Audio(url); + sound.play(); } var counter_addEventListener = function() { diff --git a/docs/fullscreen/index.html b/docs/fullscreen/index.html index 9673791..6cc17b6 100644 --- a/docs/fullscreen/index.html +++ b/docs/fullscreen/index.html @@ -8,7 +8,7 @@ -
+
00:15
diff --git a/docs/fullscreen/lib/countdown/countdown.css b/docs/fullscreen/lib/countdown/countdown.css index 8537002..2f97006 100644 --- a/docs/fullscreen/lib/countdown/countdown.css +++ b/docs/fullscreen/lib/countdown/countdown.css @@ -26,7 +26,6 @@ } .countdown-digits { color: inherit; - vertical-align: text-bottom; } .countdown.running { border-color: #3C9A5F; diff --git a/docs/fullscreen/lib/countdown/countdown.js b/docs/fullscreen/lib/countdown/countdown.js index e87e657..0423eaa 100644 --- a/docs/fullscreen/lib/countdown/countdown.js +++ b/docs/fullscreen/lib/countdown/countdown.js @@ -100,8 +100,9 @@ var counter_update_all = function() { update_timer(counters.timer[i]); // Play countdown sound if data-audio=true on container div - if (counters.timer[i].div.dataset.audio && counters.timer[i].value == 5) { - counter_play_sound(); + let audio = counters.timer[i].div.dataset.audio + if (audio && counters.timer[i].value == 5) { + counter_play_sound(audio); } } } @@ -117,18 +118,12 @@ var counter_update_all = function() { } } -var counter_play_sound = function() { - try { - var finished_sound = new Audio('libs/countdown/smb_stage_clear.mp3'); - finished_sound.play(); - } catch (e) { - try { - var finished_sound = new Audio('smb_stage_clear.mp3'); - finished_sound.play(); - } catch (e) { - console.log("Unable to locate sound file smb_stage_clear.mp3.") - } +var counter_play_sound = function(url) { + if (typeof url === 'boolean') { + url = 'libs/countdown/smb_stage_clear.mp3'; } + sound = new Audio(url); + sound.play(); } var counter_addEventListener = function() { diff --git a/docs/index.html b/docs/index.html index 67a9f89..73088df 100644 --- a/docs/index.html +++ b/docs/index.html @@ -15,7 +15,7 @@ # countdown ## ⏲ :: 💭 💬 👩‍💻 :: ⏰ ### github.com/gadenbuie/countdown -### 0.3.4
2020-01-11 +### 0.3.5
2020-01-18 --- @@ -34,7 +34,7 @@ <p style="margin: 11em 0;"></p> -
+
00:42
@@ -234,7 +234,7 @@ countdown(minutes = 0, seconds = 7, bottom = 0) ``` -
+
00:07
@@ -244,7 +244,7 @@ countdown(minutes = 0, seconds = 13, top = 0) ``` -
+
00:13
@@ -254,7 +254,7 @@ countdown::countdown(minutes = 0, seconds = 21, left = 0) ``` -
+
00:21
@@ -280,7 +280,7 @@ font_size = "6em") ``` -
+
01:30
@@ -311,7 +311,7 @@ -- -
+
01:30
@@ -333,7 +333,7 @@ countdown(minutes = 1, update_every = 15, right = "33%") ``` -