christmas update
This commit is contained in:
@ -42,4 +42,13 @@ body[theme=sky] {
|
||||
--color-2: #2ab9f2;
|
||||
--color-3: #3188bd;
|
||||
--color-4: #23588a;
|
||||
}
|
||||
body[theme=xmas] {
|
||||
--text-color: #dcffab;
|
||||
--bg-1: #a00000;
|
||||
--bg-2: #400000;
|
||||
--color-1: #dcffab;
|
||||
--color-2: #a32a2a;
|
||||
--color-3: #000000;
|
||||
--color-4: #630000;
|
||||
}
|
||||
@ -241,7 +241,7 @@
|
||||
<mobile-warning><h1 class="title">your device is not supported!</h1><p>please rotate your screen for the best experience.</p></mobile-warning>
|
||||
<loading-game><h1 class="title">we are loading your game!</h1><p>please allow us to fetch the data first, this should only take a second.</p></loading-game>
|
||||
<body>
|
||||
<iframe id="iframe" src="home.html"></iframe>
|
||||
<iframe id="iframe" src="home.html" allow="cross-origin-isolated"></iframe>
|
||||
<!-- to do
|
||||
add colors -->
|
||||
<sidebar>
|
||||
|
||||
110
js/christmas-particlesjs-config.json
Executable file
110
js/christmas-particlesjs-config.json
Executable file
@ -0,0 +1,110 @@
|
||||
{
|
||||
"particles": {
|
||||
"number": {
|
||||
"value": 94,
|
||||
"density": {
|
||||
"enable": true,
|
||||
"value_area": 800
|
||||
}
|
||||
},
|
||||
"color": {
|
||||
"value": "#fff"
|
||||
},
|
||||
"shape": {
|
||||
"type": "circle",
|
||||
"stroke": {
|
||||
"width": 0,
|
||||
"color": "#000000"
|
||||
},
|
||||
"polygon": {
|
||||
"nb_sides": 5
|
||||
},
|
||||
"image": {
|
||||
"src": "img/github.svg",
|
||||
"width": 100,
|
||||
"height": 100
|
||||
}
|
||||
},
|
||||
"opacity": {
|
||||
"value": 0.5,
|
||||
"random": true,
|
||||
"anim": {
|
||||
"enable": false,
|
||||
"speed": 1,
|
||||
"opacity_min": 0.1,
|
||||
"sync": false
|
||||
}
|
||||
},
|
||||
"size": {
|
||||
"value": 10,
|
||||
"random": true,
|
||||
"anim": {
|
||||
"enable": false,
|
||||
"speed": 40,
|
||||
"size_min": 0.1,
|
||||
"sync": false
|
||||
}
|
||||
},
|
||||
"line_linked": {
|
||||
"enable": false,
|
||||
"distance": 500,
|
||||
"color": "#ffffff",
|
||||
"opacity": 0.4,
|
||||
"width": 2
|
||||
},
|
||||
"move": {
|
||||
"enable": true,
|
||||
"speed": 9.590256299599611,
|
||||
"direction": "bottom",
|
||||
"random": false,
|
||||
"straight": false,
|
||||
"out_mode": "out",
|
||||
"bounce": false,
|
||||
"attract": {
|
||||
"enable": false,
|
||||
"rotateX": 1678.2948524299318,
|
||||
"rotateY": 3196.752099866537
|
||||
}
|
||||
}
|
||||
},
|
||||
"interactivity": {
|
||||
"detect_on": "window",
|
||||
"events": {
|
||||
"onhover": {
|
||||
"enable": true,
|
||||
"mode": "bubble"
|
||||
},
|
||||
"onclick": {
|
||||
"enable": true,
|
||||
"mode": "repulse"
|
||||
},
|
||||
"resize": true
|
||||
},
|
||||
"modes": {
|
||||
"grab": {
|
||||
"distance": 400,
|
||||
"line_linked": {
|
||||
"opacity": 0.5
|
||||
}
|
||||
},
|
||||
"bubble": {
|
||||
"distance": 400,
|
||||
"size": 4,
|
||||
"duration": 0.3,
|
||||
"opacity": 1,
|
||||
"speed": 3
|
||||
},
|
||||
"repulse": {
|
||||
"distance": 79.60199004975124,
|
||||
"duration": 0.4
|
||||
},
|
||||
"push": {
|
||||
"particles_nb": 4
|
||||
},
|
||||
"remove": {
|
||||
"particles_nb": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"retina_detect": true
|
||||
}
|
||||
@ -13,7 +13,7 @@ function loadPJS() {
|
||||
script.src = "https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js";
|
||||
document.head.appendChild(script);
|
||||
script.addEventListener("load", ()=>{
|
||||
particlesJS.load('pjs', "/js/particlesjs-config.json", ()=>{});
|
||||
particlesJS.load('pjs', "/js/christmas-particlesjs-config.json", ()=>{});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
</head>
|
||||
<body>
|
||||
<iframe id="gameFrame"></iframe>
|
||||
<iframe id="gameFrame" allow="cross-origin-isolated"></iframe>
|
||||
<div id="infobox">
|
||||
<img id="gameImage" src="favicon.png" />
|
||||
<h2 id="gameName">Selenite</h2>
|
||||
|
||||
@ -204,6 +204,7 @@
|
||||
<p style="font-size:20px;margin:6px;">themes</p>
|
||||
<select id="themes">
|
||||
<option value="">selenite</option>
|
||||
<option value="xmas">CHRISTMAS! (limited)</option>
|
||||
<option value="blackandwhite">black and white</option>
|
||||
<option value="grass">grass</option>
|
||||
<option value="evil">evil</option>
|
||||
|
||||
144
sw.js
144
sw.js
@ -1,79 +1,77 @@
|
||||
importScripts(
|
||||
'https://storage.googleapis.com/workbox-cdn/releases/6.4.1/workbox-sw.js'
|
||||
);
|
||||
// importScripts(
|
||||
// 'https://storage.googleapis.com/workbox-cdn/releases/6.4.1/workbox-sw.js'
|
||||
// );
|
||||
|
||||
let localStorageData = {
|
||||
cdns: [],
|
||||
disableCDN: true,
|
||||
};
|
||||
// yandere sim big files, cuphead, renpy, renpy, buckshot roulette, half life, undertale & deltarune, hollow knight
|
||||
let cacheable_files = ["YandereSim.data", "cuphead/Build/Build.data.unityweb.", "renpy.data", "game.zip", "buckshot-roulette.pck", "halva_en-", "game.unx", "bog.data"];
|
||||
// let localStorageData = {
|
||||
// cdns: [],
|
||||
// disableCDN: true,
|
||||
// };
|
||||
// // yandere sim big files, cuphead, ddlc assets, renpy, renpy, buckshot roulette, half life, undertale & deltarune, hollow knight
|
||||
// let cacheable_files = ["YandereSim.data", "cuphead/Build/Build.data.unityweb.", "/ddlc/game/", "/co09/game/", "/co09flipside/game/", "/co09reup/game/", "renpy.data", "game.zip", "buckshot-roulette.pck", "halva_en-", "game.unx", "bog.data", "FTFHAPort.data.unityweb"];
|
||||
|
||||
self.addEventListener("message", e => {
|
||||
if(e.data && e.data.type == "localStorage") {
|
||||
localStorageData = e.data;
|
||||
console.log(localStorageData);
|
||||
}
|
||||
});
|
||||
// self.addEventListener("message", e => {
|
||||
// if(e.data && e.data.type == "localStorage") {
|
||||
// localStorageData = e.data;
|
||||
// }
|
||||
// });
|
||||
|
||||
if(workbox) {
|
||||
self.skipWaiting();
|
||||
workbox.core.clientsClaim();
|
||||
// if(workbox) {
|
||||
// self.skipWaiting();
|
||||
// workbox.core.clientsClaim();
|
||||
|
||||
workbox.routing.registerRoute(
|
||||
({url}) => {
|
||||
console.log(localStorageData)
|
||||
if(localStorageData.disableCDN) return false;
|
||||
if(localStorageData.cdns.length == 0) return false;
|
||||
if(url.origin != location.origin) return false;
|
||||
if(!url.pathname.includes("/resources/")) return false;
|
||||
for (const file of cacheable_files) {
|
||||
if(url.pathname.includes(file)) return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
async ({url}) => {
|
||||
let cdn = localStorageData.cdns[0];
|
||||
console.warn(url.href);
|
||||
return Response.redirect(cdn + url.pathname, 302);
|
||||
}
|
||||
);
|
||||
// workbox.routing.registerRoute(
|
||||
// ({url}) => {
|
||||
// if(localStorageData.disableCDN) return false;
|
||||
// if(localStorageData.cdns.length == 0) return false;
|
||||
// if(url.origin != location.origin) return false;
|
||||
// if(!url.pathname.includes("/resources/")) return false;
|
||||
// for (const file of cacheable_files) {
|
||||
// if(url.pathname.includes(file)) return true;
|
||||
// }
|
||||
// return false;
|
||||
// },
|
||||
// async ({url}) => {
|
||||
// let cdn = localStorageData.cdns[0];
|
||||
// console.warn(url.href);
|
||||
// return Response.redirect(cdn + url.pathname, 302);
|
||||
// }
|
||||
// );
|
||||
|
||||
workbox.routing.registerRoute(
|
||||
/\.(?:png|gif|jpg|jpeg|svg|webp|avif|gif)$/,
|
||||
new workbox.strategies.CacheFirst({
|
||||
cacheName: 'images-cache',
|
||||
plugins: [
|
||||
new workbox.expiration.ExpirationPlugin({
|
||||
maxEntries: 1200,
|
||||
maxAgeSeconds: 365 * 24 * 60 * 60,
|
||||
}),
|
||||
],
|
||||
})
|
||||
);
|
||||
workbox.routing.registerRoute(
|
||||
/.*resources\/(semag|sppa).*/,
|
||||
new workbox.strategies.CacheFirst({
|
||||
cacheName: 'resources-cache',
|
||||
plugins: [
|
||||
new workbox.expiration.ExpirationPlugin({
|
||||
maxEntries: 500,
|
||||
maxAgeSeconds: 365 * 24 * 60 * 60,
|
||||
}),
|
||||
],
|
||||
})
|
||||
);
|
||||
// workbox.routing.registerRoute(
|
||||
// /\.(?:png|gif|jpg|jpeg|svg|webp|avif|gif)$/,
|
||||
// new workbox.strategies.CacheFirst({
|
||||
// cacheName: 'images-cache',
|
||||
// plugins: [
|
||||
// new workbox.expiration.ExpirationPlugin({
|
||||
// maxEntries: 1200,
|
||||
// maxAgeSeconds: 365 * 24 * 60 * 60,
|
||||
// }),
|
||||
// ],
|
||||
// })
|
||||
// );
|
||||
// workbox.routing.registerRoute(
|
||||
// /.*resources\/(semag|sppa).*/,
|
||||
// new workbox.strategies.CacheFirst({
|
||||
// cacheName: 'resources-cache',
|
||||
// plugins: [
|
||||
// new workbox.expiration.ExpirationPlugin({
|
||||
// maxEntries: 500,
|
||||
// maxAgeSeconds: 365 * 24 * 60 * 60,
|
||||
// }),
|
||||
// ],
|
||||
// })
|
||||
// );
|
||||
|
||||
workbox.routing.registerRoute(
|
||||
/.*resources\/(games|apps)\.json$/,
|
||||
new workbox.strategies.StaleWhileRevalidate({
|
||||
cacheName: 'json-cache',
|
||||
plugins: [
|
||||
new workbox.expiration.ExpirationPlugin({
|
||||
maxAgeSeconds: 3 * 60 * 60,
|
||||
maxEntries: 2,
|
||||
}),
|
||||
],
|
||||
})
|
||||
);
|
||||
};
|
||||
// workbox.routing.registerRoute(
|
||||
// /.*resources\/(games|apps)\.json$/,
|
||||
// new workbox.strategies.StaleWhileRevalidate({
|
||||
// cacheName: 'json-cache',
|
||||
// plugins: [
|
||||
// new workbox.expiration.ExpirationPlugin({
|
||||
// maxAgeSeconds: 3 * 60 * 60,
|
||||
// maxEntries: 2,
|
||||
// }),
|
||||
// ],
|
||||
// })
|
||||
// );
|
||||
// };
|
||||
Reference in New Issue
Block a user