From 3679b59a03fdc68a2709ae344d3ad26d3e47146d Mon Sep 17 00:00:00 2001 From: John Doe Date: Mon, 3 Nov 2025 06:12:44 +0100 Subject: [PATCH] add responsive design for phone --- static/pywallter.css | 81 +++++++++++++++++++++++++++++++---- templates/_header.html | 22 ++++++++-- templates/_nav_userlogin.html | 32 +++++++------- 3 files changed, 107 insertions(+), 28 deletions(-) diff --git a/static/pywallter.css b/static/pywallter.css index b52d777..c9d9c0b 100644 --- a/static/pywallter.css +++ b/static/pywallter.css @@ -1,4 +1,5 @@ + body { display: grid; @@ -11,14 +12,12 @@ body "Menu Menu footer footer footer footer footer" } - -header{ - grid-area: header; - width: 100%; +.menu-button { + visibility: hidden; } -body > main { - width: 100%; +header { + grid-area: header; } main @@ -40,6 +39,74 @@ main > nav } + +@media only screen and (max-width: 600px) +{ + body { + grid-template-areas: + "header" + "main " + "footer"; + } + + .menu-header { + font-size: 4vw; + width: 20vw; + height: 31vw; + } + + .menu-button { + visibility: visible; + } + + .hide-menu { + grid-template-areas: + "header" + "main " + "footer"; + } + + .print-menu + { + grid-template-areas: + "header" + "Menu" + "main" + "main" + "footer"; + } + + .print-menu > aside { + max-width: unset; + } + + aside > nav { + margin-left: 30px; + } + + nav ul { + display: flex; + flex-wrap: wrap; + align-content: center; + text-align: center; + gap: 20px; + } + + nav li { + word-break: keep-all; + width: 115px; + height: 100px; + + } + + nav .icons { + width: 80px; + height: 50px; + } + +} + + aside { grid-area: Menu; @@ -112,7 +179,6 @@ header > nav { } aside > nav { - padding-left: 1.5vw; } @@ -152,4 +218,3 @@ nav > ul:first-of-type, ul color: var(--pico-color-grey-950); } - diff --git a/templates/_header.html b/templates/_header.html index d2db473..d2f64a0 100644 --- a/templates/_header.html +++ b/templates/_header.html @@ -1,21 +1,26 @@
+ + diff --git a/templates/_nav_userlogin.html b/templates/_nav_userlogin.html index 3f8ed05..61a0173 100644 --- a/templates/_nav_userlogin.html +++ b/templates/_nav_userlogin.html @@ -8,43 +8,43 @@ Mon blog + - - +

Mes fichiers

@@ -57,12 +57,12 @@