feat: add styled PWA update modal with auto cache purge

This commit is contained in:
2026-07-24 19:35:13 +04:00
parent f760dfb72c
commit 7f1bdaa2ab
14 changed files with 331 additions and 52 deletions
+115 -1
View File
@@ -3411,4 +3411,118 @@ i.icon-mastodon,
}
}
/* ==========================================
Modal de mise à jour PWA (js/pwa-update.js)
========================================== */
.pwa-update-overlay {
position: fixed;
inset: 0;
background-color: rgba(0, 0, 0, 0.55);
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
z-index: 10000;
opacity: 0;
transition: opacity 0.25s ease;
}
.pwa-update-overlay.pwa-update-visible {
opacity: 1;
}
.pwa-update-modal {
background-color: var(--card-bg);
color: var(--text-color);
border: 1px solid var(--border-color);
border-radius: 12px;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
max-width: 420px;
width: 100%;
padding: 28px 24px 24px;
text-align: center;
transform: translateY(12px) scale(0.97);
transition: transform 0.25s ease;
}
.pwa-update-visible .pwa-update-modal {
transform: translateY(0) scale(1);
}
.pwa-update-logo {
width: 72px;
height: 72px;
border-radius: 50%;
margin-bottom: 12px;
}
.pwa-update-title {
margin: 0 0 8px;
font-size: 1.25rem;
font-weight: 700;
}
.pwa-update-text {
margin: 0 0 20px;
color: var(--text-secondary);
font-size: 0.95rem;
line-height: 1.5;
}
.pwa-update-actions {
display: flex;
gap: 12px;
justify-content: center;
flex-wrap: wrap;
}
.pwa-update-btn {
border: none;
border-radius: 8px;
padding: 10px 20px;
font-size: 0.95rem;
font-weight: 600;
cursor: pointer;
transition: background-color 0.2s ease, opacity 0.2s ease;
}
.pwa-update-btn:disabled {
opacity: 0.6;
cursor: wait;
}
.pwa-update-btn-primary {
background-color: var(--primary-red);
color: #ffffff;
}
.pwa-update-btn-primary:hover:not(:disabled) {
filter: brightness(0.9);
}
.pwa-update-btn-secondary {
background-color: transparent;
color: var(--text-color);
border: 1px solid var(--border-color);
}
.pwa-update-btn-secondary:hover:not(:disabled) {
background-color: var(--hover-bg);
}
.pwa-update-btn:focus-visible {
outline: 2px solid var(--primary-red);
outline-offset: 2px;
}
@media (max-width: 480px) {
.pwa-update-actions {
flex-direction: column;
}
.pwa-update-btn {
width: 100%;
}
}