fix: enhance duty marker hint rendering and styling

- Introduced a new function `getDutyMarkerHintHtml` to generate HTML for duty hints, improving the display of duty times and names.
- Updated the CSS for `.calendar-event-hint` to enhance layout and styling, ensuring better visual alignment and readability.
- Adjusted the handling of duty items to include non-breaking spaces for improved formatting of time displays.
- Removed deprecated CSS rules related to sticky elements to streamline styles and improve maintainability.
This commit is contained in:
2026-02-19 15:00:17 +03:00
parent 7e09da2b9e
commit 6d91274a4e
2 changed files with 114 additions and 24 deletions

View File

@@ -70,6 +70,7 @@ body {
max-width: 420px;
margin: 0 auto;
padding: 12px;
padding-top: 0px;
padding-bottom: env(safe-area-inset-bottom, 12px);
}
@@ -131,17 +132,6 @@ body {
touch-action: pan-y;
}
.calendar-sticky.is-scrolled {
box-shadow: 0 4px 6px -4px rgba(0, 0, 0, 0.25);
}
[data-theme="light"] .calendar-sticky.is-scrolled {
box-shadow: 0 4px 6px -4px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .calendar-sticky.is-scrolled {
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
.calendar {
display: grid;
@@ -228,7 +218,7 @@ body {
position: fixed;
z-index: 1000;
width: max-content;
max-width: min(280px, calc(100vw - 24px));
max-width: min(90vw, 600px);
padding: 8px 12px;
background: var(--surface);
color: var(--text);
@@ -236,15 +226,49 @@ body {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
font-size: 0.85rem;
line-height: 1.4;
white-space: pre-wrap;
word-break: break-word;
white-space: pre;
overflow: visible;
transform: translateY(-100%);
}
.calendar-event-hint .calendar-event-hint-rows {
white-space: normal;
}
.calendar-event-hint.below {
transform: none;
}
.calendar-event-hint-title {
margin-bottom: 4px;
font-weight: 600;
}
.calendar-event-hint-rows {
display: flex;
flex-direction: column;
gap: 2px;
}
.calendar-event-hint-row {
display: table;
width: max-content;
white-space: nowrap;
}
.calendar-event-hint-row .calendar-event-hint-time {
display: table-cell;
white-space: nowrap;
min-width: 8.5em;
vertical-align: top;
padding-right: 0.35em;
}
.calendar-event-hint-row .calendar-event-hint-name {
display: table-cell;
white-space: nowrap !important;
}
/* Маркеры: компактный размер 11px, кнопки для доступности и тапа */
.duty-marker,
.unavailable-marker,