340 lines
7.2 KiB
CSS
340 lines
7.2 KiB
CSS
/* Color tokens */
|
|
:root {
|
|
--bg: #f6f7fb;
|
|
--panel: #fff;
|
|
--today: #f83;
|
|
--ink: #111;
|
|
--ink-rgb: 17, 17, 17;
|
|
--muted: #888;
|
|
--weekend: #888;
|
|
--firstday: #000;
|
|
--select: #aaf;
|
|
--label-bg: #fafbfe;
|
|
--label-bg-rgb: 250, 251, 254;
|
|
}
|
|
|
|
/* Prevent text selection in calendar */
|
|
#calendar-viewport, #calendar-content, .week-row, .cell,
|
|
.calendar-header, .week-label, .month-name-label,
|
|
.calendar-container, .jogwheel-viewport, .jogwheel-content {
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
-webkit-touch-callout: none;
|
|
-webkit-tap-highlight-color: transparent;
|
|
}
|
|
|
|
/* Month tints (light) */
|
|
.cell.dec { background: hsl(220 20% 95%) }
|
|
.cell.jan { background: hsl(220 20% 88%) }
|
|
.cell.feb { background: hsl(220 20% 95%) }
|
|
.cell.mar { background: hsl(125 60% 88%) }
|
|
.cell.apr { background: hsl(125 60% 95%) }
|
|
.cell.may { background: hsl(125 60% 88%) }
|
|
.cell.jun { background: hsl(45 85% 95%) }
|
|
.cell.jul { background: hsl(45 85% 88%) }
|
|
.cell.aug { background: hsl(45 85% 95%) }
|
|
.cell.sep { background: hsl(18 78% 88%) }
|
|
.cell.oct { background: hsl(18 78% 95%) }
|
|
.cell.nov { background: hsl(18 78% 88%) }
|
|
|
|
/* Color tokens (dark) */
|
|
@media (prefers-color-scheme: dark) {
|
|
:root {
|
|
--bg: radial-gradient(1200px 800px at 20% -10%, #1c2130 0%, #0c0f16 35%, #0a0b11 100%);
|
|
--panel: #111318;
|
|
--today: #f83;
|
|
--ink: #ddd;
|
|
--ink-rgb: 221, 221, 221;
|
|
--muted: #888;
|
|
--weekend: #999;
|
|
--firstday: #fff;
|
|
--select: #44f;
|
|
--label-bg: #1a1d25;
|
|
--label-bg-rgb: 26, 29, 37;
|
|
}
|
|
|
|
/* Month tints (dark) */
|
|
.cell.dec { background: hsl(220 20% 22%) }
|
|
.cell.jan { background: hsl(220 20% 16%) }
|
|
.cell.feb { background: hsl(220 20% 22%) }
|
|
.cell.mar { background: hsl(125 40% 18%) }
|
|
.cell.apr { background: hsl(125 40% 26%) }
|
|
.cell.may { background: hsl(125 40% 18%) }
|
|
.cell.jun { background: hsl(45 70% 24%) }
|
|
.cell.jul { background: hsl(45 70% 18%) }
|
|
.cell.aug { background: hsl(45 70% 24%) }
|
|
.cell.sep { background: hsl(18 70% 18%) }
|
|
.cell.oct { background: hsl(18 70% 26%) }
|
|
.cell.nov { background: hsl(18 70% 18%) }
|
|
}
|
|
|
|
/* Layout & typography */
|
|
:root {
|
|
--row-h: 2.2em;
|
|
--label-w: minmax(4em, 8%);
|
|
--cell-w: 1fr;
|
|
--cell-h: clamp(4em, 8vh, 8em);
|
|
--overlay-w: minmax(3rem, 5%);
|
|
}
|
|
|
|
* { box-sizing: border-box }
|
|
|
|
body {
|
|
margin: 0;
|
|
font: 500 14px/1.2 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial;
|
|
background: var(--bg);
|
|
color: var(--ink);
|
|
}
|
|
|
|
.wrap {
|
|
width: 100%;
|
|
margin: 0;
|
|
background: var(--panel);
|
|
height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
padding: 1rem;
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
header {
|
|
display: flex;
|
|
align-items: baseline;
|
|
justify-content: space-between;
|
|
margin-bottom: .75rem;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.header-controls {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: .75rem;
|
|
}
|
|
|
|
.today-date {
|
|
cursor: pointer;
|
|
}
|
|
.today-date::first-line {
|
|
color: var(--today);
|
|
}
|
|
.today-button:hover { opacity: .8 }
|
|
|
|
.calendar-header {
|
|
display: grid;
|
|
grid-template-columns: var(--label-w) repeat(7, var(--cell-w)) var(--overlay-w);
|
|
border-bottom: .1em solid var(--muted);
|
|
align-items: last baseline;
|
|
flex-shrink: 0;
|
|
width: 100%;
|
|
}
|
|
|
|
.calendar-container {
|
|
flex: 1;
|
|
overflow: hidden;
|
|
position: relative;
|
|
width: 100%;
|
|
display: flex;
|
|
}
|
|
|
|
.calendar-viewport {
|
|
height: 100%;
|
|
overflow-y: auto;
|
|
overflow-x: hidden;
|
|
flex: 1;
|
|
width: 100%;
|
|
scrollbar-width: none;
|
|
}
|
|
.calendar-viewport::-webkit-scrollbar { display: none }
|
|
|
|
.jogwheel-viewport {
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
width: var(--overlay-w);
|
|
overflow-y: auto;
|
|
overflow-x: hidden;
|
|
scrollbar-width: none;
|
|
z-index: 20;
|
|
cursor: ns-resize;
|
|
}
|
|
.jogwheel-viewport::-webkit-scrollbar { display: none }
|
|
|
|
.jogwheel-content { position: relative; width: 100% }
|
|
|
|
.calendar-content { position: relative }
|
|
|
|
.week-row {
|
|
display: grid;
|
|
grid-template-columns: var(--label-w) repeat(7, var(--cell-w)) var(--overlay-w);
|
|
position: relative;
|
|
overflow: visible;
|
|
height: var(--cell-h);
|
|
scroll-snap-align: start;
|
|
width: 100%;
|
|
}
|
|
|
|
/* Fixed heights for cells and labels */
|
|
.week-row .cell,
|
|
.week-row .week-label { height: var(--cell-h) }
|
|
|
|
header h1 { margin: 0; font-size: 1rem }
|
|
|
|
.dow-label,
|
|
.week-label {
|
|
display: grid;
|
|
place-items: center;
|
|
width: 100%;
|
|
height: var(--cell-h);
|
|
color: var(--muted);
|
|
cursor: ns-resize;
|
|
font-size: 1.2em;
|
|
}
|
|
|
|
.dow { text-transform: uppercase; }
|
|
.cell {
|
|
position: relative;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
justify-content: flex-start;
|
|
padding: 0.25em;
|
|
overflow: hidden;
|
|
width: 100%;
|
|
height: var(--cell-h);
|
|
font-weight: 700;
|
|
cursor: pointer;
|
|
transition: background-color .15s ease;
|
|
}
|
|
|
|
.cell h1 {
|
|
position: absolute;
|
|
top: 0.25em;
|
|
right: 0.25em;
|
|
padding: 0;
|
|
margin: 0;
|
|
transition: background-color .15s ease;
|
|
font-size: 1em;
|
|
z-index: 10;
|
|
}
|
|
.cell:hover h1 { text-shadow: 0 0 .2em; }
|
|
|
|
/* Event styles */
|
|
.event {
|
|
font-size: 0.75em;
|
|
padding: 0.1em 0.3em;
|
|
margin: 0.1em 0;
|
|
border-radius: 0.2em;
|
|
color: white;
|
|
font-weight: 500;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
width: 100%;
|
|
max-width: calc(100% - 0.5em);
|
|
line-height: 1.2;
|
|
cursor: pointer;
|
|
z-index: 5;
|
|
}
|
|
|
|
.event:hover {
|
|
opacity: 0.8;
|
|
}
|
|
|
|
/* Spanning event styles */
|
|
.event-span {
|
|
font-size: 0.75em;
|
|
padding: 0.1em 0.3em;
|
|
border-radius: 0.2em;
|
|
color: white;
|
|
font-weight: 500;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
line-height: 1.2;
|
|
cursor: pointer;
|
|
transition: opacity 0.15s ease;
|
|
|
|
/* Calculate position and width using CSS variables and custom properties */
|
|
left: calc(var(--label-w) + var(--start-day) * (100% - var(--label-w) - var(--overlay-w)) / 7);
|
|
width: calc(var(--span-days) * (100% - var(--label-w) - var(--overlay-w)) / 7);
|
|
}
|
|
|
|
.event-span:hover {
|
|
opacity: 0.8;
|
|
}
|
|
|
|
.event-more {
|
|
font-size: 0.7em;
|
|
color: var(--muted);
|
|
font-style: italic;
|
|
margin-top: 0.1em;
|
|
}
|
|
|
|
/* Selection styles */
|
|
.weekend { color: var(--weekend) }
|
|
.firstday { color: var(--firstday); text-shadow: 0 0 .1em rgba(var(--ink-rgb), .5) }
|
|
|
|
.today h1 {
|
|
border-radius: 2em;
|
|
border: .2em dotted var(--today);
|
|
margin: -.2em;
|
|
}
|
|
|
|
/* Selection */
|
|
input {
|
|
background: transparent;
|
|
border: none;
|
|
color: var(--ink);
|
|
width: 11em;
|
|
}
|
|
label:has(input[value]) {
|
|
display: block;
|
|
}
|
|
.selected {
|
|
background: var(--select) !important;
|
|
border: 2px solid rgba(var(--ink-rgb), 0.3);
|
|
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
|
|
}
|
|
.selected h1,
|
|
:is(.range-start,.range-end,.range-middle,.range-single) h1 {
|
|
background: transparent !important;
|
|
color: var(--panel) !important;
|
|
font-weight: 700;
|
|
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
|
|
}
|
|
|
|
/* Ensure events don't interfere with selection visibility */
|
|
.selected .event {
|
|
opacity: 0.7;
|
|
}
|
|
|
|
/* Month labels in jogwheel column */
|
|
.month-name-label {
|
|
grid-column: -2 / -1;
|
|
font-size: 2em;
|
|
font-weight: 700;
|
|
color: var(--muted);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
pointer-events: none;
|
|
z-index: 15;
|
|
overflow: visible;
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
width: 100%;
|
|
}
|
|
|
|
.month-name-label > span {
|
|
display: inline-block;
|
|
white-space: nowrap;
|
|
writing-mode: vertical-rl;
|
|
text-orientation: mixed;
|
|
transform: rotate(180deg);
|
|
transform-origin: center;
|
|
}
|