gsap+MotionPathPlugin实现小球沿路径出洞入洞动画效果代码

代码语言:html

所属分类:动画

代码描述:gsap+MotionPathPlugin实现小球沿路径出洞入洞动画效果代码

代码标签: gsap MotionPathPlugin 小球 沿 路径 出洞 入洞 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  


  
  
<style>
body,
html {
  height: 90vh;
}

body {
  margin: 0;
}

.spacer {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #efefef;
  font-family: sans-serif;
  font-size: 10vw;
}

.demoWrapper {
  opacity: 0;
  width: 100%;
  min-width: 375px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.demo {
  border: 1px solid #333;
}

h2 {
  color: #333;
  font-size: clamp(18px, 3vw, 30px);
  font-family: Arial, sans-serif;
}
</style>


  
</head>

<body >
  <div class="demoWrapper">
	<h2>MotionPath Infinite Followers</h2>
	<svg viewBox="0 100 500 300" xmlns="http://www.w3.org/2000/svg" xmlns:bx="https://boxy-svg.com">
		<defs>
			<radialGradient gradientUnits="userSpaceOnUse" cx="159.2899" cy="67.8919" r="18.3749" id="gradient-0" gradientTransform="matrix(1.1831563, 1.14812218, -1.26716109, 1.30582767, 55.75520113, -206.24885464)">
				<stop offset="0" style="stop-color: rgb(243, 93, 93);"></stop>
				<stop offset="1" style="stop-color: rgb(171, 40, 40);"></stop>
			</radialGradient>
			<radialGradient gradientUnits="userSpaceOnUse" cx="220.3364" cy="62.2808" r="18.3749" id="gradient-1" gradientTransform="matrix(1.09012126, 1.09352086, -1.14662975, 1.14306465, 52.31376798, -251.23837502)">
				<stop offset="0" style="stop-color: rgb(205, 145, 242);"></stop>
				<stop offset="1" style="stop-color: rgb(158, 47, 195);"></stop>
			</radialGradient>
			<radialGradient gradientUnits="userSpaceOnUse" cx="314.8126" cy="69.5914" r="18.3749" id="gradient-2" gradientTransform="matrix(1.19585671, 1.09677242, -1.29765382, 1.4148858, 28.7714691, -383.56197674)">
				<stop offset="0" style="stop-color: rgb(134, 248, 128);"></stop>
				<stop offset="1" style="stop-color: rgb(94, 183, 90);"></stop>
			</radialGradient>
			<radialGradient gradientUnits="userSpaceOnUse" cx="389.343" cy="81.2703" r="18.3749" id="gradient-3" gradientTransform="matrix(1.09339778, 1.02009152, -0.97825622, 1.04855586, 43.73941401, -409.54784977)">
				<stop offset="0" style="stop-color: rgb(178, 247, 255);"></stop>
				<stop offset="1" style="stop-color: rgb(58, 156, 166);"></stop>
			</radialGradient>
			<filter id="drop-shadow-filter-2" color-interpolation-filters="sRGB" x="-50%" y="-50%" width="200%" height="200%" bx:preset="drop-shadow 1 2 2 2 0.4 rgba(0,0,0,1)">
				<feGaussianBlur in="SourceAlpha" stdDeviation="2"></feGaussianBlur>
				<feOffset dx="2" dy="2"></feOffset>
				<feComponentTransfer result="offsetblur">
					<feFuncA id="spread-ctrl" type="linear" slope="0.8"></feFuncA>
				</feComponentTransfer>
				<feFlood flood-color="rgba(0,0,0,1)"></feFlood>
				<feComposite in2="offsetblur" operator="in"></feComposite>
				<feMerge>
					<feMergeNode></feMergeNode>
					<feMergeNode in="SourceGraphic"></feMergeNode>
				</feMerge>
			</filter>
			<linearGradient gradientUnits="userSpaceOnUse" x1="226.9601" y1="206.2308" x2="226.9601" y2="302.6589" id="gradient-4" gradientTransform="matrix(0.93081946, -0.36547936, 0.26818711, 0.7300394, -6.36124316, 135.9320854)">
				<stop offset="0" style="stop-color: rgba(243, 243, 243, 1)"></stop>
				<stop offset="1" style="stop-color: rgba(192, 192, 192, 1)"></stop>
			</linearGradient>
			<filter id="drop-shadow-filter-0" color-interpolation-filters="sRGB" x="-50%" y="-50%" width="200%" height="200%" bx:preset="drop-shadow 1 5 0 2 0.36 rgba(0,0,0,0.78)">
				<feGaussianBlur in="SourceAlpha" stdDeviation="2"></feGaussianBlur>
				<feOffset dx="5" dy="0"></feOffset>
				<feComponentTransfer result="offsetblur">
					<feFuncA id=&q.........完整代码请登录后点击上方下载按钮下载查看

网友评论0