webgal-engine 4.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +373 -0
- package/dist/assets/LXGWWenKai-Regular-9375313a.ttf +0 -0
- package/dist/assets/OPPOSans-R-ea925359.ttf +0 -0
- package/dist/assets/SourceHanSerifCN-Regular-1e60cc2e.ttf +0 -0
- package/dist/assets/dialog-d5b91235.mp3 +0 -0
- package/dist/assets/index-2b8d1f44.css +1 -0
- package/dist/assets/index-8e2b7c73.js +4077 -0
- package/dist/assets/initRegister-c6bb47b8.js +1 -0
- package/dist/assets/page-flip-1-7df32409.mp3 +0 -0
- package/dist/assets/switch-1-99b576bc.mp3 +0 -0
- package/dist/index.html +290 -0
- package/dist/webgal-serviceworker.js +63 -0
- package/package.json +55 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as w,W as p,C,T as k,S as M,a as f,f as P}from"./index-8e2b7c73.js";const T=y=>{const S=p.gameplay.pixiStage.effectsContainer,m=p.gameplay.pixiStage.currentApp,t=new C;S.addChild(t);const a=k.from("./game/tex/cherryBlossoms.png");t.x=m.screen.width/2,t.y=m.screen.height/2,t.pivot.x=t.width/2,t.pivot.y=t.height/2,t.scale.x=1,t.scale.y=1;const i=[];function h(c){var r;const g=f.width,x=f.height,n=new M(a);let d=.25;n.scale.x=.15*d,n.scale.y=.15*d,n.anchor.set(.5),n.x=Math.random()*g-.5*g,n.y=0-.5*x,n.dropSpeed=Math.random()*5,n.acc=Math.random(),t.addChild(n),i.push(n);let l=0;for(const e of i){l++;const s=Math.random();e.dropSpeed=e.acc*.01+e.dropSpeed,e.y+=c*y*e.dropSpeed*.3+.7,l%2===0?(e.x+=c*s*.5,e.rotation+=c*s*.03):(e.x-=c*s*.5,e.rotation-=c*s*.03)}i.length>=200&&((r=i.shift())==null||r.destroy(),t.removeChild(t.children[0]))}return p.gameplay.pixiStage.registerAnimation({setStartState:()=>{},setEndState:()=>{},tickerFunc:h},"cherryBlossoms-Ticker"),{container:t,tickerKey:"cherryBlossoms-Ticker"}};w("cherryBlossoms",()=>T(3));const b=(y,u)=>{var g;const m=p.gameplay.pixiStage.effectsContainer,t=p.gameplay.pixiStage.currentApp,a=new C;m.addChild(a);const i=k.from("./game/tex/raindrop.png");a.x=t.screen.width/2,a.y=t.screen.height/2,a.pivot.x=a.width/2,a.pivot.y=a.height/2,a.scale.x=1,a.scale.y=1;const h=[];function c(x){var l;const n=f.width,d=f.height;for(let r=0;r<u;r++){const e=new M(i);let s=Math.random()*2.5+1.5;e.filters=[new P.BlurFilter(s)];let o=Math.random();o<=.5&&(o=.5),e.scale.x=.48*o,e.scale.y=.48*o,e.anchor.set(.5),e.x=Math.random()*n-.5*n,e.y=0-.5*d,e.dropSpeed=Math.random()*1.5,e.acc=Math.random()+.25,e.alpha=Math.random(),e.alpha>=.95&&(e.alpha=.95),e.alpha<=.8&&(e.alpha=.8),a.addChild(e),h.push(e),h.length>=500&&((l=h.shift())==null||l.destroy(),a.removeChild(a.children[0]))}for(const r of h)r.dropSpeed=r.acc*.01+r.dropSpeed,r.y+=x*y*r.dropSpeed*1.1+3}return(g=p.gameplay.pixiStage)==null||g.registerAnimation({setStartState:()=>{},setEndState:()=>{},tickerFunc:c},"rain-Ticker"),{container:a,tickerKey:"rain-Ticker"}};w("rain",()=>b(6,3));const v=y=>{var n;const S=p.gameplay.pixiStage.effectsContainer,m=p.gameplay.pixiStage.currentApp,t=new C;S.addChild(t);const a=k.from("./game/tex/snowFlake_min.png");t.x=m.screen.width/2,t.y=m.screen.height/2,t.pivot.x=t.width/2,t.pivot.y=t.height/2,t.scale.x=1,t.scale.y=1;const i=[];let h=0;const c=f.width,g=f.height;function x(d){var r;if(h++,h%7===1){const e=new M(a);let s=Math.random()*8+1;e.filters=[new P.BlurFilter(s)];let o=Math.random();o<=.5&&(o=.5),e.scale.x=.144*o,e.scale.y=.144*o,e.anchor.set(.5),e.x=Math.random()*c-.5*c,e.y=0-.5*g,e.dropSpeed=Math.random()*2,e.acc=Math.random(),t.addChild(e),i.push(e)}let l=0;for(const e of i){l++;const s=Math.random();e.dropSpeed=e.acc*.01+e.dropSpeed,e.y+=d*y*e.dropSpeed*.3+.7,l%2===0?(e.x+=d*s*.5,e.rotation+=d*s*.03):(e.x-=d*s*.5,e.rotation-=d*s*.03)}i.length>=100&&((r=i.shift())==null||r.destroy(),t.removeChild(t.children[0]))}return(n=p.gameplay.pixiStage)==null||n.registerAnimation({setStartState:()=>{},setEndState:()=>{},tickerFunc:x},"snow-Ticker"),{container:t,tickerKey:"snow-Ticker"}};w("snow",()=>v(3));
|
|
Binary file
|
|
Binary file
|
package/dist/index.html
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-Hans">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8"/>
|
|
5
|
+
<link rel="icon" type="image/x-icon" href="./icons/favicon.ico" />
|
|
6
|
+
<link rel="apple-touch-icon" href="./icons/apple-touch-icon.png">
|
|
7
|
+
<link rel="manifest" href="./manifest.json" />
|
|
8
|
+
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>-->
|
|
9
|
+
<title>WebGAL</title>
|
|
10
|
+
<script type="module" crossorigin src="./assets/index-8e2b7c73.js"></script>
|
|
11
|
+
<link rel="stylesheet" href="./assets/index-2b8d1f44.css">
|
|
12
|
+
</head>
|
|
13
|
+
|
|
14
|
+
<body>
|
|
15
|
+
<!--快速显示落地页,让用户感知不到加载的过程-->
|
|
16
|
+
<div id="ebg"></div>
|
|
17
|
+
<div id="Title_enter_page" onclick="enter()" style="
|
|
18
|
+
width: 2560px;
|
|
19
|
+
height: 1440px;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0;
|
|
23
|
+
z-index: 14;
|
|
24
|
+
opacity: 1;
|
|
25
|
+
transition: opacity 1.5s;
|
|
26
|
+
">
|
|
27
|
+
<!-- 落地页背景-->
|
|
28
|
+
<div id="Title_bg_container" style="
|
|
29
|
+
height: 100%;
|
|
30
|
+
width: 100%;
|
|
31
|
+
position: absolute;
|
|
32
|
+
background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
|
|
33
|
+
top: 0;
|
|
34
|
+
opacity: 1;
|
|
35
|
+
transition: opacity 1s;
|
|
36
|
+
"></div>
|
|
37
|
+
<!-- 点击后的白色渐变-->
|
|
38
|
+
<div id="Title_white_container" style="
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 0;
|
|
43
|
+
opacity: 0;
|
|
44
|
+
background: linear-gradient(165deg,rgba(255,255,255,0.25) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,0.25) 100%);
|
|
45
|
+
transition: opacity 1s;
|
|
46
|
+
"></div>
|
|
47
|
+
<!-- 落地页文字-->
|
|
48
|
+
<div id="Title_enter_text" style="width: 100%;
|
|
49
|
+
position: absolute;
|
|
50
|
+
top: 0;
|
|
51
|
+
height: 100%;
|
|
52
|
+
opacity: 1;
|
|
53
|
+
font-size: 175%;
|
|
54
|
+
transition: opacity 1s;
|
|
55
|
+
z-index: 15;
|
|
56
|
+
font-family: '思源宋体',Georgia,serif">
|
|
57
|
+
<div class="toCenter" style="
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
display: flex;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
align-items: center;
|
|
63
|
+
">
|
|
64
|
+
<div class="StartButton" style="
|
|
65
|
+
letter-spacing: 0.25em ;
|
|
66
|
+
padding: 2em 2em 2em 2em;
|
|
67
|
+
text-shadow: 0 0 30px rgba(0,0,0,0.5);
|
|
68
|
+
transition: text-shadow 1s;
|
|
69
|
+
font-size: 175%;
|
|
70
|
+
">
|
|
71
|
+
PRESS THE SCREEN TO START
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
<div style="position: absolute;
|
|
75
|
+
bottom: 1em;
|
|
76
|
+
display: flex;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
width: 100%;
|
|
79
|
+
flex-flow: column;
|
|
80
|
+
align-items: center ">
|
|
81
|
+
<div style="padding: 0 0 0.25em 0">
|
|
82
|
+
Powered by <a href="https://github.com/OpenWebGAL/WebGAL"
|
|
83
|
+
onclick="jump(event, 'https://github.com/OpenWebGAL/WebGAL')">WebGAL</a> Framework
|
|
84
|
+
</div>
|
|
85
|
+
<div>
|
|
86
|
+
Made with ❤ by <a href="https://github.com/OpenWebGAL"
|
|
87
|
+
onclick="jump(event, 'https://github.com/OpenWebGAL')">OpenWebGAL</a>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
<div id="panic-overlay"> <!-- 紧急回避 --> </div>
|
|
93
|
+
<div id="root"></div>
|
|
94
|
+
<script>
|
|
95
|
+
/**
|
|
96
|
+
* 在窗口大小改变时进行强制缩放
|
|
97
|
+
*/
|
|
98
|
+
const ua = navigator.userAgent;
|
|
99
|
+
const isIOSDevice = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
|
100
|
+
function resize() {
|
|
101
|
+
const targetHeight = 1440;
|
|
102
|
+
const targetWidth = 2560;
|
|
103
|
+
|
|
104
|
+
const h = window.innerHeight; // 窗口高度
|
|
105
|
+
const w = window.innerWidth; // 窗口宽度
|
|
106
|
+
const zoomH = h / targetHeight; // 以窗口高度为基准的变换比
|
|
107
|
+
const zoomW = w / targetWidth; // 以窗口宽度为基准的变换比
|
|
108
|
+
const zoomH2 = w / targetHeight; // 竖屏时以窗口高度为基础的变换比
|
|
109
|
+
const zoomW2 = h / targetWidth; // 竖屏时以窗口宽度为基础的变换比
|
|
110
|
+
let mh = (targetHeight - h) / 2; // y轴移动距离
|
|
111
|
+
let mw = (targetWidth - w) / 2; // x轴移动距离
|
|
112
|
+
let mh2os = targetWidth / 2 - w / 2; // 竖屏时 y轴移动距离
|
|
113
|
+
let mw2os = targetHeight / 2 - h / 2; // 竖屏时 x轴移动距离
|
|
114
|
+
let transform = '';
|
|
115
|
+
let ebgTransform = '';
|
|
116
|
+
const root = document.getElementById('root'); // 获取根元素
|
|
117
|
+
const title = document.getElementById('Title_enter_page');
|
|
118
|
+
const ebg = document.getElementById('ebg');
|
|
119
|
+
const elements = [root, title];
|
|
120
|
+
if (w > h) {
|
|
121
|
+
const ebg = document.getElementById('ebg');
|
|
122
|
+
if (ebg) {
|
|
123
|
+
ebg.style.height = `100vh`;
|
|
124
|
+
ebg.style.width = `100vw`;
|
|
125
|
+
ebgTransform = '';
|
|
126
|
+
}
|
|
127
|
+
mw = -mw;
|
|
128
|
+
mh = -mh;
|
|
129
|
+
if (w * (9 / 16) >= h) {
|
|
130
|
+
transform = `translate(${mw}px, ${mh}px) scale(${zoomH},${zoomH})`;
|
|
131
|
+
}
|
|
132
|
+
if (w * (9 / 16) < h) {
|
|
133
|
+
transform = `translate(${mw}px, ${mh}px) scale(${zoomW},${zoomW})`;
|
|
134
|
+
}
|
|
135
|
+
} else {
|
|
136
|
+
/**
|
|
137
|
+
* 旋转
|
|
138
|
+
*/
|
|
139
|
+
if (ebg) {
|
|
140
|
+
ebg.style.height = `${targetHeight}px`;
|
|
141
|
+
ebg.style.width = `${targetWidth}px`;
|
|
142
|
+
}
|
|
143
|
+
mw2os = -mw2os;
|
|
144
|
+
if (h * (9 / 16) >= w) {
|
|
145
|
+
ebgTransform = `rotate(90deg) translate(${mw2os}px, ${mh2os}px) scale(${zoomH2 * 1.75},${zoomH2 * 1.75})`;
|
|
146
|
+
transform = `rotate(90deg) translate(${mw2os}px, ${mh2os}px) scale(${zoomH2},${zoomH2})`;
|
|
147
|
+
}
|
|
148
|
+
if (h * (9 / 16) < w) {
|
|
149
|
+
ebgTransform = `rotate(90deg) translate(${mw2os}px, ${mh2os}px) scale(${zoomW2 * 1.75},${zoomW2 * 1.75})`;
|
|
150
|
+
transform = `rotate(90deg) translate(${mw2os}px, ${mh2os}px) scale(${zoomW2},${zoomW2})`;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* iOS 不强制旋转
|
|
154
|
+
*/
|
|
155
|
+
if (isIOSDevice) {
|
|
156
|
+
const zoomWi = w / targetWidth;
|
|
157
|
+
transform = `translate(${-mw}px, ${-mh}px) scale(${zoomWi},${zoomWi})`
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (ebg) {
|
|
161
|
+
ebg.style.transform = ebgTransform;
|
|
162
|
+
}
|
|
163
|
+
for (const element of elements) {
|
|
164
|
+
if (element) {
|
|
165
|
+
element.style.transform = transform;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (!isIOSDevice) {
|
|
171
|
+
// 创建一个新的 meta 标签
|
|
172
|
+
const meta = document.createElement('meta');
|
|
173
|
+
meta.name = "viewport";
|
|
174
|
+
meta.content = "width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no";
|
|
175
|
+
// 将该标签添加到 head 中
|
|
176
|
+
document.getElementsByTagName('head')[0].appendChild(meta);
|
|
177
|
+
resize();
|
|
178
|
+
window.onload = resize;
|
|
179
|
+
window.onresize = resize;
|
|
180
|
+
// 监听键盘 F11 事件,全屏时触发页面调整
|
|
181
|
+
document.onkeydown = function (event) {
|
|
182
|
+
const e = event;
|
|
183
|
+
if (e && e.key === 'F11') {
|
|
184
|
+
setTimeout(() => {
|
|
185
|
+
resize();
|
|
186
|
+
}, 100);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
} else {
|
|
190
|
+
// ios
|
|
191
|
+
const meta = document.createElement('meta');
|
|
192
|
+
meta.name = "viewport";
|
|
193
|
+
meta.content = "width=device-width, initial-scale=0.22, minimum-scale=0.01, maximum-scale=1";
|
|
194
|
+
document.getElementsByTagName('head')[0].appendChild(meta);
|
|
195
|
+
const style = document.createElement('style');
|
|
196
|
+
style.type = 'text/css';
|
|
197
|
+
style.textContent = '* { font-synthesis: none !important; }';
|
|
198
|
+
document.head.appendChild(style);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
</script>
|
|
202
|
+
<script>
|
|
203
|
+
/**
|
|
204
|
+
* 注册 Service Worker
|
|
205
|
+
*/
|
|
206
|
+
const u = navigator.userAgent;
|
|
207
|
+
const isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // 判断是否是 iOS终端
|
|
208
|
+
if ("serviceWorker" in navigator && !isIOS) {
|
|
209
|
+
navigator.serviceWorker.register("./webgal-serviceworker.js").then(function (reg) {
|
|
210
|
+
// registration worked
|
|
211
|
+
console.log("Registration succeeded. Scope is " + reg.scope);
|
|
212
|
+
}).catch(function (error) {
|
|
213
|
+
// registration failed
|
|
214
|
+
console.log("Registration failed with " + error);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
</script>
|
|
218
|
+
|
|
219
|
+
<!--<script type="module" src="/src/Core/util/resize.ts"></script>-->
|
|
220
|
+
<!--<script src="lib/live2d.min.js"></script>-->
|
|
221
|
+
<!--<script src="lib/live2dcubismcore.min.js"></script>-->
|
|
222
|
+
<script>
|
|
223
|
+
let enterPromise = new Promise(res => window.enterPromise = res);
|
|
224
|
+
let renderPromise = new Promise(res => window.renderPromise = res);
|
|
225
|
+
/**
|
|
226
|
+
* 将播放bgm的事件发送出去
|
|
227
|
+
*/
|
|
228
|
+
Promise.all([enterPromise, renderPromise]).then(() => {
|
|
229
|
+
const event = new MouseEvent("click", {
|
|
230
|
+
"view": window,
|
|
231
|
+
"bubbles": true,
|
|
232
|
+
"cancelable": true
|
|
233
|
+
});
|
|
234
|
+
const target = document.getElementById("enter_game_target");
|
|
235
|
+
if (target) {
|
|
236
|
+
target.dispatchEvent(event);
|
|
237
|
+
}
|
|
238
|
+
if (event) {
|
|
239
|
+
const logo = document.getElementById("logo_target");
|
|
240
|
+
if (logo) {
|
|
241
|
+
logo.style.display = "contents";
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
function jump(event, url) {
|
|
247
|
+
// 获取点击事件,阻止点击事件冒泡触发 `enter` 事件
|
|
248
|
+
event.stopPropagation();
|
|
249
|
+
// window.location = url;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* 点击屏幕,进入引擎主界面
|
|
254
|
+
*/
|
|
255
|
+
function enter() {
|
|
256
|
+
const bgContainer = document.getElementById("Title_bg_container");
|
|
257
|
+
if (bgContainer) {
|
|
258
|
+
bgContainer.style.opacity = "0"; // 调整标题背景的透明度
|
|
259
|
+
}
|
|
260
|
+
const enterText = document.getElementById("Title_enter_text");
|
|
261
|
+
if (enterText) {
|
|
262
|
+
enterText.style.opacity = "0"; // 调整标题文字的透明度
|
|
263
|
+
}
|
|
264
|
+
const whiteContainer = document.getElementById("Title_white_container");
|
|
265
|
+
setTimeout(() => {
|
|
266
|
+
if (whiteContainer) {
|
|
267
|
+
whiteContainer.style.opacity = "1";
|
|
268
|
+
}
|
|
269
|
+
}, 50); // 在50ms后开始显示白色渐变
|
|
270
|
+
const title = document.getElementById("Title_enter_page");
|
|
271
|
+
setTimeout(() => {
|
|
272
|
+
if (title)
|
|
273
|
+
title.style.opacity = "0";
|
|
274
|
+
}, 500); //500ms后开始降低落地页透明度
|
|
275
|
+
if (!isIOS && title) {
|
|
276
|
+
title.style.pointerEvents = "none"; //落地页不再响应点击
|
|
277
|
+
title.style.background = "linear-gradient( #a1c4fd 0%, #c2e9fb 100%)"; //改变标题渐变效果
|
|
278
|
+
}
|
|
279
|
+
setTimeout(() => {
|
|
280
|
+
if (title) {
|
|
281
|
+
title.style.display = "none";
|
|
282
|
+
}
|
|
283
|
+
}, 2000); // 将落地页设置为不显示
|
|
284
|
+
window.enterPromise();
|
|
285
|
+
delete window.enterPromise;
|
|
286
|
+
}
|
|
287
|
+
</script>
|
|
288
|
+
</body>
|
|
289
|
+
|
|
290
|
+
</html>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
self.addEventListener('install', (ev) => {
|
|
2
|
+
// console.log('[service worker] installing');
|
|
3
|
+
ev.waitUntil(self.skipWaiting());
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
// fetch事件是每次页面请求资源时触发的
|
|
7
|
+
self.addEventListener('fetch', function (event) {
|
|
8
|
+
const url = event.request.url;
|
|
9
|
+
const isReturnCache = !!(url.match('/assets/') && !url.match('game'));
|
|
10
|
+
if (isReturnCache) {
|
|
11
|
+
// console.log('%cCACHED: ' + url, 'color: #005CAF; padding: 2px;');
|
|
12
|
+
}
|
|
13
|
+
if (!isReturnCache) {
|
|
14
|
+
event.respondWith(fetch(event.request));
|
|
15
|
+
} else {
|
|
16
|
+
event.respondWith(
|
|
17
|
+
// 检查在缓存中是否有匹配的资源
|
|
18
|
+
caches.match(event.request).then(function (response) {
|
|
19
|
+
// 如果缓存中有匹配的资源,则返回缓存资源
|
|
20
|
+
if (response) {
|
|
21
|
+
return response;
|
|
22
|
+
}
|
|
23
|
+
// 如果没有匹配的资源,则尝试从网络请求
|
|
24
|
+
// 同时将获取的资源存入缓存
|
|
25
|
+
return fetch(event.request)
|
|
26
|
+
.then(function (networkResponse) {
|
|
27
|
+
console.log('%cCACHED: ' + url, 'color: #005CAF; padding: 2px;');
|
|
28
|
+
if (networkResponse.status === 206 && event.request.headers.has('range')) {
|
|
29
|
+
// 如果是部分响应且请求带有Range头,则创建新的请求,将完整响应返回给客户端
|
|
30
|
+
// eslint-disable-next-line max-nested-callbacks
|
|
31
|
+
return fetch(event.request.url).then(function (fullNetworkResponse) {
|
|
32
|
+
const headers = {};
|
|
33
|
+
for (let entry of fullNetworkResponse.headers.entries()) {
|
|
34
|
+
headers[entry[0]] = entry[1];
|
|
35
|
+
}
|
|
36
|
+
const fullResponse = new Response(fullNetworkResponse.body, {
|
|
37
|
+
status: fullNetworkResponse.status,
|
|
38
|
+
statusText: fullNetworkResponse.statusText,
|
|
39
|
+
headers: headers,
|
|
40
|
+
});
|
|
41
|
+
const clonedResponse = fullResponse.clone();
|
|
42
|
+
// eslint-disable-next-line max-nested-callbacks
|
|
43
|
+
caches.open('my-cache').then(function (cache) {
|
|
44
|
+
cache.put(event.request, clonedResponse);
|
|
45
|
+
});
|
|
46
|
+
return fullResponse;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
const clonedResponse = networkResponse.clone();
|
|
50
|
+
// eslint-disable-next-line max-nested-callbacks
|
|
51
|
+
caches.open('my-cache').then(function (cache) {
|
|
52
|
+
cache.put(event.request, clonedResponse);
|
|
53
|
+
});
|
|
54
|
+
return networkResponse;
|
|
55
|
+
})
|
|
56
|
+
.catch(function (error) {
|
|
57
|
+
console.error('Fetching failed:', error);
|
|
58
|
+
throw error;
|
|
59
|
+
});
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "webgal-engine",
|
|
3
|
+
"version": "4.5.10",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"dev": "vite --host --port 3000",
|
|
6
|
+
"build": "cross-env NODE_ENV=production tsc && vite build --base=./",
|
|
7
|
+
"preview": "vite preview",
|
|
8
|
+
"lint": "eslint src/** --fix"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@emotion/css": "^11.11.2",
|
|
12
|
+
"@icon-park/react": "^1.4.2",
|
|
13
|
+
"@reduxjs/toolkit": "^1.8.1",
|
|
14
|
+
"angular-expressions": "^1.4.3",
|
|
15
|
+
"axios": "^0.28.0",
|
|
16
|
+
"cloudlogjs": "^1.0.9",
|
|
17
|
+
"i18next": "^22.4.15",
|
|
18
|
+
"localforage": "^1.10.0",
|
|
19
|
+
"lodash": "^4.17.21",
|
|
20
|
+
"mitt": "^3.0.0",
|
|
21
|
+
"modern-css-reset": "^1.4.0",
|
|
22
|
+
"pixi-filters": "^4.2.0",
|
|
23
|
+
"pixi-live2d-display-webgal": "^0.5.8",
|
|
24
|
+
"pixi.js": "^6.3.0",
|
|
25
|
+
"popmotion": "^11.0.5",
|
|
26
|
+
"react": "^17.0.2",
|
|
27
|
+
"react-dom": "^17.0.2",
|
|
28
|
+
"react-i18next": "^12.2.2",
|
|
29
|
+
"react-redux": "^8.0.1",
|
|
30
|
+
"sass": "^1.49.9",
|
|
31
|
+
"uuid": "^9.0.0",
|
|
32
|
+
"vite-plugin-package-version": "^1.0.2"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/lodash": "^4.14.180",
|
|
36
|
+
"@types/node": "^17.0.23",
|
|
37
|
+
"@types/react": "^17.0.33",
|
|
38
|
+
"@types/react-dom": "^17.0.10",
|
|
39
|
+
"@types/uuid": "^8.3.4",
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^5.18.0",
|
|
41
|
+
"@typescript-eslint/parser": "^5.18.0",
|
|
42
|
+
"@vitejs/plugin-react": "^4.0.4",
|
|
43
|
+
"cross-env": "^7.0.3",
|
|
44
|
+
"eslint": "^8.13.0",
|
|
45
|
+
"eslint-config-alloy": "^4.5.1",
|
|
46
|
+
"eslint-config-prettier": "^8.5.0",
|
|
47
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
48
|
+
"eslint-plugin-react": "^7.29.4",
|
|
49
|
+
"lint-staged": "^12.3.7",
|
|
50
|
+
"prettier": "^2.6.2",
|
|
51
|
+
"rollup-plugin-visualizer": "^5.6.0",
|
|
52
|
+
"typescript": "^4.5.4",
|
|
53
|
+
"vite": "^4.5.5"
|
|
54
|
+
}
|
|
55
|
+
}
|