Skip to content

Commit

Permalink
v0.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Jan 19, 2020
1 parent 05bfa41 commit a544fa4
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 56 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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 `<code>` element of timer. Renamed `.digits`
Expand Down
2 changes: 1 addition & 1 deletion docs/default-timer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

</head>
<body>
<div class="countdown" id="timer_5e1a8b09" style="top:0;left:0;" data-warnwhen="5">
<div class="countdown" id="timer_5e23b0bc" style="top:0;left:0;" data-warnwhen="5">
<code class="countdown-time"><span class="countdown-digits minutes">00</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">15</span></code>
</div>
</body>
Expand Down
1 change: 0 additions & 1 deletion docs/default-timer/lib/countdown/countdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
}
.countdown-digits {
color: inherit;
vertical-align: text-bottom;
}
.countdown.running {
border-color: #3C9A5F;
Expand Down
21 changes: 8 additions & 13 deletions docs/default-timer/lib/countdown/countdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion docs/fullscreen/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

</head>
<body>
<div class="countdown" id="timer_5e1a8bfd" style="top:0;right:0;bottom:0;left:0;margin:0;padding:0;font-size:30vw;" data-warnwhen="5">
<div class="countdown" id="timer_5e23ae8d" style="top:0;right:0;bottom:0;left:0;margin:0;padding:0;font-size:30vw;" data-warnwhen="5">
<code class="countdown-time"><span class="countdown-digits minutes">00</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">15</span></code>
</div>
</body>
Expand Down
1 change: 0 additions & 1 deletion docs/fullscreen/lib/countdown/countdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
}
.countdown-digits {
color: inherit;
vertical-align: text-bottom;
}
.countdown.running {
border-color: #3C9A5F;
Expand Down
21 changes: 8 additions & 13 deletions docs/fullscreen/lib/countdown/countdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand All @@ -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() {
Expand Down
22 changes: 11 additions & 11 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# <code style='font-size: 200%'>countdown</code>
## ⏲ :: 💭 💬 👩‍💻 :: ⏰
### <a href='https://github.com/gadenbuie/countdown' style='color: #d33682;'>github.com/gadenbuie/countdown</a>
### <span style="color: #b58900;">0.3.4</span><br/><span style="color: #2aa198">2020-01-11</span>
### <span style="color: #b58900;">0.3.5</span><br/><span style="color: #2aa198">2020-01-18</span>

---

Expand All @@ -34,7 +34,7 @@

&lt;p style="margin: 11em 0;"&gt;&lt;/p&gt;

<div class="countdown" id="timer_5e1a8c0a" style="top:26%;right:33%;" data-audio="true" data-warnwhen="0">
<div class="countdown" id="timer_5e23b206" style="top:26%;right:33%;" data-audio="true" data-warnwhen="0">
<code class="countdown-time"><span class="countdown-digits minutes">00</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">42</span></code>
</div>

Expand Down Expand Up @@ -234,7 +234,7 @@
countdown(minutes = 0, seconds = 7, bottom = 0)
```

<div class="countdown" id="timer_5e1a8a95" style="right:0;bottom:0;" data-warnwhen="0">
<div class="countdown" id="timer_5e23b027" style="right:0;bottom:0;" data-warnwhen="0">
<code class="countdown-time"><span class="countdown-digits minutes">00</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">07</span></code>
</div>

Expand All @@ -244,7 +244,7 @@
countdown(minutes = 0, seconds = 13, top = 0)
```

<div class="countdown" id="timer_5e1a8ad7" style="top:0;right:0;" data-warnwhen="0">
<div class="countdown" id="timer_5e23af0b" style="top:0;right:0;" data-warnwhen="0">
<code class="countdown-time"><span class="countdown-digits minutes">00</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">13</span></code>
</div>

Expand All @@ -254,7 +254,7 @@
countdown::countdown(minutes = 0, seconds = 21, left = 0)
```

<div class="countdown" id="timer_5e1a8a66" style="bottom:0;left:0;" data-warnwhen="0">
<div class="countdown" id="timer_5e23b0e7" style="bottom:0;left:0;" data-warnwhen="0">
<code class="countdown-time"><span class="countdown-digits minutes">00</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">21</span></code>
</div>

Expand All @@ -280,7 +280,7 @@
font_size = "6em")
```

<div class="countdown" id="timer_5e1a8bac" style="right:0;bottom:0;left:0;margin:5%;padding:50px;font-size:6em;" data-warnwhen="0">
<div class="countdown" id="timer_5e23b0d0" style="right:0;bottom:0;left:0;margin:5%;padding:50px;font-size:6em;" data-warnwhen="0">
<code class="countdown-time"><span class="countdown-digits minutes">01</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">30</span></code>
</div>

Expand Down Expand Up @@ -311,7 +311,7 @@

--

<div class="countdown" id="timer_5e1a8a9a" style="top:0;right:0;bottom:0;left:0;margin:5%;font-size:8em;" data-warnwhen="0">
<div class="countdown" id="timer_5e23afa2" style="top:0;right:0;bottom:0;left:0;margin:5%;font-size:8em;" data-warnwhen="0">
<code class="countdown-time"><span class="countdown-digits minutes">01</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">30</span></code>
</div>

Expand All @@ -333,7 +333,7 @@
countdown(minutes = 1, update_every = 15, right = "33%")
```

<div class="countdown blink-colon noupdate-15" id="timer_5e1a8cd4" style="right:33%;bottom:0;" data-warnwhen="0">
<div class="countdown blink-colon noupdate-15" id="timer_5e23b235" style="right:33%;bottom:0;" data-warnwhen="0">
<code class="countdown-time"><span class="countdown-digits minutes">01</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">00</span></code>
</div>

Expand All @@ -348,7 +348,7 @@
countdown(0, 10, warn_when = 5, right = "33%", bottom = "33%")
```

<div class="countdown" id="timer_5e1a8b2a" style="right:33%;bottom:33%;" data-warnwhen="5">
<div class="countdown" id="timer_5e23ae9b" style="right:33%;bottom:33%;" data-warnwhen="5">
<code class="countdown-time"><span class="countdown-digits minutes">00</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">10</span></code>
</div>

Expand All @@ -366,7 +366,7 @@
Each countdown timer element looks something like this:

````html
&lt;div class="countdown" id="timer_5e1a89af" style="right:0;bottom:0;" data-warnwhen="0"&gt;
&lt;div class="countdown" id="timer_5e23b145" style="right:0;bottom:0;" data-warnwhen="0"&gt;
&lt;code class="countdown-time"&gt;
&lt;span class="countdown-digits minutes"&gt;03&lt;/span&gt;
&lt;span class="countdown-digits colon"&gt;:&lt;/span&gt;
Expand Down Expand Up @@ -451,7 +451,7 @@
countdown(0, 10, play_sound = TRUE)
```

<div class="countdown" id="timer_5e1a8a57" style="right:0;bottom:0;" data-audio="true" data-warnwhen="0">
<div class="countdown" id="timer_5e23af8c" style="right:0;bottom:0;" data-audio="true" data-warnwhen="0">
<code class="countdown-time"><span class="countdown-digits minutes">00</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">10</span></code>
</div>

Expand Down
1 change: 0 additions & 1 deletion docs/libs/countdown/countdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
}
.countdown-digits {
color: #d33682;
vertical-align: text-bottom;
}
.countdown.running {
border-color: #259088;
Expand Down
21 changes: 8 additions & 13 deletions docs/libs/countdown/countdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand All @@ -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() {
Expand Down

0 comments on commit a544fa4

Please sign in to comment.