NxTIC/css/header.scss

165 lines
2.9 KiB
SCSS
Raw Normal View History

@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;
2016-04-12 10:03:15 +00:00
padding: 0 1em;
color: darken($theme-bg, 40);
line-height: $header-height;
white-space: nowrap;
cursor: pointer;
// Animation de @hover
&:hover{
color: darken($theme-bg, 60);
}
}
/* (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('/f/svg/nopic/st/header') center center no-repeat;
background-size: auto 80%;
// Si on est connecte
&.active{ background-image: url('/f/svg/sample/dy/profile'); 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('/f/svg/expand/st/header/999999') 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;
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; }
}