feat: added PWA support

This commit is contained in:
2026-03-07 15:48:27 +01:00
parent acfbe71baa
commit fc83bab9f7
8 changed files with 150 additions and 1 deletions

View File

@@ -5,6 +5,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Votify Web</title>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="manifest" href="/static/manifest.json">
<meta name="theme-color" content="#1db954">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Votify Web">
<link rel="apple-touch-icon" href="/static/icons/icon-192x192.png">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
@@ -525,6 +531,12 @@
loadSettings();
checkCookies();
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js')
.then(reg => console.log('SW registered, scope:', reg.scope))
.catch(err => console.error('SW registration failed:', err));
}
</script>
</body>
</html>

View File

@@ -5,6 +5,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Votify Web - Login</title>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="manifest" href="/static/manifest.json">
<meta name="theme-color" content="#1db954">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Votify Web">
<link rel="apple-touch-icon" href="/static/icons/icon-192x192.png">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
@@ -40,5 +46,12 @@
<input type="password" name="password" placeholder="Password" autofocus required>
<button type="submit">Sign In</button>
</form>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js')
.then(reg => console.log('SW registered, scope:', reg.scope))
.catch(err => console.error('SW registration failed:', err));
}
</script>
</body>
</html>