snap7
jmoenig 2021-07-10 20:52:07 +02:00
rodzic 1df9bcc891
commit f80b97d50c
9 zmienionych plików z 94 dodań i 2 usunięć

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 6.6 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 7.6 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 8.1 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 11 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 29 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 60 KiB

35
manifest.json 100644
Wyświetl plik

@ -0,0 +1,35 @@
{
"name": "Snap! Build Your Own Blocks",
"short_name": "Snap!",
"icons": [{
"src": "img/snap-icon-128.png",
"sizes": "128x128",
"type": "image/png"
}, {
"src": "img/snap-icon-144.png",
"sizes": "144x144",
"type": "image/png"
}, {
"src": "img/snap-icon-152.png",
"sizes": "152x152",
"type": "image/png"
}, {
"src": "img/snap-icon-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any maskable"
}, {
"src": "img/snap-icon-256.png",
"sizes": "256x256",
"type": "image/png"
}, {
"src": "img/snap-icon-512.png",
"sizes": "512x512",
"type": "image/png"
}],
"lang": "en-US",
"start_url": "/snap.html",
"display": "standalone",
"background_color": "white",
"theme_color": "white"
}

Wyświetl plik

@ -1,10 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>Snap! 7 - dev - Build Your Own Blocks</title>
<link rel="icon" href="src/favicon.ico" type="image/x-icon">
<link rel="manifest" href="/manifest.json">
<link rel="apple-touch-icon" href="img/snap-icon-152.png">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Snap! 7 - dev - Build Your Own Blocks</title>
<link rel="icon" href="src/favicon.ico">
<meta name="theme-color" content="white"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Snap!">
<meta name="msapplication-TileImage" content="img/snap-icon-144.png">
<meta name="msapplication-TileColor" content="#FFFFFF">
<script src="src/morphic.js?version=2021-07-09"></script>
<script src="src/symbols.js?version=2021-03-03"></script>
<script src="src/widgets.js?version=2021-07-05"></script>
@ -31,6 +39,9 @@
<script>
var world;
window.onload = function () {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./sw.js');
}
world = new WorldMorph(document.getElementById('world'));
new IDE_Morph().openIn(world);
loop();

46
sw.js 100644
Wyświetl plik

@ -0,0 +1,46 @@
var cacheName = 'snap-pwa';
var filesToCache = [
'/',
'/snap.html',
'/src/morphic.js',
'/src/symbols.js',
'/src/widgets.js',
'/src/blocks.js',
'/src/threads.js',
'/src/objects.js',
'/src/scenes.js',
'/src/gui.js',
'/src/paint.js',
'/src/lists.js',
'/src/byob.js',
'/src/tables.js',
'/src/sketch.js',
'/src/video.js',
'/src/maps.js',
'/src/extensions.js',
'/src/xml.js',
'/src/store.js',
'/src/locale.js',
'/src/cloud.js',
'/src/api.js',
'/src/sha512.js',
'/src/FileSaver.min.js'
];
/* Start the service worker and cache all of the app's content */
self.addEventListener('install', function(e) {
e.waitUntil(
caches.open(cacheName).then(function(cache) {
return cache.addAll(filesToCache);
})
);
});
/* Serve cached content when offline */
self.addEventListener('fetch', function(e) {
e.respondWith(
caches.match(e.request).then(function(response) {
return response || fetch(e.request);
})
);
});