Fixes & améliorations du nouveau CSS (#616)

This commit is contained in:
Julien Constant 2023-04-05 18:03:43 +02:00 committed by GitHub
parent d83842af27
commit a198f5252d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 211 additions and 156 deletions

View File

@ -1,6 +1,15 @@
$hovered-text-color: #c2c2c2;
$text-color: white;
$background-color: #354a5f;
$background-color-hovered: #283747;
$red-text-color: #eb2f06;
$hovered-red-text-color: #ff4d4d;
.header { .header {
box-sizing: border-box; box-sizing: border-box;
background-color: #354a5f; background-color: $background-color;
box-shadow: 3px 3px 3px 0 #dfdfdf; box-shadow: 3px 3px 3px 0 #dfdfdf;
border-radius: 0; border-radius: 0;
width: 100%; width: 100%;
@ -24,11 +33,11 @@
gap: 10px; gap: 10px;
>a { >a {
color: #fff; color: $text-color;
} }
&:hover>a { &:hover>a {
color: #1a78b3; color: $hovered-text-color;;
} }
@media (max-width: 607px) { @media (max-width: 607px) {
@ -51,7 +60,7 @@
} }
&-text { &-text {
color: white; color: $text-color;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
@ -89,16 +98,16 @@
border-radius: 0; border-radius: 0;
margin: 0; margin: 0;
box-sizing: border-box; box-sizing: border-box;
background-color: #354a5f; background-color: $background-color;
width: 45px; width: 45px;
height: 25px; height: 25px;
padding: 0; padding: 0;
color: white; color: $text-color;
font-weight: normal; font-weight: normal;
line-height: 1.3em; line-height: 1.3em;
&:hover { &:hover {
background-color: #283747; background-color: $background-color-hovered;
} }
} }
} }
@ -126,13 +135,13 @@
align-items: center; align-items: center;
text-transform: uppercase; text-transform: uppercase;
text-decoration: none; text-decoration: none;
color: white; color: $text-color;
margin: 0; margin: 0;
font-size: .9em; font-size: .9em;
width: 120px; width: 120px;
&:hover { &:hover {
background-color: #283747; background-color: $background-color-hovered;
} }
} }
} }
@ -198,30 +207,34 @@
> a { > a {
display: block; display: block;
width: 40px; min-width: 40px;
height: 40px; height: 40px;
border-radius: 50%; border-radius: 50%;
background-position: center center; background-position: center center;
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
background-color: #354a5f; background-color: $background-color;
} }
>.options { >.options {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 2px; gap: 5px;
>.username { >.username {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
gap: 5px; gap: 5px;
@media (max-width: 500px) {
justify-content: flex-start;
}
>a { >a {
color: white; color: $text-color;
&:hover { &:hover {
color: #1a78b3; color: $hovered-text-color;
} }
} }
} }
@ -230,7 +243,7 @@
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
gap: 5px; gap: 15px;
@media (max-width: 1200px) { @media (max-width: 1200px) {
justify-content: flex-start; justify-content: flex-start;
@ -238,17 +251,17 @@
>a { >a {
text-align: right; text-align: right;
color: white; color: $text-color;
&:hover { &:hover {
color: #1a78b3; color: $hovered-text-color;
} }
&:last-child { &:last-child {
color: #eb2f06; color: $red-text-color;
&:hover { &:hover {
color: #cc2804; color: $hovered-red-text-color;
} }
} }
} }
@ -265,16 +278,16 @@
position: relative; position: relative;
>a { >a {
color: white; color: $text-color;
position: relative; position: relative;
font-size: 25px; font-size: 25px;
&:hover { &:hover {
color: #1a78b3; color: $hovered-text-color;
} }
>span { >span {
color: white; color: $text-color;
font-size: 14px; font-size: 14px;
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -282,7 +295,7 @@
width: 10px; width: 10px;
height: 10px; height: 10px;
padding: 5px; padding: 5px;
background-color: #eb2f06; background-color: $red-text-color;
border-radius: 50%; border-radius: 50%;
position: absolute; position: absolute;
top: -50%; top: -50%;
@ -388,9 +401,13 @@
border-radius: 5px; border-radius: 5px;
font-size: .9em; font-size: .9em;
margin: 0; margin: 0;
background-color: #283747; background-color: $background-color-hovered;
padding: 0 10px; padding: 0 10px;
color: white; color: $text-color;
&::placeholder {
color: $hovered-text-color;
}
} }
} }
} }
@ -418,10 +435,10 @@
>li>a { >li>a {
display: flex; display: flex;
color: white; color: $text-color;
&:hover { &:hover {
color: #1a78b3; color: $hovered-text-color;
} }
>span { >span {

View File

@ -1,13 +1,9 @@
nav.navbar { nav.navbar {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
justify-content: center;
background-color: hsl(203, 75%, 40%); background-color: hsl(203, 75%, 40%);
margin: 1em; margin: 1em;
color: white; color: white;
border-radius: 0.6em; border-radius: 0.6em;
min-height: 40px;
@media (max-width: 500px) { @media (max-width: 500px) {
position: relative; position: relative;
@ -17,6 +13,37 @@ nav.navbar {
margin: .2em; margin: .2em;
} }
> .expand-button {
background-color: transparent;
display: none;
position: relative;
padding: 10px;
cursor: pointer;
width: 40px;
height: 40px;
justify-content: center;
align-items: center;
margin: 0;
> i {
font-size: 1.5em;
color: white;
}
@media (max-width: 500px) {
display: flex;
}
}
> .content {
@media (min-width: 500px) {display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
justify-content: center;
display: flex !important;
}
> .menu, > .menu,
> .link { > .link {
box-sizing: border-box; box-sizing: border-box;
@ -108,3 +135,4 @@ nav.navbar {
} }
} }
} }
}

View File

@ -196,6 +196,8 @@
{% block nav %} {% block nav %}
{% if not popup %} {% if not popup %}
<nav class="navbar"> <nav class="navbar">
<button class="expand-button" onclick="showMenu()"><i class="fa fa-bars"></i></button>
<div id="navbar-content" class="content" style="display: none;">
<a class="link" href="{{ url('core:index') }}">{% trans %}Main{% endtrans %}</a> <a class="link" href="{{ url('core:index') }}">{% trans %}Main{% endtrans %}</a>
<div class="menu"> <div class="menu">
<span class="head">{% trans %}Associations & Clubs{% endtrans %}</span> <span class="head">{% trans %}Associations & Clubs{% endtrans %}</span>
@ -243,6 +245,7 @@
<li><a href="{{ url('core:page', page_name='Index') }}">{% trans %}Wiki{% endtrans %}</a></li> <li><a href="{{ url('core:page', page_name='Index') }}">{% trans %}Wiki{% endtrans %}</a></li>
</ul> </ul>
</div> </div>
</div>
</nav> </nav>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
@ -308,6 +311,13 @@
<script src="{{ static('ajax_select/js/ajax_select.js') }}"></script> <script src="{{ static('ajax_select/js/ajax_select.js') }}"></script>
<script src="{{ url('javascript-catalog') }}"></script> <script src="{{ url('javascript-catalog') }}"></script>
<script> <script>
function showMenu() {
let navbar = document.getElementById("navbar-content");
const current = navbar.style.getPropertyValue("display");
navbar.style.setProperty("display", current == "none" ? "block" : "none");
}
</script>
<script>
$('.select_date').datepicker({ $('.select_date').datepicker({
changeMonth: true, changeMonth: true,
changeYear: true, changeYear: true,