sa2kit 1.2.0 → 1.3.0
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/dist/{UniversalFileService-CEZRJ87g.d.mts → UniversalFileService-BuHN-jrR.d.ts} +47 -259
- package/dist/{UniversalFileService-CEZRJ87g.d.ts → UniversalFileService-CGGzYeeF.d.mts} +47 -259
- package/dist/{chunk-3XG5OHFD.mjs → chunk-CIVO4R6N.mjs} +2 -2
- package/dist/{chunk-3XG5OHFD.mjs.map → chunk-CIVO4R6N.mjs.map} +1 -1
- package/dist/chunk-EV6BCVOQ.mjs +204 -0
- package/dist/chunk-EV6BCVOQ.mjs.map +1 -0
- package/dist/chunk-W35VTQAW.js +211 -0
- package/dist/chunk-W35VTQAW.js.map +1 -0
- package/dist/{chunk-HWJ34NL6.js → chunk-ZRAW3HXA.js} +2 -2
- package/dist/{chunk-HWJ34NL6.js.map → chunk-ZRAW3HXA.js.map} +1 -1
- package/dist/drizzle-schema-BNhqj2AZ.d.mts +1114 -0
- package/dist/drizzle-schema-BNhqj2AZ.d.ts +1114 -0
- package/dist/mmd/admin/index.d.mts +487 -0
- package/dist/mmd/admin/index.d.ts +487 -0
- package/dist/mmd/admin/index.js +871 -0
- package/dist/mmd/admin/index.js.map +1 -0
- package/dist/mmd/admin/index.mjs +822 -0
- package/dist/mmd/admin/index.mjs.map +1 -0
- package/dist/mmd/index.d.mts +4 -193
- package/dist/mmd/index.d.ts +4 -193
- package/dist/mmd/server/index.d.mts +138 -0
- package/dist/mmd/server/index.d.ts +138 -0
- package/dist/mmd/server/index.js +245 -0
- package/dist/mmd/server/index.js.map +1 -0
- package/dist/mmd/server/index.mjs +207 -0
- package/dist/mmd/server/index.mjs.map +1 -0
- package/dist/testYourself/index.d.mts +145 -0
- package/dist/testYourself/index.d.ts +145 -0
- package/dist/testYourself/index.js +1004 -0
- package/dist/testYourself/index.js.map +1 -0
- package/dist/testYourself/index.mjs +993 -0
- package/dist/testYourself/index.mjs.map +1 -0
- package/dist/types-Bc_p-zAR.d.mts +194 -0
- package/dist/types-Bc_p-zAR.d.ts +194 -0
- package/dist/types-CK4We_aI.d.mts +270 -0
- package/dist/types-CK4We_aI.d.ts +270 -0
- package/dist/universalFile/index.d.mts +3 -2
- package/dist/universalFile/index.d.ts +3 -2
- package/dist/universalFile/index.js +48 -10
- package/dist/universalFile/index.js.map +1 -1
- package/dist/universalFile/index.mjs +43 -5
- package/dist/universalFile/index.mjs.map +1 -1
- package/dist/universalFile/server/index.d.mts +3 -2
- package/dist/universalFile/server/index.d.ts +3 -2
- package/dist/universalFile/server/index.js +239 -7
- package/dist/universalFile/server/index.js.map +1 -1
- package/dist/universalFile/server/index.mjs +234 -2
- package/dist/universalFile/server/index.mjs.map +1 -1
- package/package.json +19 -1
|
@@ -0,0 +1,1004 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('../chunk-DGUM43GV.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
9
|
+
|
|
10
|
+
// src/testYourself/utils/fingerprint.ts
|
|
11
|
+
function getCanvasFingerprint() {
|
|
12
|
+
try {
|
|
13
|
+
const canvas = document.createElement("canvas");
|
|
14
|
+
const ctx = canvas.getContext("2d");
|
|
15
|
+
if (!ctx) return "no-canvas";
|
|
16
|
+
canvas.width = 200;
|
|
17
|
+
canvas.height = 50;
|
|
18
|
+
ctx.textBaseline = "top";
|
|
19
|
+
ctx.font = "14px Arial";
|
|
20
|
+
ctx.fillStyle = "#f60";
|
|
21
|
+
ctx.fillRect(0, 0, 200, 50);
|
|
22
|
+
ctx.fillStyle = "#069";
|
|
23
|
+
ctx.fillText("Canvas Fingerprint \u{1F3A8}", 2, 15);
|
|
24
|
+
return canvas.toDataURL();
|
|
25
|
+
} catch (error) {
|
|
26
|
+
return "canvas-error";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function getWebGLFingerprint() {
|
|
30
|
+
try {
|
|
31
|
+
const canvas = document.createElement("canvas");
|
|
32
|
+
const gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
|
|
33
|
+
if (!gl) return "no-webgl";
|
|
34
|
+
const glContext = gl;
|
|
35
|
+
const debugInfo = glContext.getExtension("WEBGL_debug_renderer_info");
|
|
36
|
+
if (debugInfo) {
|
|
37
|
+
const vendor = glContext.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL);
|
|
38
|
+
const renderer = glContext.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
|
|
39
|
+
return `${vendor}~${renderer}`;
|
|
40
|
+
}
|
|
41
|
+
return "webgl-no-debug";
|
|
42
|
+
} catch (error) {
|
|
43
|
+
return "webgl-error";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function getAvailableFonts() {
|
|
47
|
+
const testFonts = [
|
|
48
|
+
"Arial",
|
|
49
|
+
"Verdana",
|
|
50
|
+
"Courier New",
|
|
51
|
+
"Georgia",
|
|
52
|
+
"Times New Roman",
|
|
53
|
+
"Comic Sans MS",
|
|
54
|
+
"Trebuchet MS",
|
|
55
|
+
"Arial Black",
|
|
56
|
+
"Impact",
|
|
57
|
+
"Courier",
|
|
58
|
+
"Helvetica",
|
|
59
|
+
"Monaco",
|
|
60
|
+
"Consolas",
|
|
61
|
+
"Menlo"
|
|
62
|
+
];
|
|
63
|
+
const availableFonts = [];
|
|
64
|
+
const canvas = document.createElement("canvas");
|
|
65
|
+
const ctx = canvas.getContext("2d");
|
|
66
|
+
if (!ctx) return "no-fonts";
|
|
67
|
+
const baseFonts = ["monospace", "sans-serif", "serif"];
|
|
68
|
+
const testString = "mmmmmmmmmmlli";
|
|
69
|
+
const baseWidths = {};
|
|
70
|
+
baseFonts.forEach((font) => {
|
|
71
|
+
ctx.font = `72px ${font}`;
|
|
72
|
+
baseWidths[font] = ctx.measureText(testString).width;
|
|
73
|
+
});
|
|
74
|
+
testFonts.forEach((font) => {
|
|
75
|
+
let detected = false;
|
|
76
|
+
baseFonts.forEach((baseFont) => {
|
|
77
|
+
ctx.font = `72px ${font}, ${baseFont}`;
|
|
78
|
+
const width = ctx.measureText(testString).width;
|
|
79
|
+
if (width !== baseWidths[baseFont]) {
|
|
80
|
+
detected = true;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
if (detected) {
|
|
84
|
+
availableFonts.push(font);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
return availableFonts.join(",") || "no-custom-fonts";
|
|
88
|
+
}
|
|
89
|
+
function getDeviceFingerprint() {
|
|
90
|
+
const fingerprint = {
|
|
91
|
+
// 基础信息
|
|
92
|
+
userAgent: navigator.userAgent,
|
|
93
|
+
screenResolution: `${window.screen.width}x${window.screen.height}`,
|
|
94
|
+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
95
|
+
language: navigator.language,
|
|
96
|
+
platform: navigator.platform,
|
|
97
|
+
// 显示信息
|
|
98
|
+
colorDepth: window.screen.colorDepth,
|
|
99
|
+
devicePixelRatio: window.devicePixelRatio,
|
|
100
|
+
// 硬件信息
|
|
101
|
+
hardwareConcurrency: navigator.hardwareConcurrency || 0,
|
|
102
|
+
maxTouchPoints: navigator.maxTouchPoints || 0,
|
|
103
|
+
// Canvas和WebGL指纹
|
|
104
|
+
canvasFingerprint: getCanvasFingerprint(),
|
|
105
|
+
webglFingerprint: getWebGLFingerprint(),
|
|
106
|
+
// 字体检测
|
|
107
|
+
fonts: getAvailableFonts(),
|
|
108
|
+
// 浏览器能力
|
|
109
|
+
cookieEnabled: navigator.cookieEnabled,
|
|
110
|
+
localStorageEnabled: (() => {
|
|
111
|
+
try {
|
|
112
|
+
return typeof localStorage !== "undefined";
|
|
113
|
+
} catch {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
})(),
|
|
117
|
+
sessionStorageEnabled: (() => {
|
|
118
|
+
try {
|
|
119
|
+
return typeof sessionStorage !== "undefined";
|
|
120
|
+
} catch {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
})(),
|
|
124
|
+
indexedDBEnabled: (() => {
|
|
125
|
+
try {
|
|
126
|
+
return typeof indexedDB !== "undefined";
|
|
127
|
+
} catch {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
})()
|
|
131
|
+
};
|
|
132
|
+
return fingerprint;
|
|
133
|
+
}
|
|
134
|
+
async function tryGetIPAddress() {
|
|
135
|
+
try {
|
|
136
|
+
const response = await fetch("https://api.ipify.org?format=json", {
|
|
137
|
+
method: "GET",
|
|
138
|
+
mode: "cors"
|
|
139
|
+
});
|
|
140
|
+
if (response.ok) {
|
|
141
|
+
const data = await response.json();
|
|
142
|
+
return data.ip || null;
|
|
143
|
+
}
|
|
144
|
+
} catch (error) {
|
|
145
|
+
console.warn("\u65E0\u6CD5\u83B7\u53D6IP\u5730\u5740:", error);
|
|
146
|
+
}
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
function simpleHash(str) {
|
|
150
|
+
let hash = 5381;
|
|
151
|
+
for (let i = 0; i < str.length; i++) {
|
|
152
|
+
hash = (hash << 5) + hash + str.charCodeAt(i);
|
|
153
|
+
}
|
|
154
|
+
return Math.abs(hash);
|
|
155
|
+
}
|
|
156
|
+
function generateDeviceHash(fingerprint, salt = "test-yourself-salt-2024") {
|
|
157
|
+
const components = [
|
|
158
|
+
// 基础信息
|
|
159
|
+
fingerprint.userAgent,
|
|
160
|
+
fingerprint.ip || "no-ip",
|
|
161
|
+
fingerprint.screenResolution,
|
|
162
|
+
fingerprint.timezone,
|
|
163
|
+
fingerprint.language,
|
|
164
|
+
fingerprint.platform,
|
|
165
|
+
// 显示信息
|
|
166
|
+
fingerprint.colorDepth?.toString() || "0",
|
|
167
|
+
fingerprint.devicePixelRatio?.toString() || "0",
|
|
168
|
+
// 硬件信息
|
|
169
|
+
fingerprint.hardwareConcurrency?.toString() || "0",
|
|
170
|
+
fingerprint.maxTouchPoints?.toString() || "0",
|
|
171
|
+
// Canvas和WebGL指纹(这些是最独特的)
|
|
172
|
+
fingerprint.canvasFingerprint || "no-canvas",
|
|
173
|
+
fingerprint.webglFingerprint || "no-webgl",
|
|
174
|
+
// 字体(不同设备安装的字体不同)
|
|
175
|
+
fingerprint.fonts || "no-fonts",
|
|
176
|
+
// 浏览器能力
|
|
177
|
+
fingerprint.cookieEnabled ? "1" : "0",
|
|
178
|
+
fingerprint.localStorageEnabled ? "1" : "0",
|
|
179
|
+
fingerprint.sessionStorageEnabled ? "1" : "0",
|
|
180
|
+
fingerprint.indexedDBEnabled ? "1" : "0",
|
|
181
|
+
// 盐值
|
|
182
|
+
salt
|
|
183
|
+
];
|
|
184
|
+
const combined = components.join("|");
|
|
185
|
+
const hash = simpleHash(combined);
|
|
186
|
+
return hash.toString(36);
|
|
187
|
+
}
|
|
188
|
+
function selectResultIndex(hash, totalResults) {
|
|
189
|
+
const numHash = parseInt(hash, 36);
|
|
190
|
+
return numHash % totalResults;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// src/testYourself/data/defaultResults.ts
|
|
194
|
+
var DEFAULT_RESULTS = [
|
|
195
|
+
// 动物系列 (1-15)
|
|
196
|
+
{
|
|
197
|
+
id: "animal-cat",
|
|
198
|
+
title: "\u6175\u61D2\u7684\u732B\u54AA \u{1F431}",
|
|
199
|
+
description: "\u4F60\u5C31\u50CF\u4E00\u53EA\u4F18\u96C5\u7684\u732B\uFF0C\u72EC\u7ACB\u81EA\u4E3B\uFF0C\u559C\u6B22\u6309\u7167\u81EA\u5DF1\u7684\u8282\u594F\u751F\u6D3B\u3002\u6709\u65F6\u9AD8\u51B7\uFF0C\u6709\u65F6\u7C98\u4EBA\uFF0C\u5145\u6EE1\u795E\u79D8\u9B45\u529B\u3002",
|
|
200
|
+
image: "\u{1F431}",
|
|
201
|
+
imageType: "emoji"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: "animal-dog",
|
|
205
|
+
title: "\u5FE0\u8BDA\u7684\u72D7\u72D7 \u{1F415}",
|
|
206
|
+
description: "\u4F60\u50CF\u4E00\u53EA\u70ED\u60C5\u7684\u72D7\u72D7\uFF0C\u5BF9\u670B\u53CB\u5FE0\u8BDA\uFF0C\u5145\u6EE1\u6D3B\u529B\u3002\u603B\u662F\u80FD\u7ED9\u5468\u56F4\u7684\u4EBA\u5E26\u6765\u6B22\u4E50\u548C\u6E29\u6696\u3002",
|
|
207
|
+
image: "\u{1F415}",
|
|
208
|
+
imageType: "emoji"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
id: "animal-panda",
|
|
212
|
+
title: "\u53EF\u7231\u7684\u718A\u732B \u{1F43C}",
|
|
213
|
+
description: "\u4F60\u5C31\u50CF\u56FD\u5B9D\u718A\u732B\u4E00\u6837\uFF0C\u5446\u840C\u53EF\u7231\uFF0C\u4EBA\u89C1\u4EBA\u7231\u3002\u6162\u8282\u594F\u7684\u751F\u6D3B\u65B9\u5F0F\u8BA9\u4F60\u5145\u6EE1\u6CBB\u6108\u529B\u3002",
|
|
214
|
+
image: "\u{1F43C}",
|
|
215
|
+
imageType: "emoji"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
id: "animal-fox",
|
|
219
|
+
title: "\u673A\u667A\u7684\u72D0\u72F8 \u{1F98A}",
|
|
220
|
+
description: "\u806A\u660E\u4F36\u4FD0\uFF0C\u53CD\u5E94\u654F\u6377\u3002\u4F60\u603B\u80FD\u7528\u667A\u6167\u89E3\u51B3\u95EE\u9898\uFF0C\u662F\u56E2\u961F\u4E2D\u7684\u667A\u56CA\u62C5\u5F53\u3002",
|
|
221
|
+
image: "\u{1F98A}",
|
|
222
|
+
imageType: "emoji"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
id: "animal-owl",
|
|
226
|
+
title: "\u777F\u667A\u7684\u732B\u5934\u9E70 \u{1F989}",
|
|
227
|
+
description: "\u4F60\u50CF\u732B\u5934\u9E70\u4E00\u6837\u5145\u6EE1\u667A\u6167\uFF0C\u559C\u6B22\u5728\u591C\u6DF1\u4EBA\u9759\u65F6\u601D\u8003\u3002\u7406\u6027\u3001\u6C89\u7A33\u662F\u4F60\u7684\u6807\u7B7E\u3002",
|
|
228
|
+
image: "\u{1F989}",
|
|
229
|
+
imageType: "emoji"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
id: "animal-dolphin",
|
|
233
|
+
title: "\u5FEB\u4E50\u7684\u6D77\u8C5A \u{1F42C}",
|
|
234
|
+
description: "\u6D3B\u6CFC\u5F00\u6717\uFF0C\u793E\u4EA4\u8FBE\u4EBA\u3002\u4F60\u7684\u7B11\u5BB9\u80FD\u591F\u611F\u67D3\u8EAB\u8FB9\u7684\u6BCF\u4E00\u4E2A\u4EBA\u3002",
|
|
235
|
+
image: "\u{1F42C}",
|
|
236
|
+
imageType: "emoji"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
id: "animal-butterfly",
|
|
240
|
+
title: "\u81EA\u7531\u7684\u8774\u8776 \u{1F98B}",
|
|
241
|
+
description: "\u8FFD\u6C42\u81EA\u7531\uFF0C\u70ED\u7231\u7F8E\u597D\u4E8B\u7269\u3002\u4F60\u7684\u4EBA\u751F\u5145\u6EE1\u8272\u5F69\uFF0C\u4ECE\u4E0D\u88AB\u675F\u7F1A\u3002",
|
|
242
|
+
image: "\u{1F98B}",
|
|
243
|
+
imageType: "emoji"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
id: "animal-lion",
|
|
247
|
+
title: "\u52C7\u6562\u7684\u72EE\u5B50 \u{1F981}",
|
|
248
|
+
description: "\u5929\u751F\u7684\u9886\u5BFC\u8005\uFF0C\u52C7\u6562\u679C\u65AD\u3002\u4F60\u7684\u6C14\u573A\u5F3A\u5927\uFF0C\u603B\u80FD\u6FC0\u52B1\u4ED6\u4EBA\u3002",
|
|
249
|
+
image: "\u{1F981}",
|
|
250
|
+
imageType: "emoji"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
id: "animal-rabbit",
|
|
254
|
+
title: "\u6E29\u67D4\u7684\u5154\u5B50 \u{1F430}",
|
|
255
|
+
description: "\u5FC3\u5730\u5584\u826F\uFF0C\u6E29\u67D4\u4F53\u8D34\u3002\u4F60\u7684\u5B58\u5728\u5C31\u50CF\u6625\u5929\u7684\u5FAE\u98CE\uFF0C\u8BA9\u4EBA\u611F\u5230\u6E29\u6696\u3002",
|
|
256
|
+
image: "\u{1F430}",
|
|
257
|
+
imageType: "emoji"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
id: "animal-penguin",
|
|
261
|
+
title: "\u5446\u840C\u7684\u4F01\u9E45 \u{1F427}",
|
|
262
|
+
description: "\u61A8\u6001\u53EF\u63AC\uFF0C\u8BA4\u771F\u6267\u7740\u3002\u867D\u7136\u770B\u8D77\u6765\u7B28\u62D9\uFF0C\u4F46\u505A\u4E8B\u4E00\u4E1D\u4E0D\u82DF\u3002",
|
|
263
|
+
image: "\u{1F427}",
|
|
264
|
+
imageType: "emoji"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
id: "animal-eagle",
|
|
268
|
+
title: "\u7FF1\u7FD4\u7684\u96C4\u9E70 \u{1F985}",
|
|
269
|
+
description: "\u76EE\u5149\u8FDC\u5927\uFF0C\u5FD7\u5411\u9AD8\u8FDC\u3002\u4F60\u603B\u662F\u80FD\u770B\u5230\u522B\u4EBA\u770B\u4E0D\u5230\u7684\u673A\u4F1A\u3002",
|
|
270
|
+
image: "\u{1F985}",
|
|
271
|
+
imageType: "emoji"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
id: "animal-koala",
|
|
275
|
+
title: "\u6175\u61D2\u7684\u8003\u62C9 \u{1F428}",
|
|
276
|
+
description: "\u4F5B\u7CFB\u751F\u6D3B\uFF0C\u77E5\u8DB3\u5E38\u4E50\u3002\u4F60\u61C2\u5F97\u4EAB\u53D7\u5F53\u4E0B\uFF0C\u6D3B\u5728\u81EA\u5DF1\u7684\u8282\u594F\u91CC\u3002",
|
|
277
|
+
image: "\u{1F428}",
|
|
278
|
+
imageType: "emoji"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
id: "animal-sloth",
|
|
282
|
+
title: "\u60A0\u95F2\u7684\u6811\u61D2 \u{1F9A5}",
|
|
283
|
+
description: "\u6162\u6162\u6765\uFF0C\u6BD4\u8F83\u5FEB\u3002\u4F60\u76F8\u4FE1\u6025\u4E0D\u6765\u7684\u4E8B\u5C31\u4E0D\u8981\u6025\uFF0C\u4FDD\u6301\u81EA\u5DF1\u7684pace\u3002",
|
|
284
|
+
image: "\u{1F9A5}",
|
|
285
|
+
imageType: "emoji"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
id: "animal-unicorn",
|
|
289
|
+
title: "\u68A6\u5E7B\u7684\u72EC\u89D2\u517D \u{1F984}",
|
|
290
|
+
description: "\u5145\u6EE1\u5E7B\u60F3\uFF0C\u8FFD\u6C42\u5B8C\u7F8E\u3002\u4F60\u7684\u4E16\u754C\u4E94\u5F69\u6591\u6593\uFF0C\u603B\u6709\u72EC\u7279\u7684\u60F3\u6CD5\u3002",
|
|
291
|
+
image: "\u{1F984}",
|
|
292
|
+
imageType: "emoji"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
id: "animal-dragon",
|
|
296
|
+
title: "\u795E\u79D8\u7684\u9F99 \u{1F409}",
|
|
297
|
+
description: "\u5F3A\u5927\u800C\u795E\u79D8\uFF0C\u5145\u6EE1\u9B45\u529B\u3002\u4F60\u662F\u4F20\u8BF4\u4E2D\u7684\u5B58\u5728\uFF0C\u4EE4\u4EBA\u5411\u5F80\u3002",
|
|
298
|
+
image: "\u{1F409}",
|
|
299
|
+
imageType: "emoji"
|
|
300
|
+
},
|
|
301
|
+
// 星球系列 (16-25)
|
|
302
|
+
{
|
|
303
|
+
id: "planet-sun",
|
|
304
|
+
title: "\u6E29\u6696\u7684\u592A\u9633 \u2600\uFE0F",
|
|
305
|
+
description: "\u4F60\u5C31\u50CF\u592A\u9633\u4E00\u6837\uFF0C\u662F\u56E2\u961F\u7684\u80FD\u91CF\u6765\u6E90\uFF0C\u6E29\u6696\u7740\u5468\u56F4\u7684\u6BCF\u4E2A\u4EBA\u3002",
|
|
306
|
+
image: "\u2600\uFE0F",
|
|
307
|
+
imageType: "emoji"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
id: "planet-moon",
|
|
311
|
+
title: "\u6E29\u67D4\u7684\u6708\u4EAE \u{1F319}",
|
|
312
|
+
description: "\u5B89\u9759\u800C\u6E29\u67D4\uFF0C\u5728\u9ED1\u6697\u4E2D\u7ED9\u4EBA\u5149\u660E\u3002\u4F60\u662F\u591C\u665A\u6700\u7F8E\u7684\u966A\u4F34\u3002",
|
|
313
|
+
image: "\u{1F319}",
|
|
314
|
+
imageType: "emoji"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: "planet-star",
|
|
318
|
+
title: "\u95EA\u8000\u7684\u661F\u661F \u2B50",
|
|
319
|
+
description: "\u867D\u7136\u6E3A\u5C0F\uFF0C\u4F46\u59CB\u7EC8\u95EA\u8000\u3002\u4F60\u7528\u81EA\u5DF1\u7684\u65B9\u5F0F\u53D1\u5149\u53D1\u70ED\u3002",
|
|
320
|
+
image: "\u2B50",
|
|
321
|
+
imageType: "emoji"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
id: "planet-earth",
|
|
325
|
+
title: "\u5305\u5BB9\u7684\u5730\u7403 \u{1F30D}",
|
|
326
|
+
description: "\u5305\u5BB9\u4E07\u7269\uFF0C\u751F\u673A\u52C3\u52C3\u3002\u4F60\u6709\u7740\u5BBD\u5E7F\u7684\u80F8\u6000\u548C\u65E0\u9650\u7684\u53EF\u80FD\u3002",
|
|
327
|
+
image: "\u{1F30D}",
|
|
328
|
+
imageType: "emoji"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
id: "planet-saturn",
|
|
332
|
+
title: "\u72EC\u7279\u7684\u571F\u661F \u{1FA90}",
|
|
333
|
+
description: "\u4E0E\u4F17\u4E0D\u540C\uFF0C\u81EA\u6210\u4E00\u683C\u3002\u4F60\u7684\u4E2A\u6027\u5C31\u50CF\u571F\u661F\u73AF\u4E00\u6837\u4EE4\u4EBA\u7740\u8FF7\u3002",
|
|
334
|
+
image: "\u{1FA90}",
|
|
335
|
+
imageType: "emoji"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
id: "weather-rainbow",
|
|
339
|
+
title: "\u7EDA\u4E3D\u7684\u5F69\u8679 \u{1F308}",
|
|
340
|
+
description: "\u98CE\u96E8\u8FC7\u540E\u89C1\u5F69\u8679\uFF0C\u4F60\u603B\u80FD\u5728\u56F0\u96BE\u540E\u770B\u5230\u5E0C\u671B\u548C\u7F8E\u597D\u3002",
|
|
341
|
+
image: "\u{1F308}",
|
|
342
|
+
imageType: "emoji"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
id: "weather-cloud",
|
|
346
|
+
title: "\u98D8\u9038\u7684\u4E91\u6735 \u2601\uFE0F",
|
|
347
|
+
description: "\u81EA\u7531\u81EA\u5728\uFF0C\u968F\u98CE\u98D8\u8361\u3002\u4F60\u4E0D\u88AB\u5B9A\u4E49\uFF0C\u6C38\u8FDC\u5145\u6EE1\u53EF\u80FD\u3002",
|
|
348
|
+
image: "\u2601\uFE0F",
|
|
349
|
+
imageType: "emoji"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
id: "weather-lightning",
|
|
353
|
+
title: "\u95EA\u7535 \u26A1",
|
|
354
|
+
description: "\u7206\u53D1\u529B\u5F3A\uFF0C\u884C\u52A8\u8FC5\u901F\u3002\u4F60\u7684\u80FD\u91CF\u5C31\u50CF\u95EA\u7535\u4E00\u6837\u4EE4\u4EBA\u9707\u64BC\u3002",
|
|
355
|
+
image: "\u26A1",
|
|
356
|
+
imageType: "emoji"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
id: "weather-snowflake",
|
|
360
|
+
title: "\u72EC\u7279\u7684\u96EA\u82B1 \u2744\uFE0F",
|
|
361
|
+
description: "\u4E16\u754C\u4E0A\u6CA1\u6709\u4E24\u7247\u76F8\u540C\u7684\u96EA\u82B1\uFF0C\u4F60\u4E5F\u662F\u72EC\u4E00\u65E0\u4E8C\u7684\u5B58\u5728\u3002",
|
|
362
|
+
image: "\u2744\uFE0F",
|
|
363
|
+
imageType: "emoji"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
id: "weather-fire",
|
|
367
|
+
title: "\u70ED\u60C5\u7684\u706B\u7130 \u{1F525}",
|
|
368
|
+
description: "\u70ED\u60C5\u4F3C\u706B\uFF0C\u5145\u6EE1\u6FC0\u60C5\u3002\u4F60\u7684\u5B58\u5728\u80FD\u70B9\u71C3\u5468\u56F4\u7684\u6C14\u6C1B\u3002",
|
|
369
|
+
image: "\u{1F525}",
|
|
370
|
+
imageType: "emoji"
|
|
371
|
+
},
|
|
372
|
+
// 植物系列 (26-35)
|
|
373
|
+
{
|
|
374
|
+
id: "plant-tree",
|
|
375
|
+
title: "\u575A\u97E7\u7684\u5927\u6811 \u{1F333}",
|
|
376
|
+
description: "\u7A33\u91CD\u53EF\u9760\uFF0C\u6839\u57FA\u6DF1\u539A\u3002\u4F60\u662F\u5927\u5BB6\u53EF\u4EE5\u4F9D\u9760\u7684\u5B58\u5728\u3002",
|
|
377
|
+
image: "\u{1F333}",
|
|
378
|
+
imageType: "emoji"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
id: "plant-flower",
|
|
382
|
+
title: "\u7F8E\u4E3D\u7684\u82B1\u6735 \u{1F338}",
|
|
383
|
+
description: "\u7EFD\u653E\u81EA\u6211\uFF0C\u7F8E\u4E3D\u52A8\u4EBA\u3002\u4F60\u7684\u5B58\u5728\u5C31\u662F\u4E00\u9053\u9753\u4E3D\u7684\u98CE\u666F\u3002",
|
|
384
|
+
image: "\u{1F338}",
|
|
385
|
+
imageType: "emoji"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
id: "plant-sunflower",
|
|
389
|
+
title: "\u5411\u9633\u7684\u5411\u65E5\u8475 \u{1F33B}",
|
|
390
|
+
description: "\u6C38\u8FDC\u5411\u7740\u9633\u5149\uFF0C\u79EF\u6781\u5411\u4E0A\u3002\u4F60\u7684\u4E50\u89C2\u611F\u67D3\u7740\u6BCF\u4E2A\u4EBA\u3002",
|
|
391
|
+
image: "\u{1F33B}",
|
|
392
|
+
imageType: "emoji"
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
id: "plant-rose",
|
|
396
|
+
title: "\u4F18\u96C5\u7684\u73AB\u7470 \u{1F339}",
|
|
397
|
+
description: "\u9AD8\u8D35\u4F18\u96C5\uFF0C\u5145\u6EE1\u9B45\u529B\u3002\u867D\u6709\u523A\u4F46\u66F4\u6709\u7F8E\u4E3D\u3002",
|
|
398
|
+
image: "\u{1F339}",
|
|
399
|
+
imageType: "emoji"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
id: "plant-cactus",
|
|
403
|
+
title: "\u575A\u5F3A\u7684\u4ED9\u4EBA\u638C \u{1F335}",
|
|
404
|
+
description: "\u5728\u8270\u96BE\u73AF\u5883\u4E2D\u4F9D\u7136\u575A\u5F3A\u3002\u4F60\u7684\u97E7\u6027\u4EE4\u4EBA\u656C\u4F69\u3002",
|
|
405
|
+
image: "\u{1F335}",
|
|
406
|
+
imageType: "emoji"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
id: "plant-clover",
|
|
410
|
+
title: "\u5E78\u8FD0\u7684\u56DB\u53F6\u8349 \u{1F340}",
|
|
411
|
+
description: "\u5E78\u8FD0\u7684\u8C61\u5F81\uFF0C\u603B\u80FD\u7ED9\u4EBA\u5E26\u6765\u597D\u8FD0\u548C\u5E0C\u671B\u3002",
|
|
412
|
+
image: "\u{1F340}",
|
|
413
|
+
imageType: "emoji"
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
id: "plant-maple",
|
|
417
|
+
title: "\u6D6A\u6F2B\u7684\u67AB\u53F6 \u{1F341}",
|
|
418
|
+
description: "\u6D6A\u6F2B\u800C\u8BD7\u610F\uFF0C\u4F60\u7684\u4E16\u754C\u5145\u6EE1\u827A\u672F\u6C14\u606F\u3002",
|
|
419
|
+
image: "\u{1F341}",
|
|
420
|
+
imageType: "emoji"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
id: "plant-mushroom",
|
|
424
|
+
title: "\u795E\u79D8\u7684\u8611\u83C7 \u{1F344}",
|
|
425
|
+
description: "\u4F4E\u8C03\u795E\u79D8\uFF0C\u603B\u6709\u610F\u60F3\u4E0D\u5230\u7684\u60CA\u559C\u3002",
|
|
426
|
+
image: "\u{1F344}",
|
|
427
|
+
imageType: "emoji"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
id: "plant-cherry",
|
|
431
|
+
title: "\u6D6A\u6F2B\u7684\u6A31\u82B1 \u{1F338}",
|
|
432
|
+
description: "\u77ED\u6682\u800C\u7F8E\u597D\uFF0C\u4F60\u73CD\u60DC\u6BCF\u4E00\u4E2A\u77AC\u95F4\u7684\u7F8E\u4E3D\u3002",
|
|
433
|
+
image: "\u{1F338}",
|
|
434
|
+
imageType: "emoji"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
id: "plant-bamboo",
|
|
438
|
+
title: "\u575A\u97E7\u7684\u7AF9\u5B50 \u{1F38B}",
|
|
439
|
+
description: "\u865A\u5FC3\u6709\u8282\uFF0C\u6108\u632B\u6108\u52C7\u3002\u4F60\u7684\u7CBE\u795E\u503C\u5F97\u5B66\u4E60\u3002",
|
|
440
|
+
image: "\u{1F38B}",
|
|
441
|
+
imageType: "emoji"
|
|
442
|
+
},
|
|
443
|
+
// 食物系列 (36-45)
|
|
444
|
+
{
|
|
445
|
+
id: "food-coffee",
|
|
446
|
+
title: "\u63D0\u795E\u7684\u5496\u5561 \u2615",
|
|
447
|
+
description: "\u4F60\u5C31\u50CF\u5496\u5561\uFF0C\u662F\u5927\u5BB6\u7684\u80FD\u91CF\u6765\u6E90\uFF0C\u5E2E\u52A9\u4ED6\u4EBA\u4FDD\u6301\u6D3B\u529B\u3002",
|
|
448
|
+
image: "\u2615",
|
|
449
|
+
imageType: "emoji"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
id: "food-pizza",
|
|
453
|
+
title: "\u5FEB\u4E50\u7684\u62AB\u8428 \u{1F355}",
|
|
454
|
+
description: "\u4EBA\u89C1\u4EBA\u7231\uFF0C\u603B\u80FD\u5E26\u6765\u5FEB\u4E50\u3002\u4F60\u662F\u805A\u4F1A\u7684\u7075\u9B42\u3002",
|
|
455
|
+
image: "\u{1F355}",
|
|
456
|
+
imageType: "emoji"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
id: "food-cookie",
|
|
460
|
+
title: "\u751C\u871C\u7684\u997C\u5E72 \u{1F36A}",
|
|
461
|
+
description: "\u6E29\u6696\u751C\u871C\uFF0C\u7ED9\u4EBAcomfort\u3002\u4F60\u662F\u6700\u597D\u7684\u6CBB\u6108\u7CFB\u5B58\u5728\u3002",
|
|
462
|
+
image: "\u{1F36A}",
|
|
463
|
+
imageType: "emoji"
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
id: "food-icecream",
|
|
467
|
+
title: "\u6E05\u51C9\u7684\u51B0\u6DC7\u6DCB \u{1F366}",
|
|
468
|
+
description: "\u751C\u7F8E\u53EF\u7231\uFF0C\u5728\u708E\u70ED\u65F6\u7ED9\u4EBA\u6E05\u51C9\u3002\u4F60\u603B\u80FD\u5728\u5173\u952E\u65F6\u523B\u51FA\u73B0\u3002",
|
|
469
|
+
image: "\u{1F366}",
|
|
470
|
+
imageType: "emoji"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
id: "food-honey",
|
|
474
|
+
title: "\u751C\u871C\u7684\u8702\u871C \u{1F36F}",
|
|
475
|
+
description: "\u5929\u7136\u751C\u7F8E\uFF0C\u7EAF\u7CB9\u53EF\u7231\u3002\u4F60\u7684\u5B58\u5728\u5C31\u662F\u5E78\u798F\u7684\u5473\u9053\u3002",
|
|
476
|
+
image: "\u{1F36F}",
|
|
477
|
+
imageType: "emoji"
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
id: "food-sushi",
|
|
481
|
+
title: "\u7CBE\u81F4\u7684\u5BFF\u53F8 \u{1F363}",
|
|
482
|
+
description: "\u7CBE\u81F4\u4F18\u96C5\uFF0C\u6CE8\u91CD\u7EC6\u8282\u3002\u4F60\u5BF9\u751F\u6D3B\u6709\u7740\u72EC\u7279\u7684\u54C1\u5473\u3002",
|
|
483
|
+
image: "\u{1F363}",
|
|
484
|
+
imageType: "emoji"
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
id: "food-cake",
|
|
488
|
+
title: "\u751C\u7F8E\u7684\u86CB\u7CD5 \u{1F382}",
|
|
489
|
+
description: "\u751C\u871C\u7F8E\u597D\uFF0C\u662F\u5E86\u795D\u7684\u8C61\u5F81\u3002\u4F60\u603B\u80FD\u7ED9\u4EBA\u5E26\u6765\u60CA\u559C\u3002",
|
|
490
|
+
image: "\u{1F382}",
|
|
491
|
+
imageType: "emoji"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
id: "food-donut",
|
|
495
|
+
title: "\u53EF\u7231\u7684\u751C\u751C\u5708 \u{1F369}",
|
|
496
|
+
description: "\u5706\u5706\u6EE1\u6EE1\uFF0C\u751C\u871C\u53EF\u7231\u3002\u4F60\u7684\u5B58\u5728\u8BA9\u751F\u6D3B\u66F4\u7F8E\u597D\u3002",
|
|
497
|
+
image: "\u{1F369}",
|
|
498
|
+
imageType: "emoji"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
id: "food-lollipop",
|
|
502
|
+
title: "\u7AE5\u771F\u7684\u68D2\u68D2\u7CD6 \u{1F36D}",
|
|
503
|
+
description: "\u4FDD\u6301\u7AE5\u5FC3\uFF0C\u6C38\u8FDC\u5E74\u8F7B\u3002\u4F60\u7684\u7EAF\u771F\u4EE4\u4EBA\u7FA1\u6155\u3002",
|
|
504
|
+
image: "\u{1F36D}",
|
|
505
|
+
imageType: "emoji"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
id: "food-watermelon",
|
|
509
|
+
title: "\u6E05\u723D\u7684\u897F\u74DC \u{1F349}",
|
|
510
|
+
description: "\u6E05\u723D\u89E3\u6E34\uFF0C\u590F\u65E5\u5FC5\u5907\u3002\u4F60\u603B\u80FD\u5E26\u6765\u6E05\u65B0\u7684\u611F\u89C9\u3002",
|
|
511
|
+
image: "\u{1F349}",
|
|
512
|
+
imageType: "emoji"
|
|
513
|
+
}
|
|
514
|
+
];
|
|
515
|
+
if (DEFAULT_RESULTS.length !== 45) {
|
|
516
|
+
console.warn(`\u7ED3\u679C\u6570\u636E\u96C6\u5E94\u5305\u542B45\u9879\uFF0C\u5F53\u524D: ${DEFAULT_RESULTS.length}`);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
// src/testYourself/components/TestYourself.tsx
|
|
520
|
+
var STORAGE_KEY = "test-yourself-result";
|
|
521
|
+
var TestYourself = ({
|
|
522
|
+
config,
|
|
523
|
+
onResult,
|
|
524
|
+
className = ""
|
|
525
|
+
}) => {
|
|
526
|
+
const {
|
|
527
|
+
gameTitle,
|
|
528
|
+
gameDescription,
|
|
529
|
+
buttonText = "\u957F\u6309\u5F00\u59CB\u6D4B\u8BD5",
|
|
530
|
+
longPressDuration = 2e3,
|
|
531
|
+
results = DEFAULT_RESULTS,
|
|
532
|
+
enableIPFetch = false,
|
|
533
|
+
customSalt,
|
|
534
|
+
resultStyle = "card"
|
|
535
|
+
} = config;
|
|
536
|
+
const [status, setStatus] = React.useState("idle");
|
|
537
|
+
const [result, setResult] = React.useState(null);
|
|
538
|
+
const [pressProgress, setPressProgress] = React.useState(0);
|
|
539
|
+
const [ipWarning, setIpWarning] = React.useState(null);
|
|
540
|
+
const [isLoading, setIsLoading] = React.useState(true);
|
|
541
|
+
const pressTimerRef = React.useRef(null);
|
|
542
|
+
const progressIntervalRef = React.useRef(null);
|
|
543
|
+
const startTimeRef = React.useRef(0);
|
|
544
|
+
React.useEffect(() => {
|
|
545
|
+
const initializeTest = async () => {
|
|
546
|
+
const savedResult = localStorage.getItem(STORAGE_KEY);
|
|
547
|
+
if (savedResult) {
|
|
548
|
+
try {
|
|
549
|
+
const parsed = JSON.parse(savedResult);
|
|
550
|
+
setResult(parsed);
|
|
551
|
+
setStatus("completed");
|
|
552
|
+
setIsLoading(false);
|
|
553
|
+
return;
|
|
554
|
+
} catch (error) {
|
|
555
|
+
console.error("\u89E3\u6790\u4FDD\u5B58\u7684\u7ED3\u679C\u5931\u8D25:", error);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
if (enableIPFetch) {
|
|
559
|
+
const ip = await tryGetIPAddress();
|
|
560
|
+
if (!ip) {
|
|
561
|
+
setIpWarning("\u26A0\uFE0F \u65E0\u6CD5\u83B7\u53D6IP\u5730\u5740\uFF0C\u5C06\u4EC5\u4F7F\u7528\u6D4F\u89C8\u5668\u6307\u7EB9\u751F\u6210\u7ED3\u679C");
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
setIsLoading(false);
|
|
565
|
+
};
|
|
566
|
+
initializeTest();
|
|
567
|
+
}, [enableIPFetch]);
|
|
568
|
+
const calculateResult = async () => {
|
|
569
|
+
try {
|
|
570
|
+
const fingerprint = getDeviceFingerprint();
|
|
571
|
+
if (enableIPFetch) {
|
|
572
|
+
const ip = await tryGetIPAddress();
|
|
573
|
+
if (ip) {
|
|
574
|
+
fingerprint.ip = ip;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
const actualResults = results.length > 0 ? results : DEFAULT_RESULTS;
|
|
578
|
+
const hash = generateDeviceHash(fingerprint, customSalt);
|
|
579
|
+
const index = selectResultIndex(hash, actualResults.length);
|
|
580
|
+
const selectedResult = actualResults[index];
|
|
581
|
+
if (!selectedResult) {
|
|
582
|
+
console.error("\u65E0\u6CD5\u83B7\u53D6\u6D4B\u8BD5\u7ED3\u679C\uFF0Cindex:", index, "total:", actualResults.length);
|
|
583
|
+
throw new Error("\u65E0\u6CD5\u83B7\u53D6\u6D4B\u8BD5\u7ED3\u679C");
|
|
584
|
+
}
|
|
585
|
+
console.log("\u8BA1\u7B97\u7ED3\u679C\u6210\u529F:", selectedResult);
|
|
586
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(selectedResult));
|
|
587
|
+
return selectedResult;
|
|
588
|
+
} catch (error) {
|
|
589
|
+
console.error("\u8BA1\u7B97\u7ED3\u679C\u5931\u8D25:", error);
|
|
590
|
+
throw error;
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
const handlePressStart = (e) => {
|
|
594
|
+
if (status !== "idle") return;
|
|
595
|
+
e.preventDefault();
|
|
596
|
+
setStatus("pressing");
|
|
597
|
+
startTimeRef.current = Date.now();
|
|
598
|
+
progressIntervalRef.current = setInterval(() => {
|
|
599
|
+
const elapsed = Date.now() - startTimeRef.current;
|
|
600
|
+
const progress = Math.min(elapsed / longPressDuration * 100, 100);
|
|
601
|
+
setPressProgress(progress);
|
|
602
|
+
}, 16);
|
|
603
|
+
pressTimerRef.current = setTimeout(async () => {
|
|
604
|
+
try {
|
|
605
|
+
setPressProgress(100);
|
|
606
|
+
if (progressIntervalRef.current) {
|
|
607
|
+
clearInterval(progressIntervalRef.current);
|
|
608
|
+
progressIntervalRef.current = null;
|
|
609
|
+
}
|
|
610
|
+
console.log("\u5F00\u59CB\u8BA1\u7B97\u7ED3\u679C...");
|
|
611
|
+
const testResult = await calculateResult();
|
|
612
|
+
console.log("\u7ED3\u679C\u8BA1\u7B97\u5B8C\u6210\uFF0C\u66F4\u65B0\u72B6\u6001:", testResult);
|
|
613
|
+
setResult(testResult);
|
|
614
|
+
setTimeout(() => {
|
|
615
|
+
setStatus("completed");
|
|
616
|
+
console.log("\u72B6\u6001\u5DF2\u66F4\u65B0\u4E3A completed");
|
|
617
|
+
}, 0);
|
|
618
|
+
if (onResult) {
|
|
619
|
+
onResult(testResult);
|
|
620
|
+
}
|
|
621
|
+
} catch (error) {
|
|
622
|
+
console.error("\u6D4B\u8BD5\u5931\u8D25:", error);
|
|
623
|
+
setStatus("idle");
|
|
624
|
+
setPressProgress(0);
|
|
625
|
+
alert("\u6D4B\u8BD5\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
|
|
626
|
+
}
|
|
627
|
+
}, longPressDuration);
|
|
628
|
+
if ("button" in e && e.button === 0) {
|
|
629
|
+
const handleGlobalMouseUp = () => {
|
|
630
|
+
handlePressEnd();
|
|
631
|
+
document.removeEventListener("mouseup", handleGlobalMouseUp);
|
|
632
|
+
};
|
|
633
|
+
document.addEventListener("mouseup", handleGlobalMouseUp);
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
const handlePressEnd = () => {
|
|
637
|
+
if (status !== "pressing") return;
|
|
638
|
+
if (pressTimerRef.current) {
|
|
639
|
+
clearTimeout(pressTimerRef.current);
|
|
640
|
+
pressTimerRef.current = null;
|
|
641
|
+
}
|
|
642
|
+
if (progressIntervalRef.current) {
|
|
643
|
+
clearInterval(progressIntervalRef.current);
|
|
644
|
+
progressIntervalRef.current = null;
|
|
645
|
+
}
|
|
646
|
+
setStatus("idle");
|
|
647
|
+
setPressProgress(0);
|
|
648
|
+
};
|
|
649
|
+
const handleMouseLeave = (e) => {
|
|
650
|
+
};
|
|
651
|
+
const handleTouchMove = (e) => {
|
|
652
|
+
const touch = e.touches[0];
|
|
653
|
+
if (!touch) return;
|
|
654
|
+
const target = e.currentTarget;
|
|
655
|
+
const rect = target.getBoundingClientRect();
|
|
656
|
+
const isInside = touch.clientX >= rect.left && touch.clientX <= rect.right && touch.clientY >= rect.top && touch.clientY <= rect.bottom;
|
|
657
|
+
if (!isInside && status === "pressing") {
|
|
658
|
+
handlePressEnd();
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
React.useEffect(() => {
|
|
662
|
+
return () => {
|
|
663
|
+
if (pressTimerRef.current) {
|
|
664
|
+
clearTimeout(pressTimerRef.current);
|
|
665
|
+
}
|
|
666
|
+
if (progressIntervalRef.current) {
|
|
667
|
+
clearInterval(progressIntervalRef.current);
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
}, []);
|
|
671
|
+
const handleReset = () => {
|
|
672
|
+
localStorage.removeItem(STORAGE_KEY);
|
|
673
|
+
setResult(null);
|
|
674
|
+
setStatus("idle");
|
|
675
|
+
setPressProgress(0);
|
|
676
|
+
};
|
|
677
|
+
const backgroundStyle = {
|
|
678
|
+
position: "relative",
|
|
679
|
+
minHeight: "100vh",
|
|
680
|
+
overflow: "hidden",
|
|
681
|
+
background: "linear-gradient(135deg, #f3e8ff 0%, #fce7f3 50%, #dbeafe 100%)"
|
|
682
|
+
};
|
|
683
|
+
const DecorativeBackground = () => /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
684
|
+
position: "absolute",
|
|
685
|
+
top: 0,
|
|
686
|
+
left: 0,
|
|
687
|
+
width: "384px",
|
|
688
|
+
height: "384px",
|
|
689
|
+
background: "radial-gradient(circle, rgba(192, 132, 252, 0.3) 0%, transparent 70%)",
|
|
690
|
+
borderRadius: "50%",
|
|
691
|
+
filter: "blur(60px)",
|
|
692
|
+
transform: "translate(-50%, -50%)",
|
|
693
|
+
pointerEvents: "none"
|
|
694
|
+
} }), /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
695
|
+
position: "absolute",
|
|
696
|
+
top: "50%",
|
|
697
|
+
right: 0,
|
|
698
|
+
width: "384px",
|
|
699
|
+
height: "384px",
|
|
700
|
+
background: "radial-gradient(circle, rgba(244, 114, 182, 0.3) 0%, transparent 70%)",
|
|
701
|
+
borderRadius: "50%",
|
|
702
|
+
filter: "blur(60px)",
|
|
703
|
+
transform: "translateX(50%)",
|
|
704
|
+
pointerEvents: "none"
|
|
705
|
+
} }), /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
706
|
+
position: "absolute",
|
|
707
|
+
bottom: 0,
|
|
708
|
+
left: "50%",
|
|
709
|
+
width: "384px",
|
|
710
|
+
height: "384px",
|
|
711
|
+
background: "radial-gradient(circle, rgba(147, 197, 253, 0.3) 0%, transparent 70%)",
|
|
712
|
+
borderRadius: "50%",
|
|
713
|
+
filter: "blur(60px)",
|
|
714
|
+
transform: "translate(-50%, 50%)",
|
|
715
|
+
pointerEvents: "none"
|
|
716
|
+
} }));
|
|
717
|
+
if (isLoading) {
|
|
718
|
+
return /* @__PURE__ */ React__default.default.createElement("div", { className, style: backgroundStyle }, /* @__PURE__ */ React__default.default.createElement(DecorativeBackground, null), /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
719
|
+
position: "relative",
|
|
720
|
+
zIndex: 10,
|
|
721
|
+
display: "flex",
|
|
722
|
+
alignItems: "center",
|
|
723
|
+
justifyContent: "center",
|
|
724
|
+
minHeight: "100vh"
|
|
725
|
+
} }, /* @__PURE__ */ React__default.default.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
726
|
+
position: "relative",
|
|
727
|
+
width: "64px",
|
|
728
|
+
height: "64px",
|
|
729
|
+
margin: "0 auto 16px"
|
|
730
|
+
} }, /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
731
|
+
position: "absolute",
|
|
732
|
+
inset: 0,
|
|
733
|
+
border: "4px solid #e9d5ff",
|
|
734
|
+
borderRadius: "50%"
|
|
735
|
+
} }), /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
736
|
+
position: "absolute",
|
|
737
|
+
inset: 0,
|
|
738
|
+
border: "4px solid transparent",
|
|
739
|
+
borderTopColor: "#a855f7",
|
|
740
|
+
borderRadius: "50%",
|
|
741
|
+
animation: "spin 1s linear infinite"
|
|
742
|
+
} })), /* @__PURE__ */ React__default.default.createElement("p", { style: { fontSize: "14px", color: "#6b7280" } }, "\u2728 \u52A0\u8F7D\u4E2D"))));
|
|
743
|
+
}
|
|
744
|
+
if (status === "completed" && result) {
|
|
745
|
+
return /* @__PURE__ */ React__default.default.createElement("div", { className, style: backgroundStyle }, /* @__PURE__ */ React__default.default.createElement(DecorativeBackground, null), /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
746
|
+
position: "relative",
|
|
747
|
+
zIndex: 10,
|
|
748
|
+
minHeight: "100vh",
|
|
749
|
+
display: "flex",
|
|
750
|
+
alignItems: "center",
|
|
751
|
+
justifyContent: "center",
|
|
752
|
+
padding: "24px"
|
|
753
|
+
} }, /* @__PURE__ */ React__default.default.createElement("div", { style: { maxWidth: "420px", width: "100%" } }, /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
754
|
+
position: "relative",
|
|
755
|
+
background: "linear-gradient(135deg, #fdf2f8 0%, #faf5ff 50%, #eff6ff 100%)",
|
|
756
|
+
borderRadius: "32px",
|
|
757
|
+
boxShadow: "0 25px 50px -12px rgba(168, 85, 247, 0.25), 0 0 0 1px rgba(168, 85, 247, 0.1)",
|
|
758
|
+
overflow: "hidden",
|
|
759
|
+
padding: "40px 32px",
|
|
760
|
+
textAlign: "center"
|
|
761
|
+
} }, /* @__PURE__ */ React__default.default.createElement("div", { style: { position: "absolute", top: "20px", left: "20px", fontSize: "24px", opacity: 0.6 } }, "\u2728"), /* @__PURE__ */ React__default.default.createElement("div", { style: { position: "absolute", top: "40px", right: "30px", fontSize: "20px", opacity: 0.5 } }, "\u2B50"), /* @__PURE__ */ React__default.default.createElement("div", { style: { position: "absolute", bottom: "30px", left: "40px", fontSize: "18px", opacity: 0.4 } }, "\u{1F4AB}"), /* @__PURE__ */ React__default.default.createElement("div", { style: { position: "absolute", bottom: "50px", right: "25px", fontSize: "22px", opacity: 0.5 } }, "\u{1F31F}"), /* @__PURE__ */ React__default.default.createElement("div", { style: { marginBottom: "24px" } }, /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
762
|
+
display: "inline-block",
|
|
763
|
+
fontSize: "80px",
|
|
764
|
+
animation: "bounce-slow 2s ease-in-out infinite",
|
|
765
|
+
filter: "drop-shadow(0 10px 20px rgba(0,0,0,0.1))"
|
|
766
|
+
} }, result.imageType === "emoji" ? result.image : "\u{1F389}")), /* @__PURE__ */ React__default.default.createElement("h2", { style: {
|
|
767
|
+
fontSize: "32px",
|
|
768
|
+
fontWeight: 800,
|
|
769
|
+
background: "linear-gradient(135deg, #9333ea 0%, #ec4899 100%)",
|
|
770
|
+
WebkitBackgroundClip: "text",
|
|
771
|
+
WebkitTextFillColor: "transparent",
|
|
772
|
+
backgroundClip: "text",
|
|
773
|
+
marginBottom: "16px",
|
|
774
|
+
lineHeight: 1.3
|
|
775
|
+
} }, result.title), /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
776
|
+
background: "rgba(255, 255, 255, 0.8)",
|
|
777
|
+
borderRadius: "20px",
|
|
778
|
+
padding: "20px 24px",
|
|
779
|
+
marginBottom: "28px",
|
|
780
|
+
boxShadow: "0 4px 15px rgba(168, 85, 247, 0.1)",
|
|
781
|
+
border: "2px dashed rgba(168, 85, 247, 0.2)"
|
|
782
|
+
} }, /* @__PURE__ */ React__default.default.createElement("p", { style: {
|
|
783
|
+
fontSize: "16px",
|
|
784
|
+
color: "#6b7280",
|
|
785
|
+
lineHeight: 1.7,
|
|
786
|
+
margin: 0
|
|
787
|
+
} }, result.description)), /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
788
|
+
display: "flex",
|
|
789
|
+
alignItems: "center",
|
|
790
|
+
justifyContent: "center",
|
|
791
|
+
gap: "8px",
|
|
792
|
+
marginBottom: "24px"
|
|
793
|
+
} }, /* @__PURE__ */ React__default.default.createElement("span", { style: { width: "40px", height: "3px", background: "linear-gradient(to right, #a855f7, transparent)", borderRadius: "999px" } }), /* @__PURE__ */ React__default.default.createElement("span", { style: { fontSize: "16px" } }, "\u{1F495}"), /* @__PURE__ */ React__default.default.createElement("span", { style: { width: "40px", height: "3px", background: "linear-gradient(to left, #ec4899, transparent)", borderRadius: "999px" } })), /* @__PURE__ */ React__default.default.createElement(
|
|
794
|
+
"button",
|
|
795
|
+
{
|
|
796
|
+
onClick: handleReset,
|
|
797
|
+
style: {
|
|
798
|
+
display: "inline-flex",
|
|
799
|
+
alignItems: "center",
|
|
800
|
+
justifyContent: "center",
|
|
801
|
+
gap: "8px",
|
|
802
|
+
padding: "14px 32px",
|
|
803
|
+
fontSize: "16px",
|
|
804
|
+
fontWeight: 600,
|
|
805
|
+
color: "white",
|
|
806
|
+
background: "linear-gradient(135deg, #a855f7 0%, #ec4899 100%)",
|
|
807
|
+
border: "none",
|
|
808
|
+
borderRadius: "9999px",
|
|
809
|
+
cursor: "pointer",
|
|
810
|
+
boxShadow: "0 10px 25px -5px rgba(168, 85, 247, 0.4)",
|
|
811
|
+
transition: "all 0.3s ease"
|
|
812
|
+
},
|
|
813
|
+
onMouseEnter: (e) => {
|
|
814
|
+
e.currentTarget.style.transform = "scale(1.05) translateY(-2px)";
|
|
815
|
+
e.currentTarget.style.boxShadow = "0 15px 35px -5px rgba(168, 85, 247, 0.5)";
|
|
816
|
+
},
|
|
817
|
+
onMouseLeave: (e) => {
|
|
818
|
+
e.currentTarget.style.transform = "scale(1) translateY(0)";
|
|
819
|
+
e.currentTarget.style.boxShadow = "0 10px 25px -5px rgba(168, 85, 247, 0.4)";
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
/* @__PURE__ */ React__default.default.createElement("span", null, "\u{1F504}"),
|
|
823
|
+
/* @__PURE__ */ React__default.default.createElement("span", null, "\u91CD\u65B0\u6D4B\u8BD5")
|
|
824
|
+
)))));
|
|
825
|
+
}
|
|
826
|
+
return /* @__PURE__ */ React__default.default.createElement("div", { className, style: backgroundStyle }, /* @__PURE__ */ React__default.default.createElement(DecorativeBackground, null), /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
827
|
+
position: "relative",
|
|
828
|
+
zIndex: 10,
|
|
829
|
+
minHeight: "100vh",
|
|
830
|
+
display: "flex",
|
|
831
|
+
alignItems: "center",
|
|
832
|
+
justifyContent: "center",
|
|
833
|
+
padding: "16px"
|
|
834
|
+
} }, /* @__PURE__ */ React__default.default.createElement("div", { style: { maxWidth: "512px", width: "100%", textAlign: "center", userSelect: "none" } }, /* @__PURE__ */ React__default.default.createElement("div", { style: { marginBottom: "48px" } }, /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
835
|
+
display: "inline-block",
|
|
836
|
+
marginBottom: "16px",
|
|
837
|
+
animation: "bounce-slow 2s ease-in-out infinite"
|
|
838
|
+
} }, /* @__PURE__ */ React__default.default.createElement("span", { style: { fontSize: "56px" } }, "\u{1F3B2}")), /* @__PURE__ */ React__default.default.createElement("h1", { style: {
|
|
839
|
+
fontSize: "48px",
|
|
840
|
+
fontWeight: 900,
|
|
841
|
+
marginBottom: "12px",
|
|
842
|
+
background: "linear-gradient(135deg, #9333ea 0%, #ec4899 50%, #3b82f6 100%)",
|
|
843
|
+
WebkitBackgroundClip: "text",
|
|
844
|
+
WebkitTextFillColor: "transparent",
|
|
845
|
+
backgroundClip: "text",
|
|
846
|
+
lineHeight: 1.2
|
|
847
|
+
} }, gameTitle), gameDescription && /* @__PURE__ */ React__default.default.createElement("p", { style: {
|
|
848
|
+
fontSize: "18px",
|
|
849
|
+
color: "#6b7280",
|
|
850
|
+
fontWeight: 500
|
|
851
|
+
} }, gameDescription)), /* @__PURE__ */ React__default.default.createElement("div", { style: { marginBottom: "24px" } }, /* @__PURE__ */ React__default.default.createElement(
|
|
852
|
+
"button",
|
|
853
|
+
{
|
|
854
|
+
onMouseDown: handlePressStart,
|
|
855
|
+
onMouseLeave: handleMouseLeave,
|
|
856
|
+
onTouchStart: handlePressStart,
|
|
857
|
+
onTouchEnd: handlePressEnd,
|
|
858
|
+
onTouchMove: handleTouchMove,
|
|
859
|
+
onTouchCancel: handlePressEnd,
|
|
860
|
+
onContextMenu: (e) => e.preventDefault(),
|
|
861
|
+
onDragStart: (e) => e.preventDefault(),
|
|
862
|
+
style: {
|
|
863
|
+
display: "block",
|
|
864
|
+
margin: "0 auto",
|
|
865
|
+
width: "200px",
|
|
866
|
+
height: "200px",
|
|
867
|
+
borderRadius: "50%",
|
|
868
|
+
border: "none",
|
|
869
|
+
fontSize: "20px",
|
|
870
|
+
fontWeight: "bold",
|
|
871
|
+
cursor: "pointer",
|
|
872
|
+
position: "relative",
|
|
873
|
+
overflow: "hidden",
|
|
874
|
+
userSelect: "none",
|
|
875
|
+
WebkitTouchCallout: "none",
|
|
876
|
+
WebkitUserSelect: "none",
|
|
877
|
+
touchAction: "none",
|
|
878
|
+
transition: "transform 0.3s ease",
|
|
879
|
+
transform: status === "pressing" ? "scale(0.95)" : "scale(1)",
|
|
880
|
+
background: status === "pressing" ? `linear-gradient(to top, rgb(168, 85, 247) ${pressProgress}%, rgb(236, 72, 153) ${pressProgress}%)` : "linear-gradient(135deg, #4f46e5 0%, #7c3aed 25%, #db2777 50%, #f97316 75%, #059669 100%)",
|
|
881
|
+
boxShadow: status === "pressing" ? "inset 0 4px 12px rgba(0,0,0,0.3), 0 0 0 4px rgba(168, 85, 247, 0.5)" : "0 15px 35px -10px rgba(79, 70, 229, 0.6), 0 0 0 4px rgba(255,255,255,0.8)"
|
|
882
|
+
}
|
|
883
|
+
},
|
|
884
|
+
/* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
885
|
+
position: "absolute",
|
|
886
|
+
top: 0,
|
|
887
|
+
left: 0,
|
|
888
|
+
right: 0,
|
|
889
|
+
bottom: 0,
|
|
890
|
+
display: "flex",
|
|
891
|
+
flexDirection: "column",
|
|
892
|
+
alignItems: "center",
|
|
893
|
+
justifyContent: "center",
|
|
894
|
+
color: "white",
|
|
895
|
+
pointerEvents: "none"
|
|
896
|
+
} }, status === "pressing" ? /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement("span", { style: { fontSize: "36px", fontWeight: 900, marginBottom: "4px" } }, Math.round(pressProgress), "%"), /* @__PURE__ */ React__default.default.createElement("span", { style: { fontSize: "14px", opacity: 0.8 } }, "\u7EE7\u7EED\u6309\u4F4F")) : /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement("span", { style: { fontSize: "32px", marginBottom: "8px" } }, "\u{1F446}"), /* @__PURE__ */ React__default.default.createElement("span", { style: { fontSize: "16px", fontWeight: "bold", padding: "0 16px" } }, buttonText))),
|
|
897
|
+
status === "idle" && /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
898
|
+
position: "absolute",
|
|
899
|
+
top: "16px",
|
|
900
|
+
left: "16px",
|
|
901
|
+
right: "16px",
|
|
902
|
+
bottom: "16px",
|
|
903
|
+
border: "2px solid rgba(255,255,255,0.3)",
|
|
904
|
+
borderRadius: "50%"
|
|
905
|
+
} })
|
|
906
|
+
), status === "pressing" && /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
907
|
+
marginTop: "16px",
|
|
908
|
+
marginLeft: "auto",
|
|
909
|
+
marginRight: "auto",
|
|
910
|
+
width: "192px",
|
|
911
|
+
height: "8px",
|
|
912
|
+
backgroundColor: "#e5e7eb",
|
|
913
|
+
borderRadius: "9999px",
|
|
914
|
+
overflow: "hidden"
|
|
915
|
+
} }, /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
916
|
+
height: "100%",
|
|
917
|
+
width: `${pressProgress}%`,
|
|
918
|
+
background: "linear-gradient(to right, #a855f7, #ec4899)",
|
|
919
|
+
transition: "width 0.1s ease"
|
|
920
|
+
} }))), /* @__PURE__ */ React__default.default.createElement("div", { style: { marginTop: "24px" } }, status === "pressing" ? /* @__PURE__ */ React__default.default.createElement("p", { style: {
|
|
921
|
+
fontSize: "18px",
|
|
922
|
+
fontWeight: 500,
|
|
923
|
+
color: "#9333ea",
|
|
924
|
+
animation: "pulse 2s ease-in-out infinite"
|
|
925
|
+
} }, "\u2728 \u6B63\u5728\u5206\u6790\u4E2D...") : /* @__PURE__ */ React__default.default.createElement("div", { style: {
|
|
926
|
+
display: "flex",
|
|
927
|
+
alignItems: "center",
|
|
928
|
+
justifyContent: "center",
|
|
929
|
+
gap: "8px"
|
|
930
|
+
} }, /* @__PURE__ */ React__default.default.createElement("span", { style: {
|
|
931
|
+
display: "inline-block",
|
|
932
|
+
width: "6px",
|
|
933
|
+
height: "6px",
|
|
934
|
+
backgroundColor: "#a855f7",
|
|
935
|
+
borderRadius: "50%",
|
|
936
|
+
animation: "bounce 1s infinite"
|
|
937
|
+
} }), /* @__PURE__ */ React__default.default.createElement("span", { style: {
|
|
938
|
+
display: "inline-block",
|
|
939
|
+
width: "6px",
|
|
940
|
+
height: "6px",
|
|
941
|
+
backgroundColor: "#ec4899",
|
|
942
|
+
borderRadius: "50%",
|
|
943
|
+
animation: "bounce 1s infinite 0.1s"
|
|
944
|
+
} }), /* @__PURE__ */ React__default.default.createElement("span", { style: {
|
|
945
|
+
display: "inline-block",
|
|
946
|
+
width: "6px",
|
|
947
|
+
height: "6px",
|
|
948
|
+
backgroundColor: "#3b82f6",
|
|
949
|
+
borderRadius: "50%",
|
|
950
|
+
animation: "bounce 1s infinite 0.2s"
|
|
951
|
+
} }))))));
|
|
952
|
+
};
|
|
953
|
+
var touchOptimizationStyles = `
|
|
954
|
+
@keyframes bounce-slow {
|
|
955
|
+
0%, 100% {
|
|
956
|
+
transform: translateY(0);
|
|
957
|
+
}
|
|
958
|
+
50% {
|
|
959
|
+
transform: translateY(-10px);
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
@keyframes bounce {
|
|
964
|
+
0%, 100% {
|
|
965
|
+
transform: translateY(0);
|
|
966
|
+
}
|
|
967
|
+
50% {
|
|
968
|
+
transform: translateY(-4px);
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
@keyframes pulse {
|
|
973
|
+
0%, 100% {
|
|
974
|
+
opacity: 1;
|
|
975
|
+
}
|
|
976
|
+
50% {
|
|
977
|
+
opacity: 0.5;
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
@keyframes spin {
|
|
982
|
+
from {
|
|
983
|
+
transform: rotate(0deg);
|
|
984
|
+
}
|
|
985
|
+
to {
|
|
986
|
+
transform: rotate(360deg);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
`;
|
|
990
|
+
if (typeof document !== "undefined" && !document.getElementById("test-yourself-styles")) {
|
|
991
|
+
const style = document.createElement("style");
|
|
992
|
+
style.id = "test-yourself-styles";
|
|
993
|
+
style.textContent = touchOptimizationStyles;
|
|
994
|
+
document.head.appendChild(style);
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
exports.DEFAULT_RESULTS = DEFAULT_RESULTS;
|
|
998
|
+
exports.TestYourself = TestYourself;
|
|
999
|
+
exports.generateDeviceHash = generateDeviceHash;
|
|
1000
|
+
exports.getDeviceFingerprint = getDeviceFingerprint;
|
|
1001
|
+
exports.selectResultIndex = selectResultIndex;
|
|
1002
|
+
exports.tryGetIPAddress = tryGetIPAddress;
|
|
1003
|
+
//# sourceMappingURL=index.js.map
|
|
1004
|
+
//# sourceMappingURL=index.js.map
|