diff options
Diffstat (limited to 'Static/Js/main.js')
| -rw-r--r-- | Static/Js/main.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Static/Js/main.js b/Static/Js/main.js new file mode 100644 index 0000000..7f3935c --- /dev/null +++ b/Static/Js/main.js @@ -0,0 +1,29 @@ +// **************************************************************************** +// Main +// **************************************************************************** + +// Site web utilisés pour JS: +// https://www.w3schools.com/js/default.asp +// https://stackoverflow.com/ + +// Changement de langue +document.getElementById("navSelLang").addEventListener("change", () => { + document.getElementById("navFormLang").submit(); +}); + +// TODO: A commenter +function show(parentId, element, id, className) { + let elements = document.getElementById(parentId).getElementsByTagName(element); + elements[id].classList.add(className); + for (i = 0; i < elements.length; i++) { + if (elements[i].id !== id) { + elements[i].classList.remove(className); + } + } +} + +function showNavButtons() { + document.getElementsByTagName("nav")[0].classList.toggle("showNav") + // first-child à chaque fois + document.getElementsByTagName("header")[0].getElementsByTagName("a")[0].getElementsByTagName("i")[0].classList.toggle("navLinkClicked") +}
\ No newline at end of file |
