summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js')
-rw-r--r--public/js/nav_highlight.js9
-rw-r--r--public/js/splides.js6
2 files changed, 15 insertions, 0 deletions
diff --git a/public/js/nav_highlight.js b/public/js/nav_highlight.js
new file mode 100644
index 0000000..b8ebb09
--- /dev/null
+++ b/public/js/nav_highlight.js
@@ -0,0 +1,9 @@
+document.addEventListener( 'DOMContentLoaded', function() {
+ var url = window.location.href;
+ var navs = document.getElementsByTagName("nav")[0].getElementsByTagName("a");
+ for (var i = 0; i < navs.length; i++) {
+ if (url.startsWith(navs[i].href)) {
+ navs[i].classList.add('active');
+ }
+ }
+});
diff --git a/public/js/splides.js b/public/js/splides.js
new file mode 100644
index 0000000..0a4faae
--- /dev/null
+++ b/public/js/splides.js
@@ -0,0 +1,6 @@
+document.addEventListener( 'DOMContentLoaded', function() {
+ var splides = document.getElementsByClassName("splide");
+ for (var i = 0; i < splides.length; i++) {
+ new Splide(splides[i]).mount();
+ }
+}); \ No newline at end of file