Skip to content
Extraits de code Groupes Projets
Valider 8a449698 rédigé par Théo - Le Filament's avatar Théo - Le Filament
Parcourir les fichiers

add responsive and dark theme support

parent 1a6eac17
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Pipeline #314 réussi
...@@ -2,7 +2,13 @@ ...@@ -2,7 +2,13 @@
<a href="/" class="logo-link" rel="home" itemprop="url"> <a href="/" class="logo-link" rel="home" itemprop="url">
<img src="https://le-filament.com/img/logo-lefilament-H.svg" class="logo" alt="Le Filament" > <img src="https://le-filament.com/img/logo-lefilament-H.svg" class="logo" alt="Le Filament" >
</a> </a>
<div class="menu"> <div id="menu-toggle">
<input type="checkbox" />
<span></span>
<span></span>
<span></span>
<div id="menu">
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
<div class="menu-item"> <div class="menu-item">
<div class="menu-shadow"> <div class="menu-shadow">
...@@ -11,4 +17,5 @@ ...@@ -11,4 +17,5 @@
</div> </div>
{{ end }} {{ end }}
</div> </div>
</div>
</nav> </nav>
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{ .Content }} {{ .Content }}
</article> </article>
<aside>
{{ .TableOfContents }}
</aside>
<section class="post-taxonomy"> <section class="post-taxonomy">
<h3>Licence</h3> <h3>Licence</h3>
<div> <div>
......
...@@ -20,21 +20,18 @@ body, button, input, select, optgroup, textarea { ...@@ -20,21 +20,18 @@ body, button, input, select, optgroup, textarea {
} }
body { body {
height:100vh; min-height: 100vh;
margin:0; max-width: 800px;
margin: 0 auto;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background-color: #fff;
} }
a { a, a:visited {
color: #1C2F82; color: #1c2f82;
background-color: transparent; background-color: transparent;
text-decoration: none; text-decoration: none;
color: #1C2F82;
}
a:visited {
color: #1C2F82;
} }
p { p {
...@@ -50,21 +47,30 @@ img { ...@@ -50,21 +47,30 @@ img {
} }
nav { nav {
position: sticky;
top: 0;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
width: 800px; width: 800px;
margin: 25px auto; padding: 25px 0;
background-color: inherit;
border-bottom: solid #333 1px;
} }
nav .logo { nav .logo {
position: relative;
bottom: 5px;
width: 155px; width: 155px;
margin-top: 10px; margin-top: 10px;
z-index: 2;
}
nav a, nav a:visited {
color: #1c2f82;
} }
main { main {
width: auto;
max-width: 750px;
margin: 50px auto; margin: 50px auto;
} }
...@@ -115,12 +121,19 @@ blockquote p { ...@@ -115,12 +121,19 @@ blockquote p {
padding: 5px; padding: 5px;
} }
.menu { #menu-toggle input, #menu-toggle span {
display: none;
}
#menu {
display: flex; display: flex;
justify-content: flex-end; justify-content: space-between;
align-items: center; align-items: center;
width: 50%; width: 50%;
margin-left: 120px; }
.menu-item {
margin: 10px;
} }
.menu-item a { .menu-item a {
...@@ -141,14 +154,18 @@ blockquote p { ...@@ -141,14 +154,18 @@ blockquote p {
width: 85%; width: 85%;
cursor: pointer; cursor: pointer;
background-color: #FFD14C; background-color: #FFD14C;
padding-left: 3px; padding-left: 6px;
padding-top: 8px; padding-top: 10px;
} }
.post { .post {
margin: 50px 0; margin: 50px 0;
} }
.post a, .post a:visited {
color: #1c2f82;
}
.post-title { .post-title {
background-color: #ffd14c; background-color: #ffd14c;
border-radius: 1.2em; border-radius: 1.2em;
...@@ -167,11 +184,16 @@ blockquote p { ...@@ -167,11 +184,16 @@ blockquote p {
} }
.taxonomy { .taxonomy {
color: #1c2f82;
background-color: #ffd14c; background-color: #ffd14c;
border-radius: 1em; border-radius: 1em;
padding: 2px 12px; padding: 2px 12px;
} }
.taxonomy:visited {
color: #1c2f82;
}
.mastodon_button { .mastodon_button {
display: block; display: block;
width: 400px; width: 400px;
...@@ -185,6 +207,7 @@ blockquote p { ...@@ -185,6 +207,7 @@ blockquote p {
text-transform: uppercase; text-transform: uppercase;
text-decoration: none; text-decoration: none;
text-align: center; text-align: center;
cursor: pointer;
} }
.mastodon_button:visited { .mastodon_button:visited {
...@@ -219,3 +242,136 @@ footer .logo { ...@@ -219,3 +242,136 @@ footer .logo {
height: 20px; height: 20px;
margin: 10px; margin: 10px;
} }
@media only screen and (any-hover: none) and (max-width: 980px) {
nav {
width: auto;
padding: 10px 30px;
}
.menu {
flex-flow: column;
margin-left: 0;
margin-top: 20px;
}
main {
width: auto;
margin: 0 20px;
}
section {
margin: auto;
}
blockquote {
margin-left: 0;
margin-right: 0;
}
.post-info {
display: block;
margin-left: 20px;
}
.mastodon_button {
width: auto;
}
#menu-toggle {
display: block;
background-color: inherit;
user-select: none;
}
#menu-toggle input {
display: block;
width: 33px;
height: 26px;
position: absolute;
top: 16px;
right: 25px;
cursor: pointer;
opacity: 0;
z-index: 2;
}
#menu-toggle span {
position: relative;
display: block;
width: 33px;
height: 4px;
margin-bottom: 5px;
background: #cdcdcd;
border-radius: 3px;
z-index: 1;
transform-origin: 4px 0px;
transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
background 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
opacity 0.55s ease;
}
#menu-toggle span:first-child {
transform-origin: 0% 0%;
}
#menu-toggle span:nth-last-child(2) {
transform-origin: 0% 100%;
}
#menu-toggle input:checked ~ span {
opacity: 1;
transform: rotate(45deg) translate(-2px, -1px);
}
#menu-toggle input:checked ~ span:nth-last-child(3) {
opacity: 0;
transform: rotate(0deg) scale(0.2, 0.2);
}
#menu-toggle input:checked ~ span:nth-last-child(2) {
transform: rotate(-45deg) translate(0, -1px);
}
#menu {
position: absolute;
top: 0;
left: 0;
display: block;
width: 100vw;
padding-top: 75px;
padding-bottom: 10px;
background-color: inherit;
border-bottom: solid #333 1px;
transform-origin: 0% 0%;
transform: translate(0, -100%);
transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0);
}
.menu-item {
margin: 10px auto;
width: max-content;
}
#menu-toggle input:checked ~ #menu {
transform: none;
}
}
@media (prefers-color-scheme: dark) {
body {
background-color: #000;
}
body, button, input, select, optgroup, textarea, a, a:visited {
color: #fff;
}
nav {
width: 100%;
}
blockquote {
background-color: #fff1
}
}
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter