mtllib cibe.mtl o Cube.002_Cube.004 v -0.220941 -0.388026 0.862489 v -0.225505 -0.357192 0.861503 v -0.215057 -0.386801 0.830920 v -0.213984 -0.417310 0.864002 v -0.225144 -0.388901 0.894057 v -0.229915 -0.357643 0.893564
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @name jsToSassVariables | |
| * @param {Object} obj | |
| * @returns {String} | |
| */ | |
| function jsToSassVariables(obj) { | |
| const { stringify, parse } = JSON | |
| // remove null, undefined values and functions | |
| const objStr = stringify(obj) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| self.addEventListener('activate', function(event) { | |
| event.waitUntil( | |
| createDB() | |
| ); | |
| }); | |
| function createDB() { | |
| idb.open('products', 1, function(upgradeDB) { | |
| var store = upgradeDB.createObjectStore('beverages', { | |
| keyPath: 'id' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| self.addEventListener('fetch', event => { | |
| console.log('Fetch intercepted for:', event.request.url); | |
| event.respondWith(caches.match(event.request) | |
| .then(cachedResponse => { | |
| if (cachedResponse) { | |
| return cachedResponse; | |
| } | |
| return fetch(event.request); | |
| }) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const CACHE_NAME = 'cache-v1'; | |
| const precacheResources = [ | |
| 'index.html', | |
| 'styles/main.css', | |
| // your files ... | |
| ]; | |
| self.addEventListener('install', event => { | |
| console.log('Service worker install event!'); | |
| event.waitUntil( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| self.addEventListener('activate', function(event) { | |
| event.waitUntil( | |
| caches.keys().then(function(cacheNames) { | |
| return Promise.all( | |
| cacheNames.map(function(cacheName) { | |
| return caches.delete(cacheName); | |
| }) | |
| ); | |
| }) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const CACHE_NAME = 'cache-v1'; | |
| const precacheResources = [ | |
| '/', | |
| 'index.html', | |
| 'styles/main.css', | |
| 'images/space1.jpg', | |
| 'images/space2.jpg', | |
| 'images/space3.jpg' | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ('serviceWorker' in navigator) { | |
| navigator.serviceWorker.register('/service-worker.js') | |
| .then(function(registration) { | |
| console.log('Registration successful, scope is:', registration.scope); | |
| }) | |
| .catch(function(error) { | |
| console.log('Service worker registration failed, error:', error); | |
| }); | |
| } |