diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index e3c7fe037..fb0be8721 100755 --- a/app/scodoc/sco_formsemestre_status.py +++ b/app/scodoc/sco_formsemestre_status.py @@ -484,7 +484,9 @@ def formsemestre_status_menubar(formsemestre: FormSemestre | None) -> str: "Liens": formsemestre_custommenu_html(formsemestre_id), } - return render_template("formsemestre/menu.j2", menu=menus) + return render_template( + "formsemestre/menu.j2", menu=menus, formsemestre=formsemestre + ) # Element HTML decrivant un semestre (barre de menu et infos) diff --git a/app/static/css/scodoc97.css b/app/static/css/scodoc97.css index c97b98db4..a32528d98 100644 --- a/app/static/css/scodoc97.css +++ b/app/static/css/scodoc97.css @@ -80,10 +80,13 @@ .app-corner .scodoc-index, .app-corner .scodoc-index a { font-size: 14pt; - display: inline; + display: flex; color: rgb(4, 16, 159); + justify-content: center; + width: 100%; } + .hamburger-menu { display: none; flex-direction: column; @@ -157,8 +160,7 @@ @media screen and (max-width: 768px), print { - #sidebar, - div.toggle-sidebar { + .toggle-sidebar { display: none; } @@ -166,6 +168,37 @@ print { grid-column-start: 1; grid-column-end: 3; } + + div#sidebar { + position: fixed; + width: 100vw; + height: 100vh; + background: whitesmoke; + z-index: 900; + display: flex !important; + flex-direction: column; + align-items: center; + gap: 4px; + text-align: center; + left: -100%; + transition: left 400ms ease; + + padding-top: 15vh; + } + + div#sidebar[aria-expanded="true"] { + left: 0; + } + + [ordi="true"] { + display: none !important; + } +} + +@media screen and (min-width: 769px) { + [mobile="true"] { + display: none !important; + } } /* Sidebar */ @@ -204,4 +237,35 @@ print { height: 100%; margin-left: 10px; margin-bottom: 10px; +} + +/*Mobile Navbar*/ + +#logo-scodoc { + --size: 48px; + width: var(--size); + height: var(--size); + margin: 4px; + cursor: pointer; +} + +#mobileNav { + position: sticky; + top: 0; + z-index: 1000; + display: flex; + justify-content: space-evenly; + align-items: center; + + /* From https://css.glass */ + background: rgba(255, 255, 255, 0.2); + border-radius: 16px; + box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); + backdrop-filter: blur(5px); + -webkit-backdrop-filter: blur(5px); + border: 1px solid rgba(255, 255, 255, 0.3); +} + +body { + position: relative; } \ No newline at end of file diff --git a/app/static/icons/logo.png b/app/static/icons/logo.png new file mode 100644 index 000000000..46e39ffcc Binary files /dev/null and b/app/static/icons/logo.png differ diff --git a/app/templates/formsemestre/menu.j2 b/app/templates/formsemestre/menu.j2 index 792957ada..cc60c22a7 100644 --- a/app/templates/formsemestre/menu.j2 +++ b/app/templates/formsemestre/menu.j2 @@ -201,13 +201,9 @@ /* Menu toggle button styles for mobile */ .sco-formsemestre-menu-toggle { display: block; - background-color: var(--sco-formsemestre-color-accent); + background-color: var(--sco-formsemestre-color-primary); padding: 10px; border-radius: 5px; - position: absolute; - top: 10px; - right: 10px; - z-index: 1000; } .sco-formsemestre-menu-toggle-icon { @@ -225,7 +221,7 @@ height: 100vh; background-color: var(--sco-formsemestre-color-primary); box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2); - padding: 2rem 1rem; + padding: 4rem 1rem; transition: right 0.3s ease-in-out; z-index: 999; overflow-y: scroll; @@ -371,6 +367,8 @@ const navbarMenu = document.querySelector(".sco-formsemestre-menu-menu"); const dropdownItems = document.querySelectorAll(".dropdown"); + document.getElementById('mobileNav').append(document.getElementById('titre-court-sem')); + document.getElementById('mobileNav').append(navbarToggle); // Affichage du menu mobile au clic navbarToggle.addEventListener("click", () => { @@ -453,7 +451,12 @@