-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from NE-Collegiate-Cyber-Defense-League/add-cou…
…ntdown-shortcode Add countdown shortcode
- Loading branch information
Showing
6 changed files
with
49 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,4 @@ The NECCDL relies on the support of league member institutions and sponsors in o | |
|
||
For more information on becoming a League supporter, please contact us at [email protected] | ||
|
||
Annual competitions are also made possible by a dedicated cadre of volunteers, if you or your organization are interested in volunteering for the league or in the cyber defense competition, please contact us at [email protected] or visit the volunteering page. | ||
Annual competitions are also made possible by a dedicated cadre of volunteers, if you or your organization are interested in volunteering for the league or in the cyber defense competition, please contact us at [email protected]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{{ $size := .Get 0 | default "h2" }} | ||
|
||
<div style="text-align: center;"> | ||
{{ printf "<%s>%s</%s>" $size (.Inner | safeHTML) $size | safeHTML }} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!-- layouts/shortcodes/countdown.html --> | ||
|
||
<div id="countdown"></div> | ||
|
||
<style> | ||
#countdown { | ||
font-size: 3em; | ||
color: #333; | ||
text-align: center; | ||
margin: 20px 0; | ||
} | ||
</style> | ||
|
||
<script> | ||
function countdownTimer() { | ||
var endDate = new Date("{{ .Get 0 }}").getTime(); | ||
var x = setInterval(function() { | ||
var now = new Date().getTime(); | ||
var distance = endDate - now; | ||
|
||
var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | ||
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | ||
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | ||
var seconds = Math.floor((distance % (1000 * 60)) / 1000); | ||
|
||
document.getElementById("countdown").innerHTML = days + "d " + hours + "h " + | ||
minutes + "m " + seconds + "s "; | ||
|
||
if (distance < 0) { | ||
clearInterval(x); | ||
document.getElementById("countdown").innerHTML = "Show Time!"; | ||
} | ||
}, 1000); | ||
} | ||
|
||
countdownTimer(); | ||
</script> |