Improves all-day event container creation and animation

Refactors all-day event container creation to be lazy, improving
initial load performance. The container is now created and animated
into view only when needed, specifically when the first event is
dragged into the all-day section. This avoids unnecessary DOM
manipulation and improves the perceived responsiveness of the
calendar.
This commit is contained in:
Janus Knudsen 2025-08-28 00:13:11 +02:00
parent daa332e8db
commit 2c934a7a1a
2 changed files with 38 additions and 22 deletions

View file

@ -267,7 +267,7 @@ swp-day-header[data-today="true"] swp-day-date {
}
/* All-day container - simple container with dynamic grid-template-rows */
/* All-day container - initially hidden, animated in when first event is dragged */
swp-allday-container {
grid-column: 1 / -1; /* Span all columns */
grid-row: 2; /* Second row of calendar header */
@ -278,7 +278,11 @@ swp-allday-container {
padding: 2px;
align-items: center;
overflow: hidden;
min-height: var(--allday-event-height, 26px);
/* Initially hidden - no CSS transitions, use Web Animations API */
height: 0;
min-height: 0;
opacity: 0;
}
/* All-day events in containers */