NxTIC/public_html/css/header.scss

162 lines
2.7 KiB
SCSS
Raw Permalink Normal View History

@import 'constants';
#WRAPPER > #HEADER{
2016-04-18 15:01:11 +00:00
/* [1] Barre de recherche
=========================================================*/
& > #searchbar{
display: inline-block;
position: absolute;
top: .8em;
left: 1em;
width: 20em;
height: 2em;
2016-04-18 15:01:11 +00:00
padding: .2em 1em;
border: 0;
border-radius: 3px;
background-color: $theme-bg;
2016-04-18 15:01:11 +00:00
}
/* [2] Informations utilisateur
=========================================================*/
/* (0) Conteneur */
& > #user-data{
display: inline-block;
position: absolute;
top: 0;
right: 0;
height: calc( 100% - 2*1em );
/* (1) Username de l'utilisateur */
& > #user-name{
2016-05-25 15:27:18 +00:00
display: block;
position: absolute;
top: 0;
right: calc( #{$header-height}*2 - 1em );
height: $header-height;
2016-05-25 15:27:18 +00:00
padding: 0 1em;
2016-04-12 10:03:15 +00:00
2016-05-25 15:27:18 +00:00
color: #555;
line-height: $header-height;
white-space: nowrap;
2016-04-14 08:40:27 +00:00
font-weight: bold;
cursor: pointer;
}
2016-04-18 15:01:11 +00:00
/* (2) Image du profil */
& > #user-picture{
display: block;
position: absolute;
top: 1.5em;
right: $header-height;
width: calc( #{$header-height} - 2*1.5em );
height: calc( #{$header-height} - 2*1.5em );
2016-04-18 15:01:11 +00:00
border-radius: 50% / 50%;
background-color: $theme-bg;
background-size: auto 80%;
// Si on est connecte
&.active{
background-color: $theme-fg-primary;
}
cursor: default;
align-self: center;
}
/* (3) Icone d'activation */
&:before{
content: '';
display: block;
position: absolute;
top: 0;
right: 0;
width: $header-height;
height: $header-height;
background: url('/src/static/header/expand@000000.svg') center center no-repeat;
background-size: 1em 1em;
cursor: pointer;
}
}
2016-04-18 15:01:11 +00:00
/* [3] Menu deroulant pour l'administration du profil
=========================================================*/
& > .user-panel{
2016-05-25 15:27:18 +00:00
display: block;
position: absolute;
top: calc( #{$header-height} - 1em );
right: 0;
2016-05-25 15:27:18 +00:00
margin: .5em;
2016-04-18 15:01:11 +00:00
border-radius: 5px;
border: 1px solid darken($theme-bg, 10);
2016-05-25 15:27:18 +00:00
background-color: #fff;
2016-05-25 15:27:18 +00:00
@include transition( left .3s ease-in-out );
2016-05-25 15:27:18 +00:00
/* (1) Pour chaque element du menu */
& > span{
display: block;
position: relative;
2016-04-18 15:01:11 +00:00
// On ajoute une ligne en dessous sauf pour le dernier
&:not(:last-child){
border-bottom: 1px solid #ddd;
}
color: #000;
padding: .5em 1em;
padding-left: 2em;
cursor: pointer;
// @hover
&:hover{
background-color: #eee;
}
2016-05-25 15:27:18 +00:00
}
2016-04-18 15:01:11 +00:00
2016-05-25 15:27:18 +00:00
}
2016-05-25 15:27:18 +00:00
/* (3) Gestion de l'activation ou non de l'user panel */
& > #toggle-user-panel{ display: none; }
& > #toggle-user-panel + .user-panel{ left: 100%; }
& > #toggle-user-panel:checked + .user-panel{ left: auto; }
& > #toggle-user-panel:checked + .user-panel:before{ left: 7em; }
}