SVG动画案例库
浏览精选的SVG动画案例
移开即停止播放
import React, { useState, useEffect, useRef, useMemo, useCallback } from 'react';
// 动画组件:百米赛跑与速度公式演示
export default function SpeedDistanceTimeAnimation() {
// 画布尺寸
const WIDTH = 1200;
const HEIGHT = 700;
// 赛道配置
const TRACK_START_X = 100;
const TRACK_END_X = 1100;
const TRACK_LENGTH = TRACK_END_X - TRACK_START_X; // 1000px 代表 100m
const TRACK_Y_START = 300;
const LANE_HEIGHT = 80;
// 状态定义
const [phase, setPhase] = useState('idle'); // idle, countdown, running, finishe
百米赛跑开始了,运动员跑了一段时间后,观众说小柯跑得最快。制
移开即停止播放
```javascript
import React, { useState, useEffect, useRef, useMemo, useCallback } from 'react';
import {
MessageSquare,
Database,
Server,
Cpu,
Globe,
FileText,
Search,
Activity,
Zap,
CheckCircle,
X
} from 'lucide-react';
const WIDTH = 1200;
const HEIGHT = 700;
// 颜色定义
const COLORS = {
bg: '#0f172a',
primary: '#3b82f6', // 蓝色
mcp: '#06b6d4', // 青色
agent: '#8b5cf6', // 紫色
tool: '#f59e0b', // 琥珀色
success: '#10b981', // 绿色
text: '#e2e8f0',
tex
以下是专为SVG动画设计的结构化脚本,突出**分层架构**、
移开即停止播放
```javascript
import React, { useState, useEffect, useRef, useMemo, useCallback } from 'react';
// -----------------------------------------------------------------------------
// 配置常量
// -----------------------------------------------------------------------------
const WIDTH = 1200;
const HEIGHT = 700;
const COLORS = {
bg: '#0f172a', // 深蓝灰背景
grid: '#1e293b', // 网格线
primary: '#06b6d4', // 青色 (Cyan) - 主科技色
secondary: '#8b5cf6',// 紫色 (Violet) - 辅助色
accent: '#f43f5e', //
一个LOGO的出现效果动画,LOGO内容“Brian”
移开即停止播放
```javascript
'use client';
import React, { useState, useEffect, useMemo, useRef, useCallback, useLayoutEffect } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import * as Lucide from 'lucide-react';
import * as d3 from 'd3';
// -----------------------------------------------------------------------------
// Constants & Data
// -----------------------------------------------------------------------------
const LONG_MARCH_PATH = [
{ name: "瑞金", year: 1934, type: "depar
复刻原太平天国轨迹动画的所有形式,仅将事件替换为红军长征轨迹
移开即停止播放
import React, { useState, useEffect, useRef, useMemo, useCallback } from 'react';
// -----------------------------------------------------------------------------
// Constants & Config
// -----------------------------------------------------------------------------
const VIEW_WIDTH = 1200;
const VIEW_HEIGHT = 700;
const CENTER_X = VIEW_WIDTH / 2;
const CENTER_Y = VIEW_HEIGHT / 2;
const COLOR_BG = '#0f172a'; // Slate 900
const COLOR_PRIMARY = '#0ea5e9'; // Sky 500
const COLOR_SECONDARY = '#6366
做一个小熊的头像(描边),小象外围是扇形的扫描动画,从不完整
移开即停止播放
import React, { useState, useEffect, useRef, useMemo } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import { Cpu, Server, Layers, ArrowDown, Search, CheckCircle, Split } from 'lucide-react';
// 常量定义
const WIDTH = 1200;
const HEIGHT = 700;
const COL_WIDTH = 240;
const START_X = 120;
const ORDER_Y = 200;
// 颜色定义
const COLORS = {
bg: '#0f172a',
primary: '#3b82f6',
accent: '#f59e0b',
success: '#10b981',
danger: '#ef4444',
text: '#e2e8f0',
textDim: '#64748b',
假设当前伙伴系统中只有 order = 3 的空闲链表 fr
移开即停止播放
import React, { useState, useMemo } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import { Info, Globe, Mic, Volume2 } from 'lucide-react';
const VIEW_WIDTH = 1200;
const VIEW_HEIGHT = 700;
// ==========================================
// DATA DEFINITIONS
// ==========================================
// VOWEL DATA (Trapezoid coordinates: x: 0-100 (Front-Back), y: 0-100 (Close-Open))
// Normalized positions for the trapezoid shape
const VOWELS = [
{ ipa: 'i', x: 5, y
有没有详细的对比图( 国际音标梯形图)给我看一下,汉语所有的
移开即停止播放
import React, { useState, useEffect, useMemo, useRef } from 'react';
import { motion, useAnimation, useSpring, useTransform, useMotionValue } from 'framer-motion';
// -----------------------------------------------------------------------------
// Constants & Utils
// -----------------------------------------------------------------------------
const WIDTH = 1200;
const HEIGHT = 700;
const CARD_W = 320;
const CARD_H = 480; // 3:4 ratio approx (scaled for visual balance)
// Generate random part
创建一个基于SVG和CSS高级动画的HTML组件,模拟海盗王
广告
Ads移开即停止播放
import React, { useState, useEffect, useRef, useMemo } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import { Terminal, Zap, Database, ArrowRight, Activity } from 'lucide-react';
// --- Constants & Types ---
const WIDTH = 1200;
const HEIGHT = 700;
const COLORS = {
bg: '#0f172a',
grid: '#1e293b',
primary: '#38bdf8', // Cyan
secondary: '#f472b6', // Pink
accent: '#facc15', // Yellow
text: '#e2e8f0',
muted: '#475569',
stackBg: 'rgba(30, 41, 59, 0.5)',
};
t
中缀表达式转为后缀表达式的动图讲解
移开即停止播放
```javascript
import React, { useState, useEffect, useRef, useMemo, useCallback } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import { MapPin, Play, Pause, RotateCcw, Crosshair, ChevronRight, Activity, Database, Globe } from 'lucide-react';
import * as d3 from 'd3';
// ==========================================
// 1. 常量与配置
// ==========================================
const WIDTH = 1200;
const HEIGHT = 700;
const STEP_DURATION = 3500; // 每个事件停留时间
const TRANSITION_DURA
按时间顺序生成刘备一生足迹图,特出关键事件。背景用类似三国游
移开即停止播放
import React, { useState, useEffect, useMemo, useRef } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import { FileText, Trash2, HardDrive, RefreshCcw, AlertTriangle, Usb, CheckCircle2, XCircle } from 'lucide-react';
// Animation phases
const PHASE = {
IDLE: 0,
DELETING: 1,
DELETED_GHOST: 2,
USB_INSERT: 3,
OVERWRITING: 4,
LOST: 5,
};
const COLORS = {
bg: '#050505',
primary: '#facc15', // Yellow
secondary: '#f97316', // Orange
danger: '#ef4444', // Re