svg+gsap实现立体胶囊动画效果代码
代码语言:html
所属分类:动画
代码描述:svg+gsap实现立体胶囊动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> html, body { margin:0; padding:0; width:100%; height:100%; } body { display:flex; align-items:center; justify-content:center; /* background:#000; */ } svg { width:50%; height:50%; } </style> </head> <body> <svg viewBox="0 0 10 15" fill="#fff"> <mask id="waveMask"> <path id="p1"/> </mask> <mask id="shapeMask"> <rect width="10" height="15" rx="5"/> </mask> <g mask="url(#shapeMask)"> <rect fill="rgb(255,100,125)" width="10" height="15"/> <path id="p2" fill="rgba(250,0,0,0.5)"/> <rect fill="rgb(25,160,230)" width="10" height="15" mask="url(#waveMask)"/> <image width="10" height="15" href="https://assets.codepen.io/721952/pill_lighting.jpg" style="mix-blend-mode:overlay" /> </g> </svg> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/gsap.3.10.4.js"></script> <script >.........完整代码请登录后点击上方下载按钮下载查看
网友评论0