mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-11 17:29:37 +02:00
Les images dans les notes sont maintenant des miniatures qui s'agrandissent dans un modal en plein écran au clic. CSS - Miniatures: - .note-card-image: 140px hauteur (cartes pliées) - .note-image: 200px max-height (notes expandues, réduit de 300px) - Cursor pointer + hover effect (scale 1.02, opacity 0.9) - Indication visuelle qu'on peut cliquer Modal Image: - Fond noir semi-transparent (rgba(0,0,0,0.9)) - Image centrée, max 90vw x 90vh - Bouton fermeture (top-right, backdrop-filter) - z-index 400 (au-dessus de tout) - Animation fadeIn 0.2s Interactions: - Clic sur miniature → Modal avec image en taille réelle - Clic sur fond noir → Ferme le modal - Bouton X → Ferme le modal - Touche Escape → Ferme le modal - Délégation d'événements pour gérer les images après re-render - Désactive scroll pendant que modal ouvert JavaScript: - openImageModal(src): Ouvre modal + désactive scroll - closeImageModal(): Ferme modal + réactive scroll - Event listeners: click, escape, backdrop Bénéfices utilisateur: ✓ Notes plus compactes (images miniatures) ✓ Images consultables en haute qualité (modal) ✓ Navigation intuitive (clic pour agrandir) ✓ Fermeture rapide (X, Escape, backdrop) ✓ Pas de scroll accidentel pendant consultation Files: - public/css/components.css: Miniatures + hover effects - public/css/skeleton.css: Styles modal image - public/index.html: HTML modal image - public/js/complete-app.js: Gestion modal + event listeners
361 lines
6.4 KiB
CSS
361 lines
6.4 KiB
CSS
/* Skeleton Loaders pour améliorer la fluidité perçue */
|
|
|
|
.skeleton {
|
|
background: linear-gradient(
|
|
90deg,
|
|
var(--color-border) 25%,
|
|
#f0f0f0 50%,
|
|
var(--color-border) 75%
|
|
);
|
|
background-size: 200% 100%;
|
|
animation: loading 1.5s ease-in-out infinite;
|
|
border-radius: var(--radius-md);
|
|
}
|
|
|
|
@keyframes loading {
|
|
0% {
|
|
background-position: 200% 0;
|
|
}
|
|
100% {
|
|
background-position: -200% 0;
|
|
}
|
|
}
|
|
|
|
.skeleton-note-card {
|
|
height: 200px;
|
|
margin-bottom: var(--spacing-lg);
|
|
}
|
|
|
|
.skeleton-todo {
|
|
height: 40px;
|
|
margin-bottom: var(--spacing-sm);
|
|
}
|
|
|
|
.skeleton-rss-article {
|
|
height: 80px;
|
|
margin-bottom: var(--spacing-md);
|
|
}
|
|
|
|
/* Loading indicators */
|
|
.loading-spinner {
|
|
display: inline-block;
|
|
width: 20px;
|
|
height: 20px;
|
|
border: 3px solid rgba(102, 126, 234, 0.1);
|
|
border-radius: 50%;
|
|
border-top-color: var(--color-accent);
|
|
animation: spinner 0.6s linear infinite;
|
|
}
|
|
|
|
@keyframes spinner {
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
|
|
.loading-overlay {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: rgba(255, 255, 255, 0.8);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
z-index: 9999;
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
transition: opacity 0.2s;
|
|
}
|
|
|
|
.loading-overlay.active {
|
|
opacity: 1;
|
|
pointer-events: all;
|
|
}
|
|
|
|
.loading-content {
|
|
text-align: center;
|
|
padding: 30px;
|
|
background: white;
|
|
border-radius: var(--radius-lg);
|
|
box-shadow: var(--shadow-lg);
|
|
}
|
|
|
|
.loading-content .loading-spinner {
|
|
width: 50px;
|
|
height: 50px;
|
|
border-width: 4px;
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.loading-content p {
|
|
margin: 0;
|
|
color: var(--color-text-secondary);
|
|
font-size: var(--font-size-sm);
|
|
}
|
|
|
|
/* Refresh indicator */
|
|
.refresh-indicator {
|
|
position: fixed;
|
|
top: 80px;
|
|
right: 20px;
|
|
background: var(--color-accent);
|
|
color: white;
|
|
padding: 8px 16px;
|
|
border-radius: var(--radius-lg);
|
|
font-size: var(--font-size-xs);
|
|
box-shadow: var(--shadow-md);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
opacity: 0;
|
|
transform: translateY(-10px);
|
|
transition: all 0.3s;
|
|
pointer-events: none;
|
|
z-index: 1000;
|
|
}
|
|
|
|
.refresh-indicator.active {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
|
|
.refresh-indicator .loading-spinner {
|
|
width: 14px;
|
|
height: 14px;
|
|
border-width: 2px;
|
|
border-color: rgba(255, 255, 255, 0.3);
|
|
border-top-color: white;
|
|
}
|
|
|
|
/* Optimistic UI */
|
|
.optimistic-update {
|
|
opacity: 0.6;
|
|
pointer-events: none;
|
|
}
|
|
|
|
/* Smooth fade in */
|
|
.fade-in {
|
|
animation: fadeIn 0.3s ease-in;
|
|
}
|
|
|
|
@keyframes fadeIn {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateY(10px);
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
}
|
|
|
|
/* Empty state avec animation */
|
|
.empty-state {
|
|
text-align: center;
|
|
padding: 60px 20px;
|
|
color: var(--color-text-secondary);
|
|
animation: fadeIn 0.5s ease-in;
|
|
}
|
|
|
|
.empty-state-icon {
|
|
font-size: 48px;
|
|
margin-bottom: 16px;
|
|
opacity: 0.5;
|
|
}
|
|
|
|
.empty-state-text {
|
|
font-size: var(--font-size-base);
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.empty-state-hint {
|
|
font-size: var(--font-size-sm);
|
|
opacity: 0.7;
|
|
}
|
|
|
|
/* Système de notifications */
|
|
.notifications-container {
|
|
position: fixed;
|
|
top: calc(var(--header-height) + 20px);
|
|
right: 20px;
|
|
z-index: 300;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 12px;
|
|
max-width: 400px;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.notification {
|
|
background: var(--color-card);
|
|
border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-md);
|
|
padding: 16px 20px;
|
|
box-shadow: var(--shadow-lg);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
opacity: 0;
|
|
transform: translateX(400px);
|
|
animation: slideInRight 0.3s ease-out forwards;
|
|
pointer-events: auto;
|
|
min-width: 300px;
|
|
position: relative;
|
|
}
|
|
|
|
.notification.closing {
|
|
animation: slideOutRight 0.3s ease-in forwards;
|
|
}
|
|
|
|
.notification-icon {
|
|
width: 24px;
|
|
height: 24px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.notification-success {
|
|
border-left: 4px solid var(--color-success);
|
|
}
|
|
|
|
.notification-success .notification-icon {
|
|
color: var(--color-success);
|
|
}
|
|
|
|
.notification-error {
|
|
border-left: 4px solid var(--color-danger);
|
|
}
|
|
|
|
.notification-error .notification-icon {
|
|
color: var(--color-danger);
|
|
}
|
|
|
|
.notification-warning {
|
|
border-left: 4px solid var(--color-warning);
|
|
}
|
|
|
|
.notification-warning .notification-icon {
|
|
color: var(--color-warning);
|
|
}
|
|
|
|
.notification-info {
|
|
border-left: 4px solid var(--color-info);
|
|
}
|
|
|
|
.notification-info .notification-icon {
|
|
color: var(--color-info);
|
|
}
|
|
|
|
.notification-content {
|
|
flex: 1;
|
|
font-size: var(--font-size-sm);
|
|
color: var(--color-text-primary);
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.notification-close {
|
|
width: 24px;
|
|
height: 24px;
|
|
padding: 4px;
|
|
border: none;
|
|
background: transparent;
|
|
color: var(--color-text-secondary);
|
|
cursor: pointer;
|
|
border-radius: 50%;
|
|
transition: all var(--transition-fast);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.notification-close:hover {
|
|
background: var(--color-hover);
|
|
color: var(--color-text-primary);
|
|
}
|
|
|
|
@keyframes slideInRight {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateX(400px);
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
transform: translateX(0);
|
|
}
|
|
}
|
|
|
|
@keyframes slideOutRight {
|
|
from {
|
|
opacity: 1;
|
|
transform: translateX(0);
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
transform: translateX(400px);
|
|
}
|
|
}
|
|
|
|
/* Modal pour agrandir les images */
|
|
.image-modal {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: rgba(0, 0, 0, 0.9);
|
|
z-index: 400;
|
|
display: none;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 40px;
|
|
cursor: pointer;
|
|
animation: fadeIn 0.2s ease-in;
|
|
}
|
|
|
|
.image-modal.active {
|
|
display: flex;
|
|
}
|
|
|
|
.image-modal-content {
|
|
position: relative;
|
|
max-width: 90vw;
|
|
max-height: 90vh;
|
|
cursor: default;
|
|
}
|
|
|
|
.image-modal-img {
|
|
max-width: 100%;
|
|
max-height: 90vh;
|
|
object-fit: contain;
|
|
border-radius: var(--radius-md);
|
|
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
.image-modal-close {
|
|
position: fixed;
|
|
top: 20px;
|
|
right: 20px;
|
|
width: 48px;
|
|
height: 48px;
|
|
border: none;
|
|
background: rgba(255, 255, 255, 0.1);
|
|
color: white;
|
|
font-size: 32px;
|
|
cursor: pointer;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
transition: all var(--transition-fast);
|
|
backdrop-filter: blur(10px);
|
|
}
|
|
|
|
.image-modal-close:hover {
|
|
background: rgba(255, 255, 255, 0.2);
|
|
transform: scale(1.1);
|
|
}
|
|
|
|
.image-modal-close svg {
|
|
width: 24px;
|
|
height: 24px;
|
|
}
|