-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsw_hexical.js
45 lines (44 loc) · 1.65 KB
/
sw_hexical.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
self.addEventListener('install', (e)=>{
e.waitUntil(
caches.open('hexical').then((cache)=>{
return Promise.all([
'/animation/hexical/index.html',
'/animation/css/pwa.css',
'/animation/lib/svg.min.js',
'/animation/lib/vivus.min.js',
'/animation/lib/flubber.min.js',
'/animation/lib/gif.js',
'/animation/lib/gif.worker.js',
'/animation/lib/jszip.min.js',
'/animation/lib/FileSaver.js',
'/animation/lib/honeycomb.min.js',
'/animation/lib/Tone.js',
'/animation/lib/mousetrap.min.js',
'/animation/lib/hammer.min.js',
'/animation/js/core/Transformation.js',
'/animation/js/core/AnimationQueue.js',
'/animation/js/core/Animated.js',
'/animation/js/core/MagicContainer.js',
'/animation/js/core/External.js',
'/animation/js/components/hexical/HexGrid.js',
'/animation/js/components/hexical/HexMover.js',
'/animation/js/components/hexical/MusicalHexMover.js',
'/animation/js/components/hexical/ControlledHexMover.js',
'/animation/js/components/hexical/Metronome.js',
'/animation/js/components/hexical/HexMoveQueue.js',
'/animation/js/core/Player.js',
'/animation/js/core/Scene.js',
'/animation/js/scenes.js',
].map((url)=>{cache.add(url);})
);
}).catch(console.error)
);
});
self.addEventListener('fetch', (e)=>{
console.log(e.request.url);
e.respondWith(
caches.match(e.request).then((response)=>{
return response || fetch(e.request);
}).catch(console.error)
);
});