Switcheroo #1: Light, violet
modernbb :
Ajouter le
CSS suivant dans votre feuille de style:
Code:
/*** ------------------------------- ***/
/*** SWITCHEROO - Par Monomer ------ ***/
/*** Gestionnaire de multicompte --- ***/
:root {
--text: #333;
--red: #D31141;
--link: #000;
--light: #FFF;
--lighter: #fafafa;
--grey: #F4F4F4;
--greyer: #E5E5E5;
--border: 1px solid #E5E5E5;
--font: 'Open Sans';
--gap-size: 4px;
--ease: cubic-bezier(0.4, 0.0, 0.2, 1);
--ease-bounce: cubic-bezier(0.43, 0.09, 0.38, 2.56);
}
/* BARRE SWITCHEROO --- */
.switcheroo[position="static"] {
position: relative;
}
/* si barre EN HAUT */
.switcheroo[position="top"] {
position: fixed;
top: 0;
left: 0;
z-index: 100;
}
/* si barre EN BAS */
.switcheroo[position="bottom"] {
position: fixed;
bottom: 0;
left: 0;
z-index: 100;
}
/* si barre A L'HORIZONRAL */
.switcheroo[direction="horizontal"] {
width: 100%;
}
/* si barre A LA VERTICAL */
.switcheroo[direction="vertical"] {
height: 100%;
}
/* Positionnement des ronds */
.switcheroo__squircles {
display: flex;
margin: 0;
padding: 0;
list-style: none;
gap: var(--gap-size);
}
.switcheroo[direction="horizontal"] .switcheroo__squircles {
flex-direction: row;
}
.switcheroo[direction="vertical"] .switcheroo__squircles {
flex-direction: column;
}
/* BARRE --- */
.switcheroo {
color: var(--color-text);
background-color: var(--light);
border: var(--border);
font-size: 16px;
}
/* AFFICHAGE DES COMPTES ---*/
/* Rond */
.switcheroo__squircle {
position: relative;
display: grid;
place-items: center;
background-color: transparent;
width: 100%;
height: 60px;
border-radius: 50%;
cursor: pointer;
transition: border-radius 128ms var(--ease);
padding: 0 16px;
}
/* Rond au survol */
.switcheroo__squircle:hover {
border-radius: 6px;
background: transparent;
}
/* Contenenur de l'avatar */
.switcheroo__avatar {
}
/* Image de l'avatar */
.switcheroo__avatar img {
width: 40px;
height: 40px;
object-fit: cover;
object-position: center;
border-radius: 50%;
transition: border-radius 128ms var(--ease);
position: relative;
}
/* Image de l'avatar au survol */
.switcheroo__avatar img:hover {
border-radius: 5px;
}
/* Avatar du compte connecté */
.switcheroo__squircle.active, .switcheroo__squircle.active img {
border-radius: 6px;
cursor: default;
background-color: #ECEDFF;
}
.switcheroo__squircle.active {
border-left: 3px solid #5865F1;
border-radius: 0;
}
/* Bouton de suppression */
.switcheroo__delete {
display: grid;
place-items: center;
position: absolute;
width: 16px;
height: 16px;
top: 0;
right: 0;
border-radius: 50%;
background-color: #5865f1;
transform: scale(0);
opacity: 1;
transition: transform 128ms var(--ease), opacity 64ms var(--ease);
cursor: pointer;
color: var(--light);
line-height: 1;
}
.switcheroo__squircle:hover .switcheroo__delete {
opacity: 1;
transform: scale(1);
}
/* TOOLTIP - INFOBULLE DU PSEUDO ---*/
/* Conteneur du pseudo */
.switcheroo__popper {
background-color: var(--text);
padding: 0.68rem 1rem;
position: absolute;
width: -webkit-max-content;
width: max-content;
border-radius: 4px;
z-index: 0;
opacity: 0;
transition: opacity 64ms var(--ease), transform 128ms var(--ease-bounce);
pointer-events: none;
color: #fff;
}
/* special: modification de la position de l'infobulle pour l'ajout de compte seulement */
.switcheroo__squircle--button .switcheroo__popper {
left: 155% !important;
}
/* Conteneur du pseudo: si vertical */
.switcheroo[direction="vertical"] .switcheroo__popper {
left: 100%;
top: 50%;
transform-origin: left;
transform: translateY(-50%) scale(0.98);
}
/* Conteneur du pseudo : si horizontal */
.switcheroo[direction="horizontal"] .switcheroo__popper {
top: 155%;
left: 50%;
transform-origin: top;
transform: translateX(-50%) scale(0.98);
}
/* Flèche tooltip */
.switcheroo__popper:before {
content: "";
position: absolute;
width: 24px;
height: 24px;
background-color: var(--text);
z-index: -1;
}
/* Flèche tooltip : si vertical */
.switcheroo[direction="vertical"] .switcheroo__popper:before {
left: -2px;
top: 50%;
transform: translateY(-50%) rotate(-45deg);
}
/* Flèche tooltip : si horizontal */
.switcheroo[direction="horizontal"] .switcheroo__popper:before {
left: 50%;
top: -2px;
transform: translateX(-50%) rotate(-45deg);
}
/* Positionnement tooltip au survol */
.switcheroo[direction="vertical"] .switcheroo__squircle:hover .switcheroo__popper {
opacity: 1;
transform: translateY(-50%) scale(1);
}
.switcheroo[direction="horizontal"] .switcheroo__squircle:hover .switcheroo__popper {
opacity: 1;
transform: translateX(-50%) scale(1);
}
/* LOGO --- */
.switcheroo__logo {
/* display: none */
/* à ajouter si vous voulez supprimer le logo*/
background-color: transparent;
}
/* LOGO - Le logo en lui-même */
#switcheroo_logo_button {
height: 40px;
background-color: #5865f1;
border-radius: 5px;
opacity: .75;
transition: opacity .125s ease-in-out;
text-align: center;
line-height: 40px;
color: white;
font-size: 11pt;
width: 100%;
}
#switcheroo_logo_button:hover {
opacity: 1;
}
/* DIVIDER : barre de séparation --- */
.switcheroo__divider {
/* display: none */
/* à ajouter si vous voulez supprimer le logo*/
background-color: var(--greyer);
border-radius: 3px;
transform: scale(0.8);
}
/* Divider : si vertical */
.switcheroo[direction="vertical"] .switcheroo__divider {
width: 100%;
height: 2px;
}
/* Divider : si horizontal */
.switcheroo[direction="horizontal"] .switcheroo__divider {
width: 2px;
}
/* AJOUTER UN COMPTE ---*/
/* button : ajouter un compte */
.switcheroo__squircle--button {
transition: border-radius 128ms var(--ease);
color: var(--text);
background-color: transparent;
width: 40px;
height: 40px;
border: 2px solid #5865f150;
padding: 0;
position: relative;
left: 50%;
transform: translateX(-50%);
margin-top: 10px;
}
.switcheroo__squircle--button:hover {
color: black;
font-weight: bold;
border: 2px solid #5865f1;
}
/* MODAL : FENETRE DE CONNEXION --- */
/* Fond de l'afficage connexion */
.monomer-overlay {
position: fixed;
z-index: 999;
top: 0;
left: 0;
opacity: 0;
width: 100%;
height: 100%;
transition: 0.2s opacity ease;
background: rgba(255, 255, 255, 0.6);
}
/* Boîte de connexion */
.monomer-modal {
position: fixed;
z-index: 999;
top: 50%;
left: 50%;
opacity: 0;
width: 94%;
padding: 24px 20px;
transition: 0.2s opacity ease;
transform: translate(-50%, -50%);
border-radius: 5px;
background: var(--grey);
border: var(--border);
color: var(--text);
}
/* Formulaire */
.switcheroo__form {
padding: 48px;
background: var(--light);
border-radius: 5px;
}
/* Champs à remplir */
.switcheroo__form-row {
display: flex;
flex-flow: column;
align-items: flex-start;
margin-bottom: 16px;
}
/* Nom du champs */
.switcheroo__form-label {
margin-bottom: 8px;
font-size: 14px;
text-transform: uppercase;
font-weight: 600;
}
/* Zone de texte */
.switcheroo__form-input {
padding: 6px;
font-size: 16px;
border-radius: 4px;
width: 100%;
background-color: var(--light);
border: var(--border)!important;
border-bottom: 3px solid var(--greyer)!important;
color: var(--text);
cursor: text;
}
/* Bouton de connexion */
.switcheroo__form-button {
border-radius: 8px;
padding: 4px 6px;
border: none;
outline: none;
box-shadow: none;
text-transform: uppercase;
font-size: 14px;
align-self: flex-end;
background-color: var(--light);
border: var(--border);
cursor: pointer;
}
.switcheroo__form-button:hover {
border: 1px solid transparent;
background: var(--text);
color: var(--light);
}
.monomer-modal.monomer-open, .monomer-overlay.monomer-open {
opacity: 1;
}
/* Fermer la boîte de connexion */
.monomer-close {
font-size: 20px;
display: grid;
place-items: center;
width: 24px;
height: 24px;
position: absolute;
top: -7px;
right: -7px;
padding: 5px;
cursor: pointer;
color: #fff;
border: 0;
outline: none;
background: var(--red);
border-radius: 50%;
padding: 0;
}
.monomer-close:hover {
background: var(--text);
font-weight: 700;
}