纯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.898 3.724,19.245 1.041,28.098c-2.769,9.134 -13.99,18.573 -17.655,26.705c-3.02,6.704 -4.331,22.092 -4.331,22.092Z" style="fill:#2d845c;" />
<path id="shadow2" d="M194.848,345.677l27.612,0l0,-129.208l-27.612,129.208Z" style="fill:#262e33;" />
</g>
<g id="house-second">
<path id="chimney2" d="M377.005,162.246c0,-1.473 -1.196,-2.668 -2.668,-2.668l-17.92,0c-1.472,0 -2.668,1.195 -2.668,2.668l0,13.076l23.256,0l0,-13.076Z" style="fill:#262e33;" />
<rect id="window2" x="283.6" y="279" width="42.7" height="42" style="fill:#fff;" />
<path id="wall-beige2" d="M339.398,271.958l-116.938,0l0,73.719l116.938,0l0,-73.719Zm-20.047,15.766c0,-1.015 -0.824,-1.839 -1.839,-1.839l-25.024,0c-1.015,0 -1.839,0.824 -1.839,1.839l0,24.552c0,1.015 0.824,1.839 1.839,1.839l25.024,0c1.015,0 1.839,-0.824 1.839,-1.839l0,-24.552Z" style="fill:#ffd7c4;" />
<path id="door2" d="M244.085,316.98c0.05,-8.047 6.462,-14.564 14.352,-14.564c7.92,0 14.351,6.569 14.351,14.659l0,26.602l-28.703,0l0,-26.602l0,-0.095Z" style="fill:#fff;" />
<path id="roof2" d="M377.005,175.322l-116.938,0l-37.607,40.174l116.938,0l37.607,-40.174Z" style="fill:#ffdd47;" />
<path id="side2" d="M409.56,219.094l-32.555,-43.772l-37.607,40.174l0,130.181l70.162,0l0,-126.583Z" style="fill:#fff;" />
<rect id="wall-yellow2" x="222.46" y="215.496" width="116.938" height="57.547" style="fill:#ffc524;" />
</g>
<rect id="beach-second" x="0" y="344.677" width="610" height="84.808" style="fill:#ffd7c4;" />
<g id="yacht-second">
<path id="flag2" d="M443.063,296.904c0.301,0.136 0.495,0.436 0.495,0.766c0,0.33 -0.194.........完整代码请登录后点击上方下载按钮下载查看

网友评论0