-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.03 PWA deployment, and full screen feature.
- Loading branch information
Showing
10 changed files
with
361 additions
and
196 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"lang": "zh-CN", | ||
"name": "山田凉上山", | ||
"short_name": "山田凉上山", | ||
"icons": [ | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// For SamToki.github.io/Yamanobo-Ryou | ||
// Released under GNU GPL v3 open source license. | ||
// (C) 2024 SAM TOKI STUDIO | ||
|
||
// Initialization | ||
// Declare variables | ||
"use strict"; | ||
// Unsaved | ||
const CacheName = "Yamanobo-Ryou_v1.03"; | ||
|
||
// Listeners | ||
// Service worker (https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/#step-5---add-a-service-worker) | ||
self.addEventListener("install", Event => { | ||
Event.waitUntil((async() => { | ||
const CacheContent = await caches.open(CacheName); | ||
CacheContent.addAll([ | ||
"index.html", | ||
"icons/favicon.ico", | ||
"../styles/common.css", | ||
"../styles/common_Dark.css", | ||
"../styles/common_Genshin.css", | ||
"../styles/common_HighContrast.css", | ||
"styles/style.css", | ||
"styles/style_Dark.css", | ||
"styles/style_Genshin.css", | ||
"styles/style_HighContrast.css", | ||
"../scripts/common.js", | ||
"../scripts/common_UserDataRepairer.js", | ||
"scripts/script.js", | ||
"manifests/manifest.json", | ||
"../cursors/BTRAhoge.cur", | ||
"../cursors/Genshin.cur", | ||
"../cursors/GenshinFurina.cur", | ||
"../cursors/GenshinNahida.cur", | ||
"images/Icon.png", | ||
"images/Icon_Large.png", | ||
"images/Icon_Maskable.png", | ||
"images/Preview.jpg", | ||
"images/Background.jpg", | ||
"images/YamadaRyou.png", | ||
"images/GotouHitori.png", | ||
"docs/山田凉上山 快速入门.pdf", | ||
"docs/山田凉上山 说明文档.pdf" | ||
]); | ||
})()); | ||
}); | ||
self.addEventListener("fetch", Event => { | ||
Event.respondWith((async() => { | ||
const CacheContent = await caches.open(CacheName); | ||
const CachedResponse = await CacheContent.match(Event.request); | ||
if(CachedResponse) { | ||
return CachedResponse; | ||
} else { | ||
const FetchResponse = await fetch(Event.request); | ||
CacheContent.put(Event.request, FetchResponse.clone()); | ||
return FetchResponse; | ||
} | ||
})()); | ||
}); |
This file contains 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
Oops, something went wrong.