Commit 35844d94 by liimin

试试增量更新

1 parent b0aaf81e
Pipeline #436 for 35844d94 failed in 0 seconds
{
"name": "@uj/web-shell",
"version": "0.0.1",
"version": "0.0.2",
"private": true,
"type": "module",
"scripts": {
......
......@@ -2,13 +2,15 @@
* @Author: liimin 17653212@qq.com
* @Date: 2026-11-13 10:00:00
* @LastEditors: liimin 17653212@qq.com
* @LastEditTime: 2026-11-15 12:25:00
* @LastEditTime: 2026-11-15 15:57:00
* @FilePath: \uj-store\src\pages\Login\components\LoginCoverage.tsx
* @Description: 登录页左栏下半部分背景:门店覆盖点阵,纯装饰、无任何伪造数据。
* 以「俯瞰 + 景深」呈现——画面是一张向远处地平线收敛的地面网络:
* - 透视投影:远点(深度 z→0)压向顶部地平线、横向收窄;近点( z→1)铺满底部、横向铺开;
* - 景深:近点更大/更亮/清晰,远点更小/更淡/带散景模糊(bokeh);
* - 叠加右深左淡(右侧原小方格处更聚焦),顶部渐隐融入墙面,并有两条极淡消失点引导线立住纵深。
* @Description: 登录页左栏下半部分背景:门店覆盖网络「俯瞰指挥图」,纯装饰、无任何伪造数据。
* 以「俯瞰 + 景深 + 发光网络」呈现冲击感:
* - 透视发光地面网格:经线收向地平线消失点、纬线近宽远窄,一眼读出「俯瞰地面」;
* - 枢纽节点网状互联(就近相连)+ 霓虹辉光(bloom),形成真实的规模化门店网络;
* - 一个核心枢纽(最近最大)带呼吸光晕,作为视觉焦点;
* - 景深:近点更大/更亮/近白核且清晰,远点更小/更淡/带散景虚化(bokeh);
* - 地平线光带 + 右侧聚焦光晕营造氛围;右深左淡、顶部渐隐融入墙面;右上留白楔形补星点。
* 实现:固定 600×340 横向 viewBox,CSS 用 width:100%/height:auto 由浏览器按比例算高度,
* 因此无论登录栏多宽多高都保持原始比例——不拉伸、不裁切、左右到边、贴底。
*/
......@@ -16,12 +18,11 @@ import { useState } from 'react';
const W = 600;
const H = 340;
const HORIZON = 64; // 远处地平线 y(远点在此收敛)
const NEAR = H - 22; // 近处地面 y(近点铺到底部)
const HORIZON = 60; // 远处地平线 y(远点在此收敛)
const NEAR = H - 20; // 近处地面 y(近点铺到底部)
const Z_FAR = 0.12; // 最远深度
const VP = { x: W / 2, y: HORIZON - 14 }; // 消失点(略高于地平线)
// 固定种子伪随机:装饰用,保证网点分布一致(非真实门店数据)
// 固定种子伪随机:装饰用,保证分布一致(非真实门店数据)
function makeRand(seed: number) {
let s = seed % 233280;
return () => {
......@@ -30,19 +31,45 @@ function makeRand(seed: number) {
};
}
const rand = makeRand(91);
const srand = makeRand(47);
const lerp = (a: number, b: number, t: number) => a + (b - a) * t;
const clamp = (v: number, lo: number, hi: number) => Math.max(lo, Math.min(hi, v));
// 世界坐标:z=深度(0远..1近),lx=横向(-1..1);投影到屏幕形成收敛透视
type WDot = { z: number; lx: number; hub: boolean; jx: number; jy: number };
const WDOTS: WDot[] = Array.from({ length: 92 }, (_, i) => ({
// 枢纽节点:数量固定,构成「被连线连起来的」网络骨架(保留密度,是图的视觉主体)
const WHUBS: WDot[] = Array.from({ length: 13 }, () => ({
z: Z_FAR + rand() * (1 - Z_FAR),
lx: rand() * 2 - 1,
hub: i % 8 === 0,
jx: (rand() - 0.5) * 0.12,
jy: (rand() - 0.5) * 0.06,
hub: true,
jx: (rand() - 0.5) * 0.1,
jy: (rand() - 0.5) * 0.05,
}));
// 普通网点:沿透视格点散落(带轻微抖动),成排向远处地平线收敛——
// 用「点的结构」承载俯视感,不画网格线。数量适中、远少于最初 82 个。
const COLS = [-0.82, -0.6, -0.38, -0.16, 0.16, 0.38, 0.6, 0.82];
const ROWS_PP = [0.16, 0.3, 0.44, 0.58, 0.7, 0.81, 0.9];
const WFIELD: WDot[] = [];
for (const pp of ROWS_PP) {
const p = Math.pow(pp, 1 / 0.82); // 透视进度 → 深度
const z = Z_FAR + p * (1 - Z_FAR);
for (const cx of COLS) {
if (rand() < 0.78) {
WFIELD.push({
z,
lx: clamp(cx + (rand() - 0.5) * 0.1, -1, 1),
hub: false,
jx: (rand() - 0.5) * 0.06,
jy: (rand() - 0.5) * 0.04,
});
}
}
}
const WDOTS: WDot[] = [...WHUBS, ...WFIELD];
// 投影:世界坐标 → 屏幕坐标,含透视收敛
function project(d: WDot) {
const p = (d.z - Z_FAR) / (1 - Z_FAR); // 0 远 .. 1 近
......@@ -63,54 +90,78 @@ interface PNode {
}
const NODES: PNode[] = WDOTS.map((d) => {
const { x, y, p } = project(d);
const r = lerp(0.7, 2.7, p) * (d.hub ? 1.5 : 1);
const depthOp = lerp(0.14, 0.92, p); // 远处更淡
const r = lerp(0.8, 3.1, p) * (d.hub ? 1.45 : 1);
const depthOp = lerp(0.16, 0.96, p); // 远处更淡
const xOp = 0.5 + (x / W) * 0.75; // 左侧更淡(右深左淡)
const op = clamp(depthOp * xOp + (d.hub ? 0.1 : 0), 0.07, 0.92);
const op = clamp(depthOp * xOp + (d.hub ? 0.12 : 0), 0.08, 0.96);
return { x, y, p, r, op, hub: d.hub };
});
// 枢纽连线:按屏幕 y 排序后相邻连成网(屏幕空间连线,端点各自带景深透明度)
// 枢纽节点 + 就近互联网格(每个枢纽连最近的 2 个,去重成网)
const HUBS = NODES.filter((n) => n.hub).sort((a, b) => a.y - b.y);
const SEGMENTS = HUBS.slice(1).map((h, i) => {
const a = HUBS[i];
const midP = (a.p + h.p) / 2;
return { a, b: h, op: clamp(0.06 + midP * 0.34, 0.05, 0.55) };
});
const MESH: { a: PNode; b: PNode; op: number }[] = (() => {
const used = new Set<string>();
const out: { a: PNode; b: PNode; op: number }[] = [];
for (let i = 0; i < HUBS.length; i++) {
const others = HUBS.map((h, idx) => ({
idx,
d: Math.hypot(h.x - HUBS[i].x, h.y - HUBS[i].y),
}))
.filter((o) => o.idx !== i)
.sort((a, b) => a.d - b.d)
.slice(0, 2);
for (const o of others) {
const key = i < o.idx ? `${i}-${o.idx}` : `${o.idx}-${i}`;
if (used.has(key)) continue;
used.add(key);
const a = HUBS[i];
const b = HUBS[o.idx];
out.push({ a, b, op: clamp(0.12 + ((a.p + b.p) / 2) * 0.32, 0.1, 0.6) });
}
}
return out;
})();
// 右上留白楔形区的点缀星点:只落在透视扇面右缘之外,填补空三角;极淡、静态为主、少数微闪
const srand = makeRand(47);
const STARS = Array.from({ length: 9 }, () => {
const sy = lerp(HORIZON + 8, 220, srand());
// 核心枢纽:取最近的枢纽作视觉焦点
const CORE = HUBS.reduce((m, h) => (h.p > m.p ? h : m), HUBS[0]);
// 透视网格线已按需求移除;俯视感改由 WFIELD 的透视格点(成排向地平线收敛)承载。
// 右上留白楔形区的点缀星点:只落在透视扇面右缘之外,填补空三角;极淡、少数微闪
const STARS = Array.from({ length: 10 }, () => {
const sy = lerp(HORIZON + 8, 222, srand());
const pp = Math.pow(clamp((sy - HORIZON) / (NEAR - HORIZON), 0, 1), 1 / 0.82);
const edge = W / 2 + lerp(34, 296, pp); // 扇面在该高度处的右缘 x
const edge = W / 2 + lerp(34, 296, pp);
const x = clamp(edge + srand() * (W - edge - 16), edge + 4, W - 8);
const depthDim = lerp(0.5, 1, (sy - HORIZON) / (220 - HORIZON)); // 越靠地平线越淡
const op = clamp((0.18 + (x / W) * 0.28) * depthDim, 0.14, 0.42);
return { x, y: sy, r: 0.6 + srand() * 0.8, op, tw: srand() < 0.35 };
const depthDim = lerp(0.5, 1, (sy - HORIZON) / (222 - HORIZON));
const op = clamp((0.2 + (x / W) * 0.3) * depthDim, 0.16, 0.46);
return { x, y: sy, r: 0.6 + srand() * 0.9, op, tw: srand() < 0.4 };
});
// 景深分层(远→近):越远模糊越强
const LAYER_BLUR = ['url(#covBlurFar)', 'url(#covBlurMid)', undefined as string | undefined];
export function LoginCoverage() {
// 脉冲点:随机位置,每次挂载重新随机(刷新/重进登录页都变);偏向较深的右侧、且落在近-中景
// 脉冲点:随机位置,每次挂载重新随机(刷新/重进登录页都变);偏右侧、近-中景
const [pulse] = useState(() => {
const z = Z_FAR + (1 - Z_FAR) * (0.45 + Math.random() * 0.5);
const lx = 0.15 + Math.random() * 0.8; // 偏右
const lx = 0.15 + Math.random() * 0.8;
const { x, y } = project({ z, lx, hub: false, jx: 0, jy: 0 });
return { x, y };
});
const fillOf = (n: PNode) =>
n.hub ? '#E4EDFF' : n.p > 0.6 ? '#C6D8FF' : '#9DBBFF';
const renderDot = (n: PNode, i: number) => {
const layer = n.p < 0.4 ? 0 : n.p < 0.72 ? 1 : 2;
const fill = n.hub ? '#CFDDFF' : '#9DBBFF';
const fill = fillOf(n);
if (n.hub) {
return (
<g key={i} filter={LAYER_BLUR[layer]}>
<circle cx={n.x} cy={n.y} r={n.r * 2.8} fill="url(#ujCovGlow)" />
<circle cx={n.x} cy={n.y} r={n.r} fill={fill} fillOpacity={Math.min(0.95, n.op + 0.15)} />
<circle cx={n.x} cy={n.y} r={n.r + 1.8} fill="none" stroke="#5B8DEF" strokeOpacity={Math.min(0.6, n.op)} strokeWidth={0.7} />
<circle cx={n.x} cy={n.y} r={n.r * 3} fill="url(#ujCovGlow)" />
<circle cx={n.x} cy={n.y} r={n.r} fill={fill} fillOpacity={Math.min(0.98, n.op + 0.12)} />
<circle cx={n.x} cy={n.y} r={n.r + 2} fill="none" stroke="#5B8DEF" strokeOpacity={Math.min(0.7, n.op)} strokeWidth={0.8} />
</g>
);
}
......@@ -131,45 +182,59 @@ export function LoginCoverage() {
<div className="uj-login-coverage" aria-hidden="true">
<svg viewBox={`0 0 ${W} ${H}`} width="100%" height="auto" preserveAspectRatio="xMidYMax meet">
<defs>
{/* 右侧聚焦光晕:原小方格处的「更深」基调,品牌蓝向心渐隐 */}
{/* 右侧聚焦光晕:品牌蓝向心渐隐,强化原小方格处的「更深」基调 */}
<radialGradient id="ujCovFocus" cx="50%" cy="50%" r="50%">
<stop offset="0%" stopColor="#3A6BF0" stopOpacity="0.32" />
<stop offset="0%" stopColor="#3A6BF0" stopOpacity="0.4" />
<stop offset="100%" stopColor="#3A6BF0" stopOpacity="0" />
</radialGradient>
{/* 枢纽光晕 */}
{/* 枢纽 / 核心光晕 */}
<radialGradient id="ujCovGlow" cx="50%" cy="50%" r="50%">
<stop offset="0%" stopColor="#5B8DEF" stopOpacity="0.6" />
<stop offset="0%" stopColor="#5B8DEF" stopOpacity="0.7" />
<stop offset="100%" stopColor="#5B8DEF" stopOpacity="0" />
</radialGradient>
{/* 核心枢纽大光晕 */}
<radialGradient id="ujCovCore" cx="50%" cy="50%" r="50%">
<stop offset="0%" stopColor="#7FA8FF" stopOpacity="0.55" />
<stop offset="100%" stopColor="#7FA8FF" stopOpacity="0" />
</radialGradient>
{/* 近处地面受光:底部(近)微亮,强化俯瞰纵深 */}
<linearGradient id="ujCovGround" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stopColor="#0A1430" stopOpacity="0" />
<stop offset="100%" stopColor="#2A4A9E" stopOpacity="0.22" />
<stop offset="100%" stopColor="#2A4A9E" stopOpacity="0.26" />
</linearGradient>
{/* 地平线光带:远处一抹冷光,立住纵深尽头 */}
<linearGradient id="ujCovHorizon" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stopColor="#5B8DEF" stopOpacity="0" />
<stop offset="50%" stopColor="#7FA8F5" stopOpacity="0.3" />
<stop offset="100%" stopColor="#5B8DEF" stopOpacity="0" />
</linearGradient>
{/* 景深散景模糊:极轻,仅作纵深暗示,避免发糊 */}
<filter id="covBlurFar" x="-30%" y="-30%" width="160%" height="160%">
<feGaussianBlur stdDeviation="1.3" />
<feGaussianBlur stdDeviation="1" />
</filter>
<filter id="covBlurMid" x="-30%" y="-30%" width="160%" height="160%">
<feGaussianBlur stdDeviation="0.6" />
<feGaussianBlur stdDeviation="0.5" />
</filter>
{/* 网络霓虹辉光:连线/核心的 bloom */}
<filter id="covBloom" x="-60%" y="-60%" width="220%" height="220%">
<feGaussianBlur stdDeviation="2.4" result="b" />
<feMerge>
<feMergeNode in="b" />
<feMergeNode in="SourceGraphic" />
</feMerge>
</filter>
</defs>
{/* 近处地面受光(最底) */}
<rect x={0} y={0} width={W} height={H} fill="url(#ujCovGround)" />
{/* 右侧聚焦区:让原小方格处颜色稍深 */}
{/* 右侧聚焦区 */}
<ellipse cx={W * 0.82} cy={H * 0.55} rx={W * 0.52} ry={H * 0.62} fill="url(#ujCovFocus)" />
{/* 极淡消失点引导线:从底部两角收向地平线消失点,立住俯瞰纵深;近清晰、远虚 */}
<g stroke="#7FA8F5" fill="none" strokeOpacity={0.1}>
<line x1={W * 0.04} y1={NEAR} x2={VP.x} y2={VP.y} strokeWidth={0.8} />
<line x1={W * 0.96} y1={NEAR} x2={VP.x} y2={VP.y} strokeWidth={0.8} />
<line x1={W * 0.32} y1={NEAR} x2={VP.x} y2={VP.y} strokeWidth={0.5} strokeOpacity={0.06} />
<line x1={W * 0.68} y1={NEAR} x2={VP.x} y2={VP.y} strokeWidth={0.5} strokeOpacity={0.06} />
</g>
{/* 地平线光带 */}
<rect x={0} y={HORIZON - 16} width={W} height={32} fill="url(#ujCovHorizon)" />
{/* 枢纽连线(远处更虚,给一层中等模糊) */}
<g fill="none" stroke="#5B8DEF" strokeWidth={0.8} strokeDasharray="2 3" filter="url(#covBlurMid)">
{SEGMENTS.map((s, i) => (
{/* 枢纽就近互联网格(霓虹辉光) */}
<g fill="none" stroke="#6FA0FF" strokeWidth={0.9} strokeDasharray="2.4 3" filter="url(#covBloom)">
{MESH.map((s, i) => (
<line key={i} x1={s.a.x} y1={s.a.y} x2={s.b.x} y2={s.b.y} strokeOpacity={s.op} />
))}
</g>
......@@ -177,6 +242,14 @@ export function LoginCoverage() {
{/* 网点:按景深分三层(远→近)渲染 */}
{NODES.map((n, i) => renderDot(n, i))}
{/* 核心枢纽:呼吸光晕 + 大光环,作为视觉焦点 */}
<g>
<circle className="uj-cov-core" cx={CORE.x} cy={CORE.y} r={CORE.r * 6} fill="url(#ujCovCore)" />
<circle cx={CORE.x} cy={CORE.y} r={CORE.r * 4.2} fill="url(#ujCovGlow)" />
<circle cx={CORE.x} cy={CORE.y} r={CORE.r * 1.2} fill="#EAF1FF" fillOpacity={0.98} />
<circle cx={CORE.x} cy={CORE.y} r={CORE.r * 2.4} fill="none" stroke="#8FB4FF" strokeOpacity={0.8} strokeWidth={1} />
</g>
{/* 右上空白楔形区的点缀星点:填补透视扇面右缘之外的留白,极淡、少数微闪 */}
{STARS.map((s, i) => (
<circle
......@@ -184,7 +257,7 @@ export function LoginCoverage() {
cx={s.x}
cy={s.y}
r={s.r}
fill="#AFC8FF"
fill="#Bcd4FF"
fillOpacity={s.op}
className={s.tw ? 'uj-cov-star-tw' : undefined}
/>
......@@ -192,8 +265,8 @@ export function LoginCoverage() {
{/* 单个活跃节点:光晕扩散(雷达 ping),鲜艳青绿突出于淡蓝网点;始终清晰不受景深模糊 */}
<g>
<circle cx={pulse.x} cy={pulse.y} r={2.8} fill="#1FE0C8" style={{ filter: 'drop-shadow(0 0 4px #1FE0C8)' }} />
<circle className="uj-cov-pulse" cx={pulse.x} cy={pulse.y} r={3} fill="none" stroke="#2DE2C4" strokeWidth={1} style={{ animationDelay: '0s' }} />
<circle cx={pulse.x} cy={pulse.y} r={3.2} fill="#1FE0C8" style={{ filter: 'drop-shadow(0 0 6px #1FE0C8)' }} />
<circle className="uj-cov-pulse" cx={pulse.x} cy={pulse.y} r={3.4} fill="none" stroke="#2DE2C4" strokeWidth={1.2} style={{ animationDelay: '0s' }} />
</g>
</svg>
</div>
......
......@@ -169,6 +169,28 @@
animation: none;
}
}
/* 核心枢纽的呼吸光晕:缓慢明暗+轻微缩放,作为整图的视觉焦点;尊重 reduced-motion */
@keyframes cov-core {
0%,
100% {
opacity: 0.55;
transform: scale(1);
}
50% {
opacity: 0.95;
transform: scale(1.12);
}
}
.uj-cov-core {
transform-box: fill-box;
transform-origin: center;
animation: cov-core 4.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
.uj-cov-core {
animation: none;
}
}
/* ---- 底部主张区(主张标题) ---- */
/* margin-top:auto 把 brand+greet 顶到上方、hero+foot 整体下沉到底部,中部留白 */
.uj-login-hero {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!