diff options
| author | Debulois <quentin@debulois.fr> | 2022-04-04 22:58:43 +0200 |
|---|---|---|
| committer | Debulois <quentin@debulois.fr> | 2022-04-04 22:58:43 +0200 |
| commit | 5582d242d03692a7e1b2c631e1b4ff3f52e8b72c (patch) | |
| tree | c1e0242053a46d7b4145111a78a3e86e3cfd2f0d /Static/Js/main.js | |
| parent | b637d625216e50602d0bde8a544c281ca00af5fa (diff) | |
Révision complète du css et modification du js principalement
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 |
