Keep/keep-notes/components/masonry-grid.css
sepehr ddb67ba9e5 fix: unify theme system - fix theme switching persistence
- Unified localStorage key to 'theme-preference' across all components
- Fixed header.tsx using wrong localStorage key ('theme' instead of 'theme-preference')
- Added localStorage hybrid persistence for instant theme changes
- Removed router.refresh() which was causing stale data revert
- Replaced Blue theme with Sepia
- Consolidated auth() calls to prevent race conditions
- Updated UserSettingsData types to include all themes
2026-01-18 22:33:41 +01:00

231 lines
5.0 KiB
CSS

/**
* Masonry Grid Styles
*
* Styles for responsive masonry layout similar to Google Keep
* Handles note sizes, drag states, and responsive breakpoints
*/
/* Masonry Container */
.masonry-container {
width: 100%;
padding: 0 16px 24px 16px;
}
/* Grid containers for pinned and others sections */
.masonry-container > div > div[ref*="GridRef"] {
width: 100%;
min-height: 100px;
position: relative;
}
/* Masonry Item Base Styles - Width is managed by Muuri */
.masonry-item {
display: block;
position: absolute;
z-index: 1;
box-sizing: border-box;
padding: 8px 0;
width: auto; /* Width will be set by JS based on container */
}
/* Masonry Item Content Wrapper */
.masonry-item-content {
position: relative;
width: 100%;
height: 100%;
box-sizing: border-box;
}
/* Ensure proper box-sizing for all elements in the grid */
.masonry-item *,
.masonry-item-content * {
box-sizing: border-box;
}
/* Note Card - Base styles */
.note-card {
width: 100% !important; /* Force full width within grid cell */
min-width: 0; /* Prevent overflow */
height: auto !important; /* Let content determine height like Google Keep */
max-height: none !important; /* No max-height restriction */
}
/* Note Size Styles - Desktop Default */
.note-card[data-size="small"] {
min-height: 150px !important;
height: auto !important;
}
.note-card[data-size="medium"] {
min-height: 200px !important;
height: auto !important;
}
.note-card[data-size="large"] {
min-height: 300px !important;
height: auto !important;
}
/* Drag State Styles - Improved for Google Keep-like behavior */
.masonry-item.muuri-item-dragging {
z-index: 1000;
opacity: 0.6;
transition: none; /* No transition during drag for better performance */
}
.masonry-item.muuri-item-dragging .note-card {
transform: scale(1.05) rotate(2deg);
box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
transition: none; /* No transition during drag */
}
.masonry-item.muuri-item-releasing {
z-index: 2;
transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.masonry-item.muuri-item-releasing .note-card {
transform: scale(1) rotate(0deg);
box-shadow: none;
transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.masonry-item.muuri-item-hidden {
z-index: 0;
opacity: 0;
pointer-events: none;
}
/* Drag Placeholder - More visible and styled like Google Keep */
.muuri-item-placeholder {
opacity: 0.3;
background: rgba(100, 100, 255, 0.05);
border: 2px dashed rgba(100, 100, 255, 0.3);
border-radius: 12px;
transition: all 0.2s ease-out;
min-height: 150px !important;
min-width: 100px !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
}
.muuri-item-placeholder::before {
content: '';
width: 40px;
height: 40px;
border-radius: 50%;
background: rgba(100, 100, 255, 0.1);
border: 2px dashed rgba(100, 100, 255, 0.2);
}
/* Mobile Styles (< 640px) */
@media (max-width: 639px) {
.masonry-container {
padding: 0 12px 16px 12px;
}
.masonry-item {
padding: 6px 0;
}
/* Smaller note sizes on mobile - keep same ratio */
.note-card[data-size="small"] {
min-height: 120px !important;
height: auto !important;
}
.note-card[data-size="medium"] {
min-height: 160px !important;
height: auto !important;
}
.note-card[data-size="large"] {
min-height: 240px !important;
height: auto !important;
}
/* Reduced drag effect on mobile */
.masonry-item.muuri-item-dragging .note-card {
transform: scale(1.01);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}
}
/* Tablet Styles (640px - 1023px) */
@media (min-width: 640px) and (max-width: 1023px) {
.masonry-container {
padding: 0 16px 20px 16px;
}
.masonry-item {
padding: 8px 0;
}
}
/* Desktop Styles (1024px - 1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
.masonry-container {
padding: 0 20px 24px 20px;
}
}
/* Large Desktop Styles (1280px+) */
@media (min-width: 1280px) {
.masonry-container {
padding: 0 24px 32px 24px;
/* max-width removed for infinite columns */
width: 100%;
}
.masonry-item {
padding: 10px 0;
}
}
/* Smooth transition for layout changes */
.masonry-item,
.masonry-item-content,
.note-card {
transition-property: transform, box-shadow, opacity;
transition-duration: 0.2s;
transition-timing-function: ease-out;
}
/* Prevent layout shift during animations */
.masonry-item.muuri-item-positioning {
transition: none !important;
}
/* Hide scrollbars during drag to prevent jitter */
body.muuri-dragging {
overflow: hidden;
}
/* Optimize for reduced motion */
@media (prefers-reduced-motion: reduce) {
.masonry-item,
.masonry-item-content,
.note-card {
transition: none;
}
.masonry-item.muuri-item-dragging .note-card {
transform: none;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
}
/* Print styles */
@media print {
.masonry-item.muuri-item-dragging,
.muuri-item-placeholder {
display: none !important;
}
.masonry-item {
break-inside: avoid;
page-break-inside: avoid;
}
}