- Updated HTML structure for navigation buttons in the calendar, adding SVG icons for improved visual clarity. - Introduced a new muted text style in CSS for better presentation of empty duty list messages. - Enhanced calendar CSS for navigation buttons and day indicators, improving layout and responsiveness. - Improved error handling in the UI by adding retry functionality to the error display, allowing users to retry actions directly from the error message. - Updated internationalization messages to include a retry option for error handling. - Added unit tests to verify the new error handling behavior and UI updates.
229 lines
4.2 KiB
CSS
229 lines
4.2 KiB
CSS
/* === Calendar: header, nav, weekdays, grid, day cells */
|
|
.header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.header[hidden],
|
|
.weekdays[hidden] {
|
|
display: none !important;
|
|
}
|
|
|
|
.nav {
|
|
width: 40px;
|
|
height: 40px;
|
|
border: none;
|
|
border-radius: 10px;
|
|
background: var(--surface);
|
|
color: var(--accent);
|
|
font-size: 24px;
|
|
line-height: 1;
|
|
cursor: pointer;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
transition: opacity var(--transition-fast), transform var(--transition-fast),
|
|
background-color var(--transition-fast);
|
|
}
|
|
|
|
.nav svg {
|
|
display: block;
|
|
}
|
|
|
|
@media (hover: hover) {
|
|
.nav:hover {
|
|
background: color-mix(in srgb, var(--accent) 15%, var(--surface));
|
|
}
|
|
}
|
|
|
|
.nav:focus {
|
|
outline: none;
|
|
}
|
|
|
|
.nav:focus-visible {
|
|
outline: 2px solid var(--accent);
|
|
outline-offset: 2px;
|
|
}
|
|
|
|
.nav:active {
|
|
transform: scale(0.95);
|
|
}
|
|
|
|
.nav:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.title {
|
|
margin: 0;
|
|
font-size: 1.1rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
@media (max-width: 480px) {
|
|
.title {
|
|
font-size: 1.25rem;
|
|
}
|
|
}
|
|
|
|
.weekdays {
|
|
display: grid;
|
|
grid-template-columns: repeat(7, 1fr);
|
|
gap: 2px;
|
|
margin-bottom: 6px;
|
|
font-size: 0.75rem;
|
|
color: var(--muted);
|
|
text-align: center;
|
|
}
|
|
|
|
.calendar-sticky {
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 10;
|
|
background: var(--bg);
|
|
padding-bottom: 12px;
|
|
margin-bottom: 4px;
|
|
touch-action: pan-y;
|
|
transition: box-shadow var(--transition-fast) ease-out;
|
|
}
|
|
|
|
.calendar-sticky.is-scrolled {
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.calendar {
|
|
display: grid;
|
|
grid-template-columns: repeat(7, 1fr);
|
|
gap: 4px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.day {
|
|
position: relative;
|
|
aspect-ratio: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: flex-start;
|
|
padding: 4px;
|
|
border-radius: 8px;
|
|
font-size: 0.85rem;
|
|
background: var(--surface);
|
|
min-width: 0;
|
|
min-height: 32px;
|
|
overflow: hidden;
|
|
transition: background-color var(--transition-fast), transform var(--transition-fast);
|
|
}
|
|
|
|
@media (hover: hover) {
|
|
.day:hover {
|
|
background: color-mix(in srgb, var(--accent) 10%, var(--surface));
|
|
}
|
|
.day.today:hover {
|
|
background: color-mix(in srgb, var(--bg) 15%, var(--today));
|
|
}
|
|
}
|
|
|
|
.day.other-month {
|
|
opacity: 0.4;
|
|
background: color-mix(in srgb, var(--muted) 8%, var(--surface));
|
|
}
|
|
|
|
.day.today {
|
|
background: var(--today);
|
|
color: var(--bg);
|
|
}
|
|
|
|
.day.has-duty .num {
|
|
font-weight: 700;
|
|
}
|
|
|
|
.day.holiday {
|
|
background: linear-gradient(135deg, var(--surface) 0%, color-mix(in srgb, var(--today) 15%, transparent) 100%);
|
|
border: 1px solid color-mix(in srgb, var(--today) 35%, transparent);
|
|
}
|
|
|
|
/* Today + external calendar: same solid "today" look as weekday, plus a border to show it has external events */
|
|
.day.today.holiday {
|
|
background: var(--today);
|
|
color: var(--bg);
|
|
border: 1px solid color-mix(in srgb, var(--bg) 50%, transparent);
|
|
}
|
|
|
|
.day {
|
|
cursor: pointer;
|
|
}
|
|
|
|
.day:focus {
|
|
outline: none;
|
|
}
|
|
|
|
.day:focus-visible {
|
|
outline: 2px solid var(--accent);
|
|
outline-offset: 2px;
|
|
}
|
|
|
|
.day:active {
|
|
transform: scale(0.98);
|
|
}
|
|
|
|
.day-indicator {
|
|
display: flex;
|
|
justify-content: center;
|
|
gap: 2px;
|
|
width: 65%;
|
|
margin-top: 6px;
|
|
}
|
|
|
|
.day-indicator-dot {
|
|
flex: 1;
|
|
height: 5px;
|
|
border-radius: 0;
|
|
}
|
|
|
|
.day-indicator-dot:only-child {
|
|
flex: 0 0 6px;
|
|
height: 6px;
|
|
border-radius: 50%;
|
|
}
|
|
|
|
.day-indicator-dot:first-child:not(:only-child) {
|
|
border-radius: 3px 0 0 3px;
|
|
}
|
|
|
|
.day-indicator-dot:last-child:not(:only-child) {
|
|
border-radius: 0 3px 3px 0;
|
|
}
|
|
|
|
.day-indicator-dot.duty {
|
|
background: var(--duty);
|
|
}
|
|
|
|
.day-indicator-dot.unavailable {
|
|
background: var(--unavailable);
|
|
}
|
|
|
|
.day-indicator-dot.vacation {
|
|
background: var(--vacation);
|
|
}
|
|
|
|
.day-indicator-dot.events {
|
|
background: var(--accent);
|
|
}
|
|
|
|
/* On "today" cell: dots darkened for contrast on --today background */
|
|
.day.today .day-indicator-dot.duty {
|
|
background: color-mix(in srgb, var(--duty) 65%, var(--bg));
|
|
}
|
|
.day.today .day-indicator-dot.unavailable {
|
|
background: color-mix(in srgb, var(--unavailable) 65%, var(--bg));
|
|
}
|
|
.day.today .day-indicator-dot.vacation {
|
|
background: color-mix(in srgb, var(--vacation) 65%, var(--bg));
|
|
}
|
|
.day.today .day-indicator-dot.events {
|
|
background: color-mix(in srgb, var(--accent) 65%, var(--bg));
|
|
}
|