gsap+svg实现等高线变换动画效果代码
代码语言:html
所属分类:动画
代码描述:gsap+svg实现等高线变换动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
html {
height: 100%;
}
body {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
background: #00003C;
}
svg {
position: absolute;
transform-origin: center;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
path {
stroke-width: 2 !important;
transform: scale(0.5) translate(50%, 50%);
}
svg:nth-child(2) {
width: 80%;
height: 80%;
top: 10%;
left: 10%;
}
svg:nth-child(3) {
width: 60%;
height: 60%;
top: 20%;
left: 20%;
}
svg:nth-child(4) {
width: 40%;
height: 40%;
top: 30%;
left: 30%;
}
svg:nth-child(5) {
width: 20%;
height: 20%;
top: 40%;
left: 40%;
}
path {
stroke:
}
</style>
</head>
<body >
<div>
<svg width="100%" height="100%" viewBox="0 0 300 300" preserveAspectRatio="xMidYMid meet" fill="none" xmlns="http://www.w3.org/2000/svg" vector-effect="non-scaling-stroke">
<path d="M125.508 34.7733C134 33.7918 143.001 31.8349 152.075 29.7666C153.226 29.5043 154.378 29.2402 155.53 28.9761C163.482 27.1529 171.453 25.3254 179.213 24.0472C197.026 21.1132 213.386 21.141 225.478 30.4819C237.962 40.1257 241.929 57.7136 243.185 77.5984C243.734 86.2834 243.764 95.3278 243.793 104.245C243.797 105.5 243.801 106.752 243.807 108.001C243.852 118.101 243.991 127.95 245.005 136.727C245.666 142.441 246.482 148.008 247.278 153.445C248.689 163.07 250.04 172.285 250.36 181.177C250.858 195.01 248.835 207.81 240.653 219.614C221.045 247.902 189.827 267.93 152.951 .........完整代码请登录后点击上方下载按钮下载查看
















网友评论0