Tu Nombre commited on
Commit
f01295f
·
1 Parent(s): 7c7779c

PWA: manifest y service worker

Browse files
Files changed (4) hide show
  1. familiar.html +2 -0
  2. index.html +2 -0
  3. manifest.json +22 -0
  4. sw.js +8 -0
familiar.html CHANGED
@@ -311,6 +311,8 @@
311
  text-transform: uppercase;
312
  }
313
  </style>
 
 
314
  </head>
315
  <body>
316
 
 
311
  text-transform: uppercase;
312
  }
313
  </style>
314
+ <link rel="manifest" href="/manifest.json">
315
+ <script>if("serviceWorker" in navigator) navigator.serviceWorker.register("/sw.js");</script>
316
  </head>
317
  <body>
318
 
index.html CHANGED
@@ -441,6 +441,8 @@
441
  ::-webkit-scrollbar-track { background: var(--bg); }
442
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
443
  </style>
 
 
444
  </head>
445
  <body>
446
 
 
441
  ::-webkit-scrollbar-track { background: var(--bg); }
442
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
443
  </style>
444
+ <link rel="manifest" href="/manifest.json">
445
+ <script>if("serviceWorker" in navigator) navigator.serviceWorker.register("/sw.js");</script>
446
  </head>
447
  <body>
448
 
manifest.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "Vigilante Paciente",
3
+ "short_name": "Vigilante",
4
+ "description": "Sistema de monitorización de pacientes sin contacto",
5
+ "start_url": "/app",
6
+ "display": "standalone",
7
+ "background_color": "#030a0e",
8
+ "theme_color": "#00e5ff",
9
+ "orientation": "portrait",
10
+ "icons": [
11
+ {
12
+ "src": "https://api.iconify.design/mdi:heart-pulse.svg?color=%2300e5ff&width=192&height=192",
13
+ "sizes": "192x192",
14
+ "type": "image/svg+xml",
15
+ "purpose": "any maskable"
16
+ }
17
+ ],
18
+ "shortcuts": [
19
+ {"name": "Vigilar paciente", "url": "/app"},
20
+ {"name": "Monitor familiar", "url": "/familiar"}
21
+ ]
22
+ }
sw.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ const CACHE = 'vigilante-v1';
2
+ const ARCHIVOS = ['/app', '/familiar'];
3
+ self.addEventListener('install', e => {
4
+ e.waitUntil(caches.open(CACHE).then(cache => cache.addAll(ARCHIVOS)));
5
+ });
6
+ self.addEventListener('fetch', e => {
7
+ e.respondWith(fetch(e.request).catch(() => caches.match(e.request)));
8
+ });