summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorlxf <sng@luxagraf.net>2022-01-29 11:38:04 -0500
committerlxf <sng@luxagraf.net>2022-01-29 11:38:04 -0500
commit6fc9e4362d58ba1c891d0ea6314fd8174f34ee21 (patch)
tree6d4e751a049a633dcbad7dd40f68110626ebfae1 /templates
parent922b65d27f48fd0b978ee8dc74e39d633e4b38f0 (diff)
main: added js to change the slogan to safety third on odd days
Diffstat (limited to 'templates')
-rw-r--r--templates/base.html13
1 files changed, 12 insertions, 1 deletions
diff --git a/templates/base.html b/templates/base.html
index 53dda3f..bb36ce2 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -25,7 +25,7 @@
<header class="header-wrapper">
<div id="logo">
<a class="logo-link" href="/" title="Home">Luxagraf</a>
- <span class="sitesubtitle">{%block sitesubtitle %}Walk Slowly{% endblock%}</span>
+ <span class="sitesubtitle" id="slogan">{%block sitesubtitle %}Walk Slowly{% endblock%}</span>
</div>
<nav>
<a class="nav-item smcaps" href="{% url "jrnl:list" %}" title="Stories of life on the road.">Jrnl</a>
@@ -52,4 +52,15 @@
</footer>
{% block js %}{% endblock%}
</body>
+<script>
+function isOdd(num) { return num % 2;}
+document.addEventListener("DOMContentLoaded", function(event) {
+ var today = new Date();
+ var dd = String(today.getDate())
+ if (isOdd(dd)) {
+ var slogan = document.getElementById("slogan");
+ slogan.innerHTML = "Safety Third";
+ }
+});
+</script>
</html>