style: 升级说明页改回灰色卡片

This commit is contained in:
Nixevol
2026-11-18 10:43:20 +08:00
parent b6faad00fc
commit f2dd646d80
+35 -152
View File
@@ -1,107 +1,11 @@
<script setup lang="ts">
import { onMounted, onUnmounted, ref } from "vue";
import { 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 running = false;
type Mote = { x: number; y: number; hue: number; life: number };
const motes: Mote[] = [];
function field(x: number, y: number, time: number) {
const scale = 0.0016;
const a = Math.sin(x * scale * 2.4 + time * 0.35);
const b = Math.cos(y * scale * 2.1 - time * 0.28);
const c = Math.sin((x + y) * scale * 1.3 + time * 0.16);
return Math.atan2(b + c, a - c);
}
function seed(width: number, height: number, count: number) {
motes.length = 0;
for (let index = 0; index < count; index += 1) {
motes.push({
x: Math.random() * width,
y: Math.random() * height,
hue: 168 + Math.random() * 70,
life: Math.random(),
});
}
}
function step(mote: Mote, width: number, height: number, time: number) {
const angle = field(mote.x, mote.y, time);
mote.x += Math.cos(angle) * 2.4;
mote.y += Math.sin(angle) * 2.4;
mote.life -= 0.004;
if (mote.life <= 0 || mote.x < -20 || mote.y < -20 || mote.x > width + 20 || mote.y > height + 20) {
mote.x = Math.random() * width;
mote.y = Math.random() * height;
mote.life = 0.6 + Math.random() * 0.4;
mote.hue = 168 + Math.random() * 80;
}
}
function startField() {
const canvas = canvasEl.value;
if (!canvas) return;
const context = canvas.getContext("2d");
if (!context) return;
const reduced = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
let width = 0;
let height = 0;
const fit = () => {
const ratio = Math.min(window.devicePixelRatio || 1, 2);
const nextWidth = Math.floor(canvas.clientWidth * ratio);
const nextHeight = Math.floor(canvas.clientHeight * ratio);
if (canvas.width === nextWidth && canvas.height === nextHeight) return;
canvas.width = nextWidth;
canvas.height = nextHeight;
width = nextWidth;
height = nextHeight;
seed(width, height, Math.min(900, Math.floor((width * height) / 2800)));
context.setTransform(1, 0, 0, 1, 0, 0);
};
const draw = (now: number) => {
if (!running) return;
fit();
const time = now * 0.001;
context.globalCompositeOperation = "source-over";
context.fillStyle = "rgba(4, 6, 12, 0.08)";
context.fillRect(0, 0, width, height);
context.globalCompositeOperation = "lighter";
context.lineWidth = 2.2;
for (const mote of motes) {
const fromX = mote.x;
const fromY = mote.y;
if (!reduced) step(mote, width, height, time);
else {
for (let warm = 0; warm < 24; warm += 1) step(mote, width, height, 4);
}
context.strokeStyle = `hsla(${mote.hue}, 100%, 70%, 0.9)`;
context.beginPath();
context.moveTo(fromX, fromY);
context.lineTo(mote.x, mote.y);
context.stroke();
}
context.globalCompositeOperation = "source-over";
if (reduced) return;
frame = requestAnimationFrame(draw);
};
running = true;
fit();
context.fillStyle = "#04060c";
context.fillRect(0, 0, width, height);
frame = requestAnimationFrame(draw);
}
async function copyUrl() {
copied.value = false;
@@ -125,25 +29,17 @@ async function copyUrl() {
copyFailed.value = false;
}, 2000);
}
onMounted(startField);
onUnmounted(() => {
running = false;
cancelAnimationFrame(frame);
window.clearTimeout(copiedTimer);
});
</script>
<template>
<main class="upgrade">
<canvas ref="canvasEl" class="field" aria-hidden="true"></canvas>
<section class="copy">
<section class="card">
<h1>旧版工具已失效</h1>
<p>因目标平台升级,旧版工具已失效,无法登录使用。新版工具已上线。</p>
<p>请复制下面的地址,打开浏览器,粘贴到地址栏后访问。</p>
<p ref="urlEl" class="url">{{ toolUrl }}</p>
<button type="button" class="copy-btn" @click="copyUrl">{{ copied ? "已复制" : "复制地址" }}</button>
<p v-if="copied" class="result ok">已复制。请到浏览器地址栏粘贴后访问。</p>
<button type="button" class="copy" @click="copyUrl">{{ copied ? "已复制" : "复制地址" }}</button>
<p v-if="copied" class="result">已复制。请到浏览器地址栏粘贴后访问。</p>
<p v-else-if="copyFailed" class="result miss">没有复制成功,地址已选中,请手动使用 CTRL+C 复制。</p>
</section>
</main>
@@ -154,78 +50,65 @@ onUnmounted(() => {
position: fixed;
inset: 0;
z-index: 20;
display: grid;
place-items: center;
padding: 32px 16px;
overflow: auto;
color: #f7fbff;
background: #04060c;
background: #bdbec0;
color: #1c1c1c;
font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.field {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
display: block;
}
.copy {
position: relative;
z-index: 1;
width: min(640px, calc(100% - 48px));
margin: 18vh auto 48px;
text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
.card {
width: min(460px, 100%);
padding: 28px 24px;
border: 1px solid #6e7073;
background: #f3f3f3;
}
h1 {
margin: 0 0 16px;
font-size: clamp(36px, 6vw, 64px);
line-height: 1.05;
font-weight: 700;
letter-spacing: -0.04em;
margin: 0 0 14px;
font-size: 22px;
font-weight: 650;
}
p {
margin: 0 0 10px;
max-width: 38rem;
color: rgba(247, 251, 255, 0.88);
font-size: 16px;
line-height: 1.7;
font-size: 15px;
}
.url {
margin: 22px 0 18px;
color: #fff;
font-size: clamp(18px, 2.4vw, 28px);
margin: 16px 0;
padding: 10px 12px;
border: 1px solid #8a8d90;
background: #fff;
color: #1a3f73;
word-break: break-all;
user-select: all;
}
.copy-btn {
height: 42px;
padding: 0 18px;
border: 1px solid rgba(186, 230, 255, 0.75);
border-radius: 999px;
background: rgba(6, 12, 20, 0.4);
color: #f3fbff;
.copy {
height: 34px;
padding: 0 16px;
border: 1px solid #6e7073;
background: #e6e6e6;
color: #1c1c1c;
font: inherit;
font-size: 15px;
font-size: 14px;
cursor: pointer;
}
.copy-btn:hover {
background: rgba(120, 210, 255, 0.16);
.copy:hover {
background: #f7f7f7;
}
.result {
margin-top: 14px;
font-size: 14px;
}
.ok {
color: #d9fff1;
margin-top: 12px;
color: #1d5c32;
}
.miss {
color: #ffe1c2;
color: #8a3b12;
}
</style>