style: 升级说明页改用独立视觉

This commit is contained in:
Nixevol
2026-11-18 10:37:55 +08:00
parent 3098a2be2e
commit af4934b27d
+165 -71
View File
@@ -1,11 +1,131 @@
<script setup lang="ts">
import { ref } from "vue";
import { onMounted, onUnmounted, ref } from "vue";
const toolUrl = "https://euniv.asio.asia";
const canvasEl = ref<HTMLCanvasElement | null>(null);
const urlEl = ref<HTMLElement | null>(null);
const copied = ref(false);
const copyFailed = ref(false);
let copiedTimer = 0;
let frame = 0;
let gl: WebGLRenderingContext | null = null;
const VERT = `
attribute vec2 aPos;
void main() {
gl_Position = vec4(aPos, 0.0, 1.0);
}
`;
const FRAG = `
precision highp float;
uniform vec2 uRes;
uniform float uTime;
float hash(vec2 p) {
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);
}
float noise(vec2 p) {
vec2 i = floor(p);
vec2 f = fract(p);
float a = hash(i);
float b = hash(i + vec2(1.0, 0.0));
float c = hash(i + vec2(0.0, 1.0));
float d = hash(i + vec2(1.0, 1.0));
vec2 u = f * f * (3.0 - 2.0 * f);
return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);
}
void main() {
vec2 p = (gl_FragCoord.xy - 0.5 * uRes) / uRes.y;
float t = uTime;
vec3 sky = vec3(0.012, 0.018, 0.04);
vec2 cell = floor(gl_FragCoord.xy / 2.0);
float star = hash(cell);
float twinkle = 0.65 + 0.35 * sin(t * 1.7 + star * 40.0);
sky += smoothstep(0.996, 1.0, star) * twinkle;
float field = noise(vec2(p.x * 1.6 + t * 0.04, t * 0.11));
vec3 color = sky;
for (int i = 0; i < 5; i++) {
float fi = float(i);
float wave = sin(p.x * (2.2 + fi * 0.35) + t * (0.18 + fi * 0.03) + fi);
float y = -0.05 + fi * 0.07 + wave * 0.09 + field * 0.18;
float d = abs(p.y - y);
float curtain = exp(-d * d * (90.0 + fi * 30.0));
vec3 tint = mix(vec3(0.15, 0.95, 0.62), vec3(0.45, 0.35, 1.0), fi / 4.0);
tint = mix(tint, vec3(0.95, 0.72, 0.38), smoothstep(0.6, 1.4, p.x + fi * 0.1));
color += tint * curtain * (0.28 + 0.08 * sin(t + fi));
}
float horizon = exp(-pow(p.y + 0.55, 2.0) * 2.2);
color += vec3(0.05, 0.12, 0.18) * horizon;
float vignette = smoothstep(1.35, 0.25, length(p));
gl_FragColor = vec4(color * vignette, 1.0);
}
`;
function compile(context: WebGLRenderingContext, type: number, source: string) {
const shader = context.createShader(type);
if (!shader) return null;
context.shaderSource(shader, source);
context.compileShader(shader);
if (!context.getShaderParameter(shader, context.COMPILE_STATUS)) {
context.deleteShader(shader);
return null;
}
return shader;
}
function resize() {
const canvas = canvasEl.value;
if (!canvas || !gl) return;
const ratio = Math.min(window.devicePixelRatio || 1, 2);
const width = Math.floor(canvas.clientWidth * ratio);
const height = Math.floor(canvas.clientHeight * ratio);
if (canvas.width !== width || canvas.height !== height) {
canvas.width = width;
canvas.height = height;
gl.viewport(0, 0, width, height);
}
}
function startField() {
const canvas = canvasEl.value;
if (!canvas) return;
gl = canvas.getContext("webgl", { antialias: false, alpha: false });
if (!gl) return;
const vertex = compile(gl, gl.VERTEX_SHADER, VERT);
const fragment = compile(gl, gl.FRAGMENT_SHADER, FRAG);
if (!vertex || !fragment) return;
const program = gl.createProgram();
if (!program) return;
gl.attachShader(program, vertex);
gl.attachShader(program, fragment);
gl.bindAttribLocation(program, 0, "aPos");
gl.linkProgram(program);
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) return;
gl.useProgram(program);
const buffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW);
gl.enableVertexAttribArray(0);
gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
const res = gl.getUniformLocation(program, "uRes");
const time = gl.getUniformLocation(program, "uTime");
const reduced = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
const draw = (now: number) => {
if (!gl) return;
resize();
gl.uniform2f(res, canvas.width, canvas.height);
gl.uniform1f(time, reduced ? 8 : now * 0.001);
gl.drawArrays(gl.TRIANGLES, 0, 3);
if (!reduced) frame = requestAnimationFrame(draw);
};
resize();
frame = requestAnimationFrame(draw);
}
async function copyUrl() {
copied.value = false;
@@ -29,18 +149,24 @@ async function copyUrl() {
copyFailed.value = false;
}, 2000);
}
onMounted(startField);
onUnmounted(() => {
cancelAnimationFrame(frame);
window.clearTimeout(copiedTimer);
gl = null;
});
</script>
<template>
<main class="upgrade">
<div class="glow" aria-hidden="true"></div>
<section class="card">
<p class="eyebrow">新版已上线</p>
<canvas ref="canvasEl" class="field" aria-hidden="true"></canvas>
<section class="copy">
<h1>旧版工具已失效</h1>
<p class="lead">因目标平台升级,旧版工具已失效,无法登录使用。</p>
<p class="lead">请复制下面的地址,打开浏览器,粘贴到地址栏后访问。</p>
<p>因目标平台升级,旧版工具已失效,无法登录使用。新版工具已上线。</p>
<p>请复制下面的地址,打开浏览器,粘贴到地址栏后访问。</p>
<p ref="urlEl" class="url">{{ toolUrl }}</p>
<button type="button" class="copy" @click="copyUrl">{{ copied ? "已复制" : "复制地址" }}</button>
<button type="button" class="copy-btn" @click="copyUrl">{{ copied ? "已复制" : "复制地址" }}</button>
<p v-if="copied" class="result ok">已复制。请到浏览器地址栏粘贴后访问。</p>
<p v-else-if="copyFailed" class="result miss">没有复制成功,地址已选中,请手动使用 CTRL+C 复制。</p>
</section>
@@ -52,112 +178,80 @@ async function copyUrl() {
position: fixed;
inset: 0;
z-index: 20;
display: grid;
place-items: center;
padding: 32px 16px;
overflow: auto;
color: #f6f1e8;
background:
radial-gradient(900px 480px at 50% -10%, rgba(245, 193, 108, 0.28), transparent 60%),
radial-gradient(700px 420px at 100% 100%, rgba(92, 124, 255, 0.18), transparent 55%),
#090b10;
color: #f4fff8;
background: #05070c;
font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.glow {
.field {
position: absolute;
width: 520px;
height: 520px;
border-radius: 50%;
background: radial-gradient(circle, rgba(245, 193, 108, 0.16), transparent 68%);
filter: blur(8px);
pointer-events: none;
inset: 0;
width: 100%;
height: 100%;
display: block;
}
.card {
.copy {
position: relative;
width: min(520px, 100%);
padding: 36px 32px 32px;
border: 1px solid rgba(245, 193, 108, 0.28);
border-radius: 20px;
background: rgba(16, 18, 26, 0.78);
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
backdrop-filter: blur(16px);
}
.eyebrow {
margin: 0 0 14px;
color: #f5c16c;
font-size: 13px;
font-weight: 650;
letter-spacing: 0.18em;
z-index: 1;
width: min(640px, calc(100% - 48px));
margin: 18vh auto 48px;
text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
}
h1 {
margin: 0 0 16px;
font-size: 36px;
line-height: 1.15;
font-size: clamp(36px, 6vw, 64px);
line-height: 1.05;
font-weight: 700;
letter-spacing: -0.03em;
letter-spacing: -0.04em;
}
.lead {
p {
margin: 0 0 10px;
color: #d9d1c5;
max-width: 38rem;
color: rgba(244, 255, 248, 0.86);
font-size: 16px;
line-height: 1.7;
}
.url {
margin: 22px 0 18px;
padding: 14px 16px;
border-radius: 12px;
background: rgba(255, 255, 255, 0.06);
color: #fff8ea;
font-size: 18px;
color: #fff;
font-size: clamp(18px, 2.4vw, 28px);
letter-spacing: 0.01em;
word-break: break-all;
user-select: all;
}
.copy {
height: 44px;
padding: 0 22px;
border: 0;
.copy-btn {
height: 42px;
padding: 0 18px;
border: 1px solid rgba(190, 255, 214, 0.7);
border-radius: 999px;
background: linear-gradient(180deg, #ffd98a, #f5c16c);
color: #2a1c08;
background: rgba(8, 16, 14, 0.45);
color: #e9fff3;
font: inherit;
font-size: 15px;
font-weight: 700;
cursor: pointer;
backdrop-filter: blur(8px);
}
.copy:hover {
filter: brightness(1.05);
.copy-btn:hover {
background: rgba(120, 255, 190, 0.16);
}
.result {
margin: 14px 0 0;
margin-top: 14px;
font-size: 14px;
line-height: 1.6;
}
.ok {
color: #b7f0c2;
color: #d8ffe6;
}
.miss {
color: #ffd0a8;
}
@media (max-width: 560px) {
.card {
padding: 28px 20px 24px;
}
h1 {
font-size: 30px;
}
color: #ffe1c2;
}
</style>