feat: Implement analysis job tracking with progress timeline and enhanced data source status management.
This commit is contained in:
@@ -16,8 +16,10 @@ export function HeroShader() {
|
||||
let animationFrameId: number;
|
||||
|
||||
const resize = () => {
|
||||
canvas.width = canvas.offsetWidth;
|
||||
canvas.height = canvas.offsetHeight;
|
||||
const dpr = window.devicePixelRatio || 1;
|
||||
canvas.width = canvas.offsetWidth * dpr;
|
||||
canvas.height = canvas.offsetHeight * dpr;
|
||||
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
||||
};
|
||||
resize();
|
||||
window.addEventListener("resize", resize);
|
||||
@@ -36,15 +38,25 @@ export function HeroShader() {
|
||||
|
||||
ctx.fillStyle = "rgba(255, 255, 255, 0.5)"; // stroke(w, 116) approx white with alpha
|
||||
|
||||
// Model space tuned for ~400x400 tweetcart output.
|
||||
const baseSize = 400;
|
||||
const scale = Math.min(canvas.width, canvas.height) / baseSize;
|
||||
|
||||
const canvasWidth = canvas.offsetWidth;
|
||||
const canvasHeight = canvas.offsetHeight;
|
||||
|
||||
// Center of drawing - positioned to the right and aligned with content
|
||||
const cx = canvas.width * 0.7;
|
||||
const cy = canvas.height * 0.4;
|
||||
const cx = canvasWidth * 0.7;
|
||||
const cy = canvasHeight * 0.52;
|
||||
|
||||
// Loop for points
|
||||
// for(t+=PI/90,i=1e4;i--;)a()
|
||||
t += Math.PI / 90;
|
||||
|
||||
for (let i = 10000; i > 0; i--) {
|
||||
const density = Math.max(1, scale);
|
||||
const pointCount = Math.min(18000, Math.floor(10000 * density));
|
||||
|
||||
for (let i = pointCount; i > 0; i--) {
|
||||
// y = i / 790
|
||||
let y = i / 790;
|
||||
|
||||
@@ -87,17 +99,17 @@ export function HeroShader() {
|
||||
const c = d / 4 - t / 2 + (i % 2) * 3;
|
||||
|
||||
// q = y * k / 5 * (2 + sin(d*2 + y - t*4)) + 80
|
||||
const q = y * k / 5 * (2 + Math.sin(d * 2 + y - t * 4)) + 300;
|
||||
const q = y * k / 5 * (2 + Math.sin(d * 2 + y - t * 4)) + 80;
|
||||
|
||||
// x = q * cos(c) + 200
|
||||
// y_out = q * sin(c) + d * 9 + 60
|
||||
// 200 and 60 are likely offsets for 400x400 canvas.
|
||||
// We should center it.
|
||||
// Original offsets assume a 400x400 canvas; map from model space to screen space.
|
||||
const modelX = q * Math.cos(c) + 200;
|
||||
const modelY = q * Math.sin(c) + d * 9 + 60;
|
||||
|
||||
const x = (q * Math.cos(c)) + cx;
|
||||
const y_out = (q * Math.sin(c) + d * 9) + cy;
|
||||
const x = cx + (modelX - 200) * scale;
|
||||
const y_out = cy + (modelY - 200) * scale;
|
||||
const pointSize = Math.min(2 * scale, 3.5);
|
||||
|
||||
ctx.fillRect(x, y_out, 2.5, 2.5);
|
||||
ctx.fillRect(x, y_out, pointSize, pointSize);
|
||||
}
|
||||
|
||||
animationFrameId = requestAnimationFrame(draw);
|
||||
|
||||
Reference in New Issue
Block a user