feat: add PWA and offline mode support with local caching and action safeguards

This commit is contained in:
tyuXX 2026-10-21 20:26:24 +00:00
parent 039b5ac483
commit 128a5f7553
15 changed files with 589 additions and 0 deletions

View file

@ -2241,3 +2241,84 @@ code {
}
}
/* ==================================================== */
/* PWA & Offline Indicator Banner */
/* ==================================================== */
.offline-banner {
width: 100%;
padding: 6px 16px;
font-size: 0.8rem;
font-weight: 500;
text-align: center;
position: sticky;
top: 0;
z-index: 200;
transition: all 0.25s ease-in-out;
display: flex;
justify-content: center;
align-items: center;
}
.offline-banner.active {
background: #fef3c7;
color: #92400e;
border-bottom: 1px solid #fde68a;
}
.offline-banner.online {
background: #dcfce7;
color: #166534;
border-bottom: 1px solid #bbf7d0;
}
.offline-banner.hidden {
display: none !important;
}
.offline-banner-content {
display: inline-flex;
align-items: center;
gap: 10px;
}
.offline-badge-pill {
background: #fde047;
color: #713f12;
font-size: 0.7rem;
font-weight: 700;
padding: 1px 7px;
border-radius: 9999px;
text-transform: uppercase;
letter-spacing: 0.03em;
}
.online-badge-pill {
background: #86efac;
color: #14532d;
font-size: 0.7rem;
font-weight: 700;
padding: 1px 7px;
border-radius: 9999px;
text-transform: uppercase;
letter-spacing: 0.03em;
}
.offline-banner-text {
font-size: 0.825rem;
}
/* Offline state modifications on buttons and checkboxes */
.btn-offline-disabled {
opacity: 0.55 !important;
cursor: not-allowed !important;
pointer-events: none;
filter: grayscale(40%);
}
.assignment-toggle:disabled {
cursor: not-allowed;
opacity: 0.6;
}