Skip to content

Commit

Permalink
Merge pull request #8 from NE-Collegiate-Cyber-Defense-League/add-cou…
Browse files Browse the repository at this point in the history
…ntdown-shortcode

Add countdown shortcode
  • Loading branch information
andrew-aiken authored Sep 10, 2024
2 parents 8f0860a + 81662d9 commit 74cb6d5
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 10 deletions.
2 changes: 1 addition & 1 deletion content/en/about/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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].
3 changes: 0 additions & 3 deletions content/en/history/2023/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ Brought to you by

{{< image src="/images/league-members/umass_lowell.png" alt="Umass Lowell Logo" width="25%" height="auto" >}}

## Was Syracuse in 2023? I see there resources submission...

---

{{<toc>}}
Expand Down Expand Up @@ -104,7 +102,6 @@ Additional the source code for the regionals inject #13 can be [found here](http
- [Pace University](https://github.com/bergcybersec/pace-ccdc-2023)
- [Rochester Institute of Technology](https://github.com/orgs/CCDC-RIT/repositories)
- [Roger Williams University](https://github.com/CIC-RWU/CIC-Scripts)
- [Syracuse University](https://github.com/suinfosecclub/ccdc-2023)
- [University at Buffalo](https://github.com/ubnetdef/CCDC)
- [University of Maine](https://github.com/UMCST/CCDC2023-UMaine-Playbook)
- [University of Massachusetts Lowell](https://github.com/UML-Cyber-Security/ccdc2023)
2 changes: 1 addition & 1 deletion content/en/history/2024/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ Source code for the creation of the 2024 competitions can be found in our GitHub
- [Rochester Institute of Technology](https://github.com/orgs/CCDC-RIT/repositories)
- [Roger Williams University](https://github.com/CIC-RWU/CIC-Scripts)
- [University of Maine](https://github.com/UMCST/CCDC2024-UMaine-Playbook)
- [University of Massachusetts Lowell](https://github.com/UML-Cyber-Security/ccdc2024)
- [University of Massachusetts Lowell](https://github.com/UML-Cyber-Security/ccdc2024)
10 changes: 5 additions & 5 deletions content/en/history/2025/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ includeInList: false
Planning to plan for the NECCDC 2025 is underway!
{{< /intro >}}

<!-- ---
{{<toc>}}
{{< spacer 10 >}}

---

## Information Packets
{{< centered "h2" >}}
2025 Kickoff Meeting
{{< /centered >}}

{{< resources style="code" sort="desc" />}} -->
{{< countdown "2024-10-18T18:00:00" >}}
5 changes: 5 additions & 0 deletions layouts/shortcodes/centered.html
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>
37 changes: 37 additions & 0 deletions layouts/shortcodes/countdown.html
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>

0 comments on commit 74cb6d5

Please sign in to comment.