Working all day

This commit is contained in:
Janus Knudsen 2025-08-05 00:17:17 +02:00
parent c164975494
commit 7ac7e0f7f8
2 changed files with 6 additions and 14 deletions

View file

@ -338,9 +338,9 @@ export class GridManager {
* Update spacer heights based on all-day events presence * Update spacer heights based on all-day events presence
*/ */
private updateSpacerHeights(): void { private updateSpacerHeights(): void {
const allDayEventCount = this.allDayEvents.length; const allDayEventCount = 1;
const eventHeight = 20; // Height per all-day event in pixels const eventHeight = 26; // Height per all-day event in pixels
const padding = 4; // Top/bottom padding const padding = 0; // Top/bottom padding
const allDayHeight = allDayEventCount > 0 ? (allDayEventCount * eventHeight) + padding : 0; const allDayHeight = allDayEventCount > 0 ? (allDayEventCount * eventHeight) + padding : 0;
// Set CSS variable for dynamic spacer height // Set CSS variable for dynamic spacer height

View file

@ -224,13 +224,14 @@ swp-week-header {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 3; /* Lower than header-spacer so it slides under during horizontal scroll */ z-index: 3; /* Lower than header-spacer so it slides under during horizontal scroll */
height: auto; /* Dynamic height based on content */ height: calc(var(--header-height) + var(--all-day-row-height)); /* Same calculation as spacers */
} }
swp-day-header { swp-day-header {
padding: 12px; padding: 12px;
text-align: center; text-align: center;
border-right: 1px solid var(--color-grid-line); border-right: 1px solid var(--color-grid-line);
border-bottom: 1px solid var(--color-grid-line);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -267,20 +268,11 @@ swp-day-header[data-today="true"] swp-day-date {
margin: 4px auto 0; margin: 4px auto 0;
} }
/* Border between row 1 and row 2 in week header */
swp-week-header::after {
content: '';
grid-column: 1 / -1; /* Span all columns */
grid-row: 2; /* Position at start of row 2 */
border-top: 1px solid var(--color-grid-line);
height: 0;
z-index: 1;
}
/* All-day events in row 2 */ /* All-day events in row 2 */
swp-allday-event { swp-allday-event {
grid-row: 2; /* Row 2 only */ grid-row: 2; /* Row 2 only */
height: calc(var(--all-day-row-height) - 2px); /* Dynamic height minus margin */ height: calc(var(--all-day-row-height) - 3px); /* Dynamic height minus margin */
background: #ff9800; /* Default orange background */ background: #ff9800; /* Default orange background */
display: flex; display: flex;
align-items: center; align-items: center;