SVG动画案例库

浏览精选的SVG动画案例

移开即停止播放
'use client'; import React, { useState, useEffect, useRef, useMemo } from 'react'; const VIEW_WIDTH = 1000; const VIEW_HEIGHT = 600; const CENTER_X = VIEW_WIDTH / 2; const CENTER_Y = VIEW_HEIGHT / 2; // 粒子数量 const PARTICLE_COUNT = 150; // 向量场网格密度 const GRID_COLS = 20; const GRID_ROWS = 12; // 辅助函数:生成高斯分布噪声 const randomNormal = (mean: number, std: number) => { let u = 0, v = 0; while (u === 0) u = Math.random(); while (v === 0) v = Math.random(); return mean + std * Math.sqrt(-2.0 * M

flow matching 原理的动画

移开即停止播放
'use client'; import React, { useState, useEffect, useMemo, useRef } from 'react'; const VIEW_WIDTH = 1000; const VIEW_HEIGHT = 600; const PADDING = 60; const DRAW_AREA_W = VIEW_WIDTH - PADDING * 2; const DRAW_AREA_H = VIEW_HEIGHT - PADDING * 2; // 蒙德里安配色方案 (调整为更具科技感的色调) const COLORS = [ '#f8fafc', // White/Light Grey (Dominant) '#f8fafc', '#f8fafc', '#ef4444', // Tech Red '#3b82f6', // Tech Blue '#eab308', // Tech Yellow '#1e293b', // Dark Grey block ]; // 递归分割算法生成格子 type Blo

我想创造蒙德里安的方格画的随机动态图

移开即停止播放
'use client'; import React, { useState, useEffect, useMemo } from 'react'; const VIEW_WIDTH = 1000; const VIEW_HEIGHT = 600; // 颜色定义 const COLORS = { bg: '#0f172a', client: '#3b82f6', // Blue server: '#10b981', // Green network: '#f59e0b', // Amber text: '#f8fafc', textDim: '#94a3b8', code: '#a5b4fc', binary: '#6366f1' }; export default function RPCAnimation() { const [phase, setPhase] = useState('IDLE'); // IDLE, CALL, SERIALIZE_REQ, SEND_REQ, PROCESS, SERIALIZE_RES, SEND_

rpc 的运行流程, 前端后端函数调用, 中间层动画, 使用

移开即停止播放
```javascript 'use client'; import React, { useState, useEffect, useMemo, useRef } from 'react'; // 视图与布局常量 const VIEW_WIDTH = 1000; const VIEW_HEIGHT = 600; const CENTER_Y = VIEW_HEIGHT / 2; const OPTICAL_AXIS_Y = CENTER_Y; // 组件位置定义 const POS_SUBJECT = 120; const POS_LENS_GROUP = 450; const POS_SENSOR = 750; const POS_ISP = 880; const POS_SCREEN = 960; // 屏幕边缘 // 颜色定义(适配 #e4e6ec 背景) const COLORS = { bg: '#e4e6ec', grid: '#cbd5e1', text: '#475569', textLight: '#94a3b8', primary: '

生成相机拍照的成像原画

移开即停止播放
```tsx 'use client'; import React, { useState, useEffect, useRef, useMemo } from 'react'; // ----------------------------------------------------------------------------- // CONFIGURATION & CONSTANTS // ----------------------------------------------------------------------------- const VIEW_WIDTH = 1200; const VIEW_HEIGHT = 675; const BG_COLOR = "#0f172a"; // Slate 900 // Palette const COLORS = { bg: "#0f172a", grid: "#1e293b", text: "#94a3b8", textLight: "#f1f5f9", cyan: "#06b6d4",

comfyui生成影片的邏輯原理動畫

移开即停止播放
```javascript 'use client'; import React, { useState, useEffect, useRef, useMemo } from 'react'; const VIEW_WIDTH = 1000; const VIEW_HEIGHT = 600; const BG_COLOR = '#0f172a'; const ACCENT_COLOR = '#38bdf8'; // Sky 400 const TEXT_COLOR = '#e2e8f0'; // Slate 200 const CODE_BG = '#1e293b'; // Slate 800 // 模拟 DOM 节点数据 const INITIAL_NODES = [ { id: 'root', label: 'document', type: 'obj', x: 500, y: 60, parent: null }, { id: 'html', label: 'html', type: 'tag', x: 500, y: 130, parent: 'root' },

生成一個javascript操作dom樹的動畫

移开即停止播放
```javascript 'use client'; import React, { useState, useEffect, useRef } from 'react'; const VIEW_WIDTH = 1000; const VIEW_HEIGHT = 600; // 颜色定义 - 科技感配色 const COLORS = { bg: '#0f172a', // 背景色 primary: '#38bdf8', // 主梯形颜色 (天蓝) secondary: '#a78bfa', // 复制梯形颜色 (紫) accent: '#facc15', // 强调色 (黄) text: '#e2e8f0', // 文本颜色 grid: '#1e293b', // 网格线 dim: '#475569', // 暗淡色 }; export default function TrapezoidAreaProof() { const [step, setStep] = useState(0);

我是小学数学教师,我要做一个梯形面积的证明过程,帮我输出。简

移开即停止播放
'use client'; import React, { useState, useEffect, useMemo } from 'react'; const VIEW_WIDTH = 1000; const VIEW_HEIGHT = 600; // 硬件位置定义 const POS = { SSD: { x: 150, y: 450, w: 160, h: 80 }, RAM: { x: 500, y: 300, w: 180, h: 60 }, CPU: { x: 250, y: 100, w: 140, h: 140 }, GPU: { x: 750, y: 100, w: 200, h: 100 }, }; // 动画阶段定义 type Phase = 'IDLE' | 'SSD_READ' | 'SSD_TO_RAM' | 'RAM_PROCESS' | 'RAM_DISTRIBUTE' | 'PROCESSING' | 'COMPLETE'; export default function HardwareSystemAnimation() {

制作一个演示计算机硬件(CPU、GPU、内存、硬盘)协同工作

广告

Ads
移开即停止播放
'use client'; import React, { useState, useEffect, useRef, useMemo } from 'react'; // ========================================== // 常量与配置 // ========================================== const VIEW_WIDTH = 1200; const VIEW_HEIGHT = 600; const BG_COLOR = '#7b92c6'; const DISK_COLORS = ['#FF6B6B', '#FFD93D', '#6BCB77', '#4D96FF', '#9D4EDD']; const DISK_COUNT = 4; // 碟子数量 const ANIMATION_SPEED = 1.5; // 速度系数 // 贝塞尔缓动函数 const easeInOutCubic = (t: number) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2

作一個和河內塔遞回解析的動畫

移开即停止播放
```tsx 'use client'; import React, { useState, useEffect, useRef, useMemo } from 'react'; const VIEW_WIDTH = 1000; const VIEW_HEIGHT = 600; const CENTER_X = VIEW_WIDTH / 2; const CENTER_Y = VIEW_HEIGHT / 2; const RADIUS = 200; const BG_COLOR = "#0f172a"; // 辅助函数:计算正n边形的顶点坐标 const getPolygonPoints = (n: number, r: number, rotationOffset = -Math.PI / 2) => { const points = []; for (let i = 0; i < n; i++) { const theta = (i / n) * 2 * Math.PI + rotationOffset; points.push({ x:

割圆术如何计算圆周长

移开即停止播放
import React, { useState, useEffect, useMemo } from 'react'; const VIEW_WIDTH = 1000; const VIEW_HEIGHT = 600; const CAR_WIDTH = 220; const CAR_LENGTH = 440; export default function AutoSafetyResponse() { const [phase, setPhase] = useState(0); // 0: Cruising (L3 Scanning) // 1: Impact Detected (Red Alert) // 2: Hazards On (Blinking) // 3: Unlock Doors // 4: Open Windows const [logs, setLogs] = useState<string[]>([]); useEffect(() => { let timeouts: NodeJS.Timeout[] = [

L3自动驾驶过程中发生事故,车辆能双闪预警、自动解锁车门、打