纯css实现落地电风扇摇头运行效果

代码语言:html

所属分类:动画

代码描述:纯css实现落地电风扇摇头运行效果

代码标签: 落地 电风扇 摇头 运行 效果

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


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

<style>
* {
  box-sizing: border-box;
}

li {
  list-style: none;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-size: 5vmin;
  position: relative;
  background: #18b;
  box-sizing: border-box;
  -webkit-animation: bg 300s infinite ease-out;
          animation: bg 300s infinite ease-out;
}

#fan {
  position: absolute;
  top: calc(50% - 8em);
  left: calc(50% - 4em);
}

.oscillator {
  height: 8em;
  width: 8em;
  position: absolute;
  -webkit-animation: oscillate 8s infinite linear;
          animation: oscillate 8s infinite linear;
}

.guard {
  height: 8em;
  width: 8em;
  position: absolute;
  z-index: 10;
}

.frame {
  height: 8em;
  width: 8em;
  position: absolute;
  left: 0;
  top: 0;
  border: 0.25em solid #000;
  border-radius: 50%;
}

[class^="cir"] {
  position: absolute;
  border: 0.125em solid #000;
  border-radius: 50%;
  z-index: 12;
}

.cir1 {
  height: 7em;
  width: 7em;
  left: 0.5em;
  top: 0.5em;
}

.cir2 {
  height: 6em;
  width: 6em;
  left: 1em;
  top: 1em;
}

.cir3 {
  height: 5em;
  width: 5em;
  left: 1.5em;
  top: 1.5em;
}

.cir4 {
  height: 4em;
  width: 4em;
  left: 2em;
  top: 2em;
}

.cir5 {
  height: 3em;
  width: 3em;
  left: 2.5em;
  top: 2.5em;
}

.cir6 {
  height: 2em;
  width: 2em;
  left: 3em;
  top: 3em;
  background: radial-gradient(50% 30%, #222 0%, #000 100%);
}

.bar1,
.bar2 {
  position: absolute;
  border: 0.0625em solid #000;
  -webkit-transform: rotate(45deg);
          transform: rotate(45deg);
  z-index: 11;
}

.bar1 {
  height: 8em;
  position: absolute;
  left: 50%;
  top: 0;
}

.bar2 {
  width: 8em;
  position: absolute;
  top: 50%;
  left: 0;
}

.blades {
  height: 6em;
  width: 6em;
  position: absolute;
  top: 1em;
  left: 1em;
  z-index: 9;
  -webkit-animation: blades 130ms infinite linear;
          animation: blades 130ms infinite linear;
}

.b1,
.b2,
.b3 {
  height: 3.25em;
  width: 3.25em;
  position: absolute;
  border-radius: 0 50% 100%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.8);
}

.b1 {
  top: 3.5em;
  left: 1.375em;
  -webkit-transform: rotate(45deg);
          transform: rotate(45deg);
}

.b2 {
  top: 0.25em;
  left: -0.5em;
  -webkit-transform: rotate(165deg);
          transform: rotate(165deg);
}

.b3 {
  top: 0.25em;
  left: 3.25em;
  -webkit-transform: rotate(285deg);
          transform: rotate(285deg);
}

.motor {
  height: 2.25em;
  width: 5em;
  position: absolute;
  top: 2.875em;
  right: 3.325em;
  z-index: 8;
  background: -webkit-gradient(linear, left top, left bottom, from(#333), to(#000)) #111;
  background: linear-gradient(to bottom, #333, #000) #111;
  border-radius: 50% 20% 20% 50%;
  -webkit-animation: motor 8s infinite linear;
          animation: motor 8s infinite linear;
}

.base {
  height: 2em;
  width: 5em;
  position: absolute;
  top: 11.5em;
  left: 0.75em;
  z-index: 5;
  border-radius: 80%;
  background: #222;
}

.base:before {
  height: 2em;
  width: 5em;
  position: absolute;
  top: -0.25em;
  left: 0;
  z-index: 5;
  border-radius: 80%;
  content: '';
  display: block;
  background: -webkit-gradient(linear, left top, left bottom, from(#333), to(#000)) #111;
  background: linear-gradient(to bottom, #333 0%, #000 100%) #111;
}

.base:after {
  height: 7.5em;
  width: 0.5em;
  position: absolute;
  top: -7em;
  left: 2.25em;
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0