纯css实现无限死循环的房屋动画

代码语言:html

所属分类:动画

代码描述:纯css实现无限死循环的房屋动画

代码标签: 无限 循环 房屋 动画

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

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background-color: #f4efe0;
}

#zoom {
  transform-origin: center;
  animation: vanish 4s infinite linear, zoom2 4s infinite cubic-bezier(0.65, 0, 0.35, 1);
}

@keyframes zoom2 {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(21.25);
  }
}
#background {
  transform-origin: center;
  animation: vanish 4s infinite linear, zoom1 4s infinite cubic-bezier(0.65, 0, 0.35, 1);
}

#frame-face {
  transform-origin: center;
  animation: zoom1 4s infinite cubic-bezier(0.65, 0, 0.35, 1);
}

#frame-face-small, #_face-clip {
  transform-origin: center;
  animation: zoom2 4s infinite cubic-bezier(0.65, 0, 0.35, 1);
}

@keyframes zoom1 {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(30);
  }
}
#window {
  animation: vanish 4s infinite linear, slide 4s infinite linear;
}

@keyframes slide {
  0%, 20% {
    transform: translateY(0%);
  }
  50%, 100% {
    transform: translateY(-10%);
  }
}
@keyframes vanish {
  0%, 40% {
    opacity: 1;
  }
  55%, 100% {
    opacity: 0;
  }
}
#yacht-second {
  animation: y2anim 4s infinite linear;
}

@keyframes y2anim {
  0%, 50% {
    transform: translateX(15%);
  }
  100% {
    transform: translateX(0);
  }
}
#sun-second {
  animation: sun2anim 4s infinite ease-out;
}

@keyframes sun2anim {
  56% {
    transform: translate(-10%, 5%);
  }
  100% {
    transform: translate(0, 0);
  }
}
#beach-second {
  animation: beach2anim 4s infinite cubic-bezier(0.33, 1, 0.68, 1);
}

@keyframes beach2anim {
  0%, 45% {
    transform: translateY(20%);
  }
  100% {
    transform: translateY(0);
  }
}
#house-second {
  transform-origin: center;
  animation: house2anim 4s infinite cubic-bezier(0.33, 1, 0.68, 1);
}

@keyframes house2anim {
  0%, 50% {
    transform: translateY(30%) scale(0.4);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}
#tree-shadow-second {
  transform-origin: center;
  animation: tree2anim 4s infinite cubic-bezier(0.33, 1, 0.68, 1);
}

@keyframes tree2anim {
  0%, 55% {
    transform: translateY(30%) scale(0.2);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}
</style>

</head>
<body translate="no">
<svg width="100%" height="100%" viewBox="0 0 610 600" version="1.1" xmlns="http://www.w3.org/2000/svg" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<clipPath id="_face-clip">
<path d="M297.171,295.773l0,-0.533c0,-3.485 2.829,-6.315 6.315,-6.315l3.028,0c3.486,0 6.315,2.83 6.315,6.315l0,0.533c1.056,0.148 1.879,1.309 1.879,2.717c0,1.409 -0.823,2.57 -1.879,2.718l0,3.552c0,3.485 -2.829,6.315 -6.315,6.315l-3.028,0c-3.486,0 -6.315,-2.83 -6.315,-6.315l0,-3.552c-1.056,-0.148 -1.879,-1.309 -1.879,-2.718c0,-1.408 0.823,-2.569 1.879,-2.717Z" />
</clipPath>
<rect id="background" x="15" y="15" width="580" height="570" style="fill:#b8ccfd;" />
<g clip-path="url(#_face-clip)">
<rect id="background-second" x="96" y="62" width="418" height="476" style="fill:#b8ccfd;" />
<rect id="sea-second" x="30" y="429.56" width="550" height="170" style="fill:#56b49f;" />
<circle id="sun-second" cx="237.272" cy="129.753" r="30.27" style="fill:#fff;" />
<g id="tree-shadow-second">
<path id="tree2" d="M138.542,345.677l83.918,0l0,-129.208c0,0 -3.719,-27.145 -26.964,-27.144c-11.406,0.001 -17.799,10.437 -21.55,19.465c-3.751,9.029 4.505,26.409 -0.955,34.708c-7.021,10.668 -11.427,16.387 -13.504,25.284c-2.077,8.89.........完整代码请登录后点击上方下载按钮下载查看

网友评论0