force update
This commit is contained in:
@@ -19,13 +19,21 @@ function buildAtlas() {
|
|||||||
|
|
||||||
let r, g, b;
|
let r, g, b;
|
||||||
if (isVpnOn && isDarkMode) {
|
if (isVpnOn && isDarkMode) {
|
||||||
r = 139; g = 61; b = 255;
|
r = 139;
|
||||||
|
g = 61;
|
||||||
|
b = 255;
|
||||||
} else if (!isVpnOn && isDarkMode) {
|
} else if (!isVpnOn && isDarkMode) {
|
||||||
r = 0; g = 229; b = 242;
|
r = 0;
|
||||||
|
g = 229;
|
||||||
|
b = 242;
|
||||||
} else if (isVpnOn && !isDarkMode) {
|
} else if (isVpnOn && !isDarkMode) {
|
||||||
r = 109; g = 40; b = 217;
|
r = 109;
|
||||||
|
g = 40;
|
||||||
|
b = 217;
|
||||||
} else {
|
} else {
|
||||||
r = 2; g = 132; b = 199;
|
r = 2;
|
||||||
|
g = 132;
|
||||||
|
b = 199;
|
||||||
}
|
}
|
||||||
|
|
||||||
atlasCtx.fillStyle = isDarkMode ? "rgb(10, 10, 12)" : "rgb(250, 250, 252)";
|
atlasCtx.fillStyle = isDarkMode ? "rgb(10, 10, 12)" : "rgb(250, 250, 252)";
|
||||||
@@ -48,13 +56,21 @@ function buildAtlas() {
|
|||||||
function getGlitchColor(type) {
|
function getGlitchColor(type) {
|
||||||
let r, g, b;
|
let r, g, b;
|
||||||
if (isVpnOn && isDarkMode) {
|
if (isVpnOn && isDarkMode) {
|
||||||
r = 139; g = 61; b = 255;
|
r = 139;
|
||||||
|
g = 61;
|
||||||
|
b = 255;
|
||||||
} else if (!isVpnOn && isDarkMode) {
|
} else if (!isVpnOn && isDarkMode) {
|
||||||
r = 0; g = 229; b = 242;
|
r = 0;
|
||||||
|
g = 229;
|
||||||
|
b = 242;
|
||||||
} else if (isVpnOn && !isDarkMode) {
|
} else if (isVpnOn && !isDarkMode) {
|
||||||
r = 109; g = 40; b = 217;
|
r = 109;
|
||||||
|
g = 40;
|
||||||
|
b = 217;
|
||||||
} else {
|
} else {
|
||||||
r = 2; g = 132; b = 199;
|
r = 2;
|
||||||
|
g = 132;
|
||||||
|
b = 199;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 0) return isDarkMode ? "rgb(10, 10, 12)" : "rgb(250, 250, 252)";
|
if (type === 0) return isDarkMode ? "rgb(10, 10, 12)" : "rgb(250, 250, 252)";
|
||||||
@@ -76,7 +92,7 @@ self.onmessage = async (e) => {
|
|||||||
isDarkMode = payload.isDarkMode;
|
isDarkMode = payload.isDarkMode;
|
||||||
fontSize = payload.fontSize || 16;
|
fontSize = payload.fontSize || 16;
|
||||||
|
|
||||||
wasm = await init("./matrix_engine_bg.wasm");
|
wasm = await init("./matrix_engine_bg.wasm?=v1.0");
|
||||||
engine = new MatrixEngine(width, height, fontSize);
|
engine = new MatrixEngine(width, height, fontSize);
|
||||||
engine.set_mobile(isMobile);
|
engine.set_mobile(isMobile);
|
||||||
engine.set_vpn_status(isVpnOn);
|
engine.set_vpn_status(isVpnOn);
|
||||||
@@ -129,8 +145,12 @@ self.onmessage = async (e) => {
|
|||||||
|
|
||||||
function drawEye(ctx, cx, cy, gazeX, gazeY, dir, isClosed) {
|
function drawEye(ctx, cx, cy, gazeX, gazeY, dir, isClosed) {
|
||||||
const color = isVpnOn
|
const color = isVpnOn
|
||||||
? (isDarkMode ? "rgb(139, 61, 255)" : "rgb(109, 40, 217)")
|
? isDarkMode
|
||||||
: (isDarkMode ? "rgb(0, 229, 242)" : "rgb(2, 132, 199)");
|
? "rgb(139, 61, 255)"
|
||||||
|
: "rgb(109, 40, 217)"
|
||||||
|
: isDarkMode
|
||||||
|
? "rgb(0, 229, 242)"
|
||||||
|
: "rgb(2, 132, 199)";
|
||||||
|
|
||||||
const bgFill = isDarkMode ? "rgb(10, 10, 12)" : "rgb(250, 250, 252)";
|
const bgFill = isDarkMode ? "rgb(10, 10, 12)" : "rgb(250, 250, 252)";
|
||||||
|
|
||||||
@@ -143,7 +163,13 @@ function drawEye(ctx, cx, cy, gazeX, gazeY, dir, isClosed) {
|
|||||||
ctx.save();
|
ctx.save();
|
||||||
ctx.fillStyle = bgFill;
|
ctx.fillStyle = bgFill;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.roundRect(cx - eyeWidth/2, cy - eyeHeight/2, eyeWidth, eyeHeight, eyeRadius);
|
ctx.roundRect(
|
||||||
|
cx - eyeWidth / 2,
|
||||||
|
cy - eyeHeight / 2,
|
||||||
|
eyeWidth,
|
||||||
|
eyeHeight,
|
||||||
|
eyeRadius,
|
||||||
|
);
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
|
|
||||||
ctx.strokeStyle = color;
|
ctx.strokeStyle = color;
|
||||||
@@ -157,11 +183,11 @@ function drawEye(ctx, cx, cy, gazeX, gazeY, dir, isClosed) {
|
|||||||
ctx.shadowColor = color;
|
ctx.shadowColor = color;
|
||||||
ctx.shadowBlur = 8;
|
ctx.shadowBlur = 8;
|
||||||
ctx.globalAlpha = isClosed;
|
ctx.globalAlpha = isClosed;
|
||||||
ctx.fillRect(cx - laserWidth/2, cy - 1, laserWidth, 2);
|
ctx.fillRect(cx - laserWidth / 2, cy - 1, laserWidth, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isClosed < 0.99) {
|
if (isClosed < 0.99) {
|
||||||
const alphaMult = (1 - isClosed);
|
const alphaMult = 1 - isClosed;
|
||||||
ctx.save();
|
ctx.save();
|
||||||
ctx.translate(cx + gazeX, cy + gazeY);
|
ctx.translate(cx + gazeX, cy + gazeY);
|
||||||
|
|
||||||
@@ -186,10 +212,14 @@ function drawEye(ctx, cx, cy, gazeX, gazeY, dir, isClosed) {
|
|||||||
ctx.lineWidth = 1;
|
ctx.lineWidth = 1;
|
||||||
ctx.shadowBlur = 0;
|
ctx.shadowBlur = 0;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(-16, 0); ctx.lineTo(-8, 0);
|
ctx.moveTo(-16, 0);
|
||||||
ctx.moveTo(16, 0); ctx.lineTo(8, 0);
|
ctx.lineTo(-8, 0);
|
||||||
ctx.moveTo(0, -16); ctx.lineTo(0, -8);
|
ctx.moveTo(16, 0);
|
||||||
ctx.moveTo(0, 16); ctx.lineTo(0, 8);
|
ctx.lineTo(8, 0);
|
||||||
|
ctx.moveTo(0, -16);
|
||||||
|
ctx.lineTo(0, -8);
|
||||||
|
ctx.moveTo(0, 16);
|
||||||
|
ctx.lineTo(0, 8);
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
|
|
||||||
// Arrows
|
// Arrows
|
||||||
@@ -262,7 +292,11 @@ function render() {
|
|||||||
// Draw Eyes
|
// Draw Eyes
|
||||||
const eyeLen = engine.eye_len();
|
const eyeLen = engine.eye_len();
|
||||||
if (eyeLen >= 6) {
|
if (eyeLen >= 6) {
|
||||||
const eyeData = new Float32Array(wasm.memory.buffer, engine.eye_ptr(), eyeLen);
|
const eyeData = new Float32Array(
|
||||||
|
wasm.memory.buffer,
|
||||||
|
engine.eye_ptr(),
|
||||||
|
eyeLen,
|
||||||
|
);
|
||||||
const cx = eyeData[0];
|
const cx = eyeData[0];
|
||||||
const cy = eyeData[1];
|
const cy = eyeData[1];
|
||||||
const gazeX = eyeData[2];
|
const gazeX = eyeData[2];
|
||||||
|
|||||||
Reference in New Issue
Block a user