-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
179 lines (163 loc) · 4.64 KB
/
Copy pathindex.html
File metadata and controls
179 lines (163 loc) · 4.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Web Animation 探索 - SVG 动画</title>
<style>
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
height: 100%;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
Oxygen, Ubuntu, Cantarell, sans-serif;
}
body {
background: #f5f5f5;
display: flex;
}
/* 左侧动画演示区域 */
.left-panel {
flex: 1;
overflow-y: auto;
padding: 20px;
max-width: 60%;
}
/* 右侧控制面板 */
.right-panel {
width: 40%;
background: rgba(0, 0, 0, 0.9);
border-left: 1px solid rgba(255, 255, 255, 0.1);
overflow-y: auto;
position: relative;
}
.demo-section {
margin-bottom: 40px;
padding: 20px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
cursor: pointer;
transition: all 0.3s;
border: 2px solid transparent;
}
.demo-section:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
transform: translateY(-2px);
}
.demo-section.active {
border: 2px solid #4caf50;
background: #f9fff7;
}
h2 {
margin-top: 0;
margin-bottom: 10px;
}
.demo-content {
text-align: center;
}
</style>
</head>
<body>
<!-- 左侧:动画演示 -->
<div class="left-panel">
<!-- 图片动画 -->
<div class="demo-section" data-animation="reveal">
<h2>📸 图片裁剪动画</h2>
<div class="demo-content">
<div id="target">
<img
src="https://dev-frtc.changyan.com/bubbty-saber/success.png"
alt="示例图片"
id="erasable-image"
style="width: 200px; height: 200px"
/>
</div>
</div>
</div>
<!-- SVG 矩形动画 -->
<div class="demo-section" data-animation="svg-rect">
<h2>🎨 SVG 矩形→圆形</h2>
<div class="demo-content">
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<rect
id="svg-rect"
x="10"
y="10"
width="180"
height="180"
fill="#4CAF50"
rx="0"
ry="0"
/>
</svg>
</div>
</div>
<!-- SVG 路径动画 -->
<div class="demo-section" data-animation="svg-path">
<h2>✨ SVG 路径描边</h2>
<div class="demo-content">
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<path
id="svg-path"
d="M 50 50 L 150 50 L 150 150 L 50 150 Z"
fill="none"
stroke="#FF9800"
stroke-width="2"
stroke-dasharray="400"
stroke-dashoffset="400"
/>
</svg>
</div>
</div>
<!-- SVG 圆形动画 -->
<div class="demo-section" data-animation="svg-circle">
<h2>⭕ SVG 圆形放大</h2>
<div class="demo-content">
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<circle id="svg-circle" cx="100" cy="100" r="10" fill="#2196F3" />
</svg>
</div>
</div>
<!-- SVG CSS 属性动画 -->
<div class="demo-section" data-animation="svg-css">
<h2>🔄 SVG CSS 属性</h2>
<div class="demo-content">
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<rect
id="svg-css-rect"
x="50"
y="50"
width="100"
height="100"
fill="#9C27B0"
/>
</svg>
</div>
</div>
<!-- SVG Transform 动画 -->
<div class="demo-section" data-animation="svg-transform">
<h2>🌀 SVG Transform 变形</h2>
<div class="demo-content">
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<rect
id="svg-transform-rect"
x="75"
y="75"
width="50"
height="50"
fill="#E91E63"
/>
</svg>
</div>
</div>
</div>
<!-- 右侧:控制面板容器 -->
<div class="right-panel" id="control-panel-container"></div>
<script type="module" src="./main.js"></script>
</body>
</html>