SVG动画案例库
浏览精选的SVG动画案例
移开即停止播放
'use client';
import React, { useState, useEffect, useRef, useMemo } from 'react';
// -----------------------------------------------------------------------------
// Constants & Config
// -----------------------------------------------------------------------------
const VIEW_WIDTH = 1200;
const VIEW_HEIGHT = 600;
const BG_COLOR = '#0f172a'; // Slate-900
const NGINX_GREEN = '#00ac47';
const ACCENT_BLUE = '#38bdf8';
const SERVER_COLOR = '#1e293b';
const TEXT_COLOR = '#e2e8f0';
// Server Confi
nginx 负载均衡
移开即停止播放
'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 的运行流程, 前端后端函数调用, 中间层动画, 使用
移开即停止播放
```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樹的動畫
移开即停止播放
'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、内存、硬盘)协同工作
移开即停止播放
'use client';
import React, { useState, useEffect, useRef } from 'react';
const VIEW_WIDTH = 1000;
const VIEW_HEIGHT = 600;
const BOX_SIZE = 50;
const GAP = 10;
const START_X = 50;
const TEXT_Y = 180;
const PATTERN_Y = 300;
const NEXT_TABLE_Y = 480;
// Theme Colors
const COLORS = {
bg: '#0f172a',
primary: '#38bdf8', // Light Blue
accent: '#f472b6', // Pink
success: '#4ade80', // Green
warning: '#fbbf24', // Amber
error: '#fb7185', // Red
text: '#e2e8f0', // Sla
模拟一个KMP算法查找过程
广告
Ads移开即停止播放
```javascript
'use client';
import React, { useState, useEffect, useRef, useMemo } from 'react';
const VIEW_WIDTH = 1000;
const VIEW_HEIGHT = 600;
const COLOR_BG = "#0f172a";
const COLOR_TCP = "#38bdf8"; // Sky Blue
const COLOR_UDP = "#f472b6"; // Pink
const COLOR_TEXT = "#e2e8f0";
const COLOR_PACKET_LOSS = "#ef4444"; // Red
const COLOR_SUCCESS = "#22c55e"; // Green
// --- Utility Hooks & Components ---
const useAnimationFrame = (callback) => {
const requestRef = useRef();
const previous
TCP vs UDP 通信区别
移开即停止播放
'use client';
import React, { useState, useEffect, useRef, useMemo } from 'react';
// ----------------------------------------------------------------------
// CONFIGURATION & CONSTANTS
// ----------------------------------------------------------------------
const VIEW_WIDTH = 1000;
const VIEW_HEIGHT = 600;
const BACKGROUND_COLOR = '#0f172a';
const PRIMARY_COLOR = '#38bdf8'; // Sky blue
const ACTIVE_COLOR = '#f59e0b'; // Amber/Orange
const VISITED_COLOR = '#10b981'; // Emerald/Green
const LI
模拟一个二叉树的便利过程,节点在被访问时变色,背景使用深色网
移开即停止播放
'use client';
import React, { useState, useEffect, useMemo } from 'react';
const VIEW_WIDTH = 1200;
const VIEW_HEIGHT = 700;
const BG_COLOR = "#0f172a";
// 颜色定义
const COLORS = {
primary: "#38bdf8", // Sky blue
secondary: "#818cf8", // Indigo
accent: "#f472b6", // Pink
moe: "#34d399", // Emerald for Experts
grid: "#1e293b",
text: "#e2e8f0",
highlight: "#fbbf24"
};
export default function TransformerArchitectureView() {
// 动画阶段: 0=Input, 1=Encoder, 2=CrossAttn, 3=Decoder(MoE),
大模型transformers的执行流程图,增加多一个enc
移开即停止播放
'use client';
import React, { useState, useEffect, useRef, useMemo } from 'react';
const VIEW_WIDTH = 1000;
const VIEW_HEIGHT = 600;
const BACKGROUND_COLOR = '#e6e6e6';
// Utils
const randomRange = (min, max) => Math.random() * (max - min) + min;
// Types
type Particle = {
id: number;
x: number;
y: number;
type: 'image' | 'text' | 'audio';
color: string;
targetX: number;
targetY: number;
speed: number;
delay: number;
};
type Node = { x: number; y: number; layer: number };
生成一个训练模型所需要的完整的步骤。还有数据处理步骤,数据采
移开即停止播放
'use client';
import React, { useState, useEffect, useRef, useMemo } from 'react';
// 5x7 Pixel grids for digits 0-9
const DIGIT_PATTERNS = {
0: [
0,1,1,1,0,
1,0,0,0,1,
1,0,0,0,1,
1,0,0,0,1,
1,0,0,0,1,
1,0,0,0,1,
0,1,1,1,0
],
1: [
0,0,1,0,0,
0,1,1,0,0,
0,0,1,0,0,
0,0,1,0,0,
0,0,1,0,0,
0,0,1,0,0,
0,1,1,1,0
],
2: [
0,1,1,1,0,
1,0,0,0,1,
0,0,0,0,1,
0,0,0,1,0,
0,0,1,0,0,
0,1,0,0,0,
1,1,1,1,1
],
3: [