diff options
author | Jonathan Tschanter <jmtw@tutanota.de> | 2022-01-22 21:24:24 +0100 |
---|---|---|
committer | Jonathan Tschanter <jmtw@tutanota.de> | 2022-01-22 21:24:24 +0100 |
commit | 10c86197f1f63e222dfc9e937911e35ab500a208 (patch) | |
tree | 388ca37920808a66697385c6d69cf6a76e5aaf7b /public/js | |
parent | 432bba3dee1d9be25b9626ac45115929a6422961 (diff) |
Adds edit cards and templates to include
Diffstat (limited to 'public/js')
-rw-r--r-- | public/js/nav_highlight.js | 9 | ||||
-rw-r--r-- | public/js/splides.js | 6 |
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 |