svg+css实现遮罩动画效果代码

代码语言:html

所属分类:动画

代码描述:svg+css实现遮罩动画效果代码

代码标签: svg css 遮罩 动画

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

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

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

 
 
<style>
body {
  display: grid;
  height: 100vh;
  width: 100vw;
  place-items: center;
}

svg {
  position: absolute;
}

#wrap {
  width: 150px;
  height: 150px;
  border-radius: 30px;
  position: relative;
  overflow: clip;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}
#wrap:before {
  content: "";
  position: absolute;
  z-index: -1;
  width: calc(100% - 1px);
  height: calc(100% - 1px);
  border-radius: inherit;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  background: #000;
}
#wrap > div {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  filter: url(#goo) url(#pixelate);
  animation: rotate 30s ease-in-out infinite;
  --rotate: 360deg;
  --translate: 0px;
}
#wrap > div > div {
  --width: 80px;
  --height: 80px;
  --bg: #faa900;
  position: absolute;
  width: var(--width);
  height: var(--height);
  border-radius: 100%;
  background: var(--bg);
  transform: translate(calc(var(--width) * -0.5), calc(var(--width) * -0.5));
  animation: move 8s ease-in-out infinite alternate;
}
#wrap > div > div:before, #wrap > div > div:after {
  content: "";
  box-shadow: inherit;
  position: absolute;
  width: 7.........完整代码请登录后点击上方下载按钮下载查看

网友评论0