rhsaas/Bootstrap_new/css/ux_enhancements.css
2026-01-16 07:11:49 +00:00

285 lines
5.9 KiB
CSS

/* ============================================
UX ENHANCEMENTS - ANIMATIONS ET MICRO-INTERACTIONS
============================================ */
/* Effet de vague au clic */
.ripple {
position: relative;
overflow: hidden;
}
.ripple::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 5px;
height: 5px;
background: rgba(255, 255, 255, 0.5);
opacity: 0;
border-radius: 100%;
transform: scale(1, 1) translate(-50%);
transform-origin: 50% 50%;
}
.ripple:focus:not(:active)::after {
animation: ripple 1s ease-out;
}
@keyframes ripple {
0% {
transform: scale(0, 0);
opacity: 0.5;
}
20% {
transform: scale(25, 25);
opacity: 0.3;
}
100% {
opacity: 0;
transform: scale(40, 40);
}
}
/* Effet de levitation pour les cartes */
.content-card {
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.content-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}
/* Animation du bouton contexte */
.context-toggle {
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.context-toggle:hover {
transform: scale(1.1) translateY(-2px);
box-shadow: 0 8px 20px rgba(183, 71, 42, 0.4);
}
/* Loading skeleton */
.skeleton {
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: loading 1.5s infinite;
}
@keyframes loading {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
/* Smooth scrolling */
html {
scroll-behavior: smooth;
}
/* Focus styles améliorés */
:focus-visible {
outline: 3px solid var(--office-secondary);
outline-offset: 2px;
border-radius: 4px;
}
/* Animation d'entrée */
.fade-in-up {
animation: fadeInUp 0.6s ease forwards;
opacity: 0;
transform: translateY(20px);
}
@keyframes fadeInUp {
to {
opacity: 1;
transform: translateY(0);
}
}
/* Tooltip personnalisé */
[data-tooltip] {
position: relative;
}
[data-tooltip]:hover::before {
content: attr(data-tooltip);
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
background: var(--office-dark);
color: white;
padding: 6px 12px;
border-radius: 4px;
font-size: 12px;
white-space: nowrap;
z-index: 1000;
margin-bottom: 8px;
animation: fadeIn 0.2s ease;
}
[data-tooltip]:hover::after {
content: '';
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
border: 6px solid transparent;
border-top-color: var(--office-dark);
margin-bottom: 2px;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
/* ============================================
MENU UNIQUE OUVERT - STYLES AMÉLIORÉS
============================================ */
/* Animation pour les sous-menus */
@keyframes slideDown {
from {
opacity: 0;
transform: translateY(-10px);
max-height: 0;
}
to {
opacity: 1;
transform: translateY(0);
max-height: 500px;
}
}
@keyframes slideUp {
from {
opacity: 1;
transform: translateY(0);
max-height: 500px;
}
to {
opacity: 0;
transform: translateY(-10px);
max-height: 0;
}
}
/* Styles pour les sous-menus */
.nav-submenu {
max-height: 0;
overflow: hidden;
display: none;
transition: max-height 0.3s ease, opacity 0.3s ease;
}
.nav-submenu.show {
display: block;
animation: slideDown 0.3s ease forwards;
}
.nav-submenu:not(.show) {
animation: slideUp 0.3s ease forwards;
}
/* Indicateur visuel pour le menu actif */
.nav-link.active {
background-color: rgba(255, 255, 255, 0.15) !important;
color: white !important;
font-weight: 500 !important;
position: relative;
}
.nav-link.active::after {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 3px;
height: 60%;
background-color: white;
border-radius: 0 2px 2px 0;
}
/* Flèche du menu */
.nav-arrow {
transition: transform 0.3s ease;
margin-left: auto;
}
.nav-link[aria-expanded="true"] .nav-arrow {
transform: rotate(90deg);
}
.nav-link[aria-expanded="false"] .nav-arrow {
transform: rotate(0deg);
}
/* Hover amélioré */
.nav-link:hover:not(.active) {
background-color: rgba(255, 255, 255, 0.08) !important;
}
/* Transition fluide pour les sous-menus actifs */
.nav-submenu[data-parent-id].show {
background-color: rgba(0, 0, 0, 0.1);
border-radius: 6px;
margin: 4px 16px 4px 16px;
}
/* Élément actif dans le sous-menu */
.nav-submenu .nav-link.active {
background-color: rgba(255, 255, 255, 0.2) !important;
font-weight: 600 !important;
}
/* ============================================
RESPONSIVE - MENU MOBILE
============================================ */
@media (max-width: 768px) {
.nav-submenu.show {
animation: slideDown 0.2s ease forwards;
}
.nav-submenu:not(.show) {
animation: slideUp 0.2s ease forwards;
}
/* Masquer les sous-menus par défaut sur mobile */
.app-sidebar:not(.mobile-open) .nav-submenu {
display: none !important;
}
.app-sidebar.mobile-open .nav-submenu.show {
display: block !important;
}
}
/* ============================================
ACCESSIBILITÉ AMÉLIORÉE
============================================ */
.nav-link:focus {
outline: 2px solid rgba(255, 255, 255, 0.6);
outline-offset: -2px;
}
.nav-submenu .nav-link:focus {
outline-offset: -4px;
}
/* Focus visible pour navigation clavier */
.nav-link:focus-visible {
outline: 3px solid rgba(255, 255, 255, 0.8);
outline-offset: 2px;
}
/* Indicateur pour menu ouvert au clavier */
.nav-link[aria-expanded="true"]:focus {
background-color: rgba(255, 255, 255, 0.2) !important;
}