NxTIC/css/header.scss

160 lines
2.8 KiB
SCSS
Executable File

@import 'constants';
#WRAPPER > #HEADER{
/* [1] Barre de recherche
=========================================================*/
& > #searchbar{
display: inline-block;
position: absolute;
top: .8em;
left: 1em;
width: 20em;
height: 2em;
padding: .2em 1em;
border: 0;
border-radius: 3px;
background-color: $theme-bg;
}
/* [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{
display: block;
position: absolute;
top: 0;
right: calc( #{$header-height}*2 - 1em );
height: $header-height;
padding: 0 1em;
color: #555;
line-height: $header-height;
white-space: nowrap;
font-weight: bold;
cursor: pointer;
}
/* (2) Image du profil */
& > #user-picture{
display: block;
position: absolute;
top: 1em;
right: $header-height;
width: calc( #{$header-height} - 2*1em );
height: calc( #{$header-height} - 2*1em );
border-radius: 50% / 50%;
background: $theme-bg url('/src/static/header/nopic.svg') center center no-repeat;
background-size: auto 80%;
// Si on est connecte
&.active{ background-image: url('/src/dynamic/profile/sample.svg'); background-size: auto 100%; }
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;
}
}
/* [3] Menu deroulant pour l'administration du profil
=========================================================*/
& > .user-panel{
display: block;
position: absolute;
top: calc( #{$header-height} - 1em );
right: 0;
margin: .5em;
border-radius: 5px;
border: 1px solid darken($theme-bg, 10);
background-color: #fff;
@include transition( left .3s ease-in-out );
/* (1) Pour chaque element du menu */
& > span{
display: block;
position: relative;
// 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;
}
}
}
/* (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; }
}