首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >HTML动画特效-电风扇(第二部)

HTML动画特效-电风扇(第二部)

原创
作者头像
神秘泣男子
发布于 2022-11-06 14:22:54
发布于 2022-11-06 14:22:54
1K00
代码可运行
举报
文章被收录于专栏:运维知识运维知识
运行总次数:0
代码可运行

一、今天我来分享一个电风扇特效!

1、这个电风扇特效是有一二三档的风力,外关不是做的特别好,所以大家不要建议,代码块在下面,大家自行观看。

2、后面我会分享更多酷炫的特效和代码,大家给一个关注以后方便查找!!!

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>海拥 | 风扇开关特效</title>
<link rel="shortcut icon" type="images/x-icon" href="http://haiyong.site/wp-content/uploads/2021/07/cropped-59255587-1-192x192.jpg">
<style>
  @charset "utf-8";
@keyframes leafRotate {
  0% {
  transform: rotate(0deg);
  }
  25%{
    transform: rotate(90deg);
  }
  50%{
    transform: rotate(180deg);
  }
  75%{
    transform: rotate(270deg);
  }
  100% {
  transform: rotate(360deg);
  }
}
#fan {
  width: 230px;
  position: absolute;
  z-index: 10;
  margin: auto;
  left: 0;
  right: 0;
  top: 150px
}
#fan .header {
  width: 230px;
  height: 230px;
  position: absolute;
  left: -15px;
  top: -15px;
  background: #42c7ea;
  border-radius: 50%;
  z-index: 10;
  border: 2px solid #0e6873;
}
#fan .mask {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 2px solid #0e6873;
  position: relative;
  background: #e4ecef;
  z-index: 11;
}
#fan .mask .logo {
  border: 2px solid #0e6873;
  border-radius: 50%;
  position: absolute;
  width: 80px;
  height: 90px;
  text-align: center;
  line-height: 90px;
  color: #0e6873;
  font-size: 14px;
  top: 53px;
  left: 58px;
  background: #42c7ea;
  z-index: 3;
}
#fan .mask .line {
  width: 200px;
  height: 2px;
  background: #3c8a93;
  position: absolute;
  top: 99px;
  z-index: 2;
}
#fan .mask .line_1 {
  width: 200px;
  height: 2px;
  background: #3c8a93;
  position: absolute;
  top: 99px;
  z-index: 2;
}
#fan .mask .line_2 {
  width: 200px;
  height: 2px;
  background: #3c8a93;
  position: absolute;
  top: 99px;
  z-index: 2;
  transform: rotate(30deg);
}
#fan .mask .line_3 {
  width: 200px;
  height: 2px;
  background: #3c8a93;
  position: absolute;
  top: 99px;
  z-index: 2;
  transform: rotate(60deg);
}
#fan .mask .line_4 {
  width: 200px;
  height: 2px;
  background: #3c8a93;
  position: absolute;
  top: 99px;
  z-index: 2;
  transform: rotate(90deg);
}
#fan .mask .line_5 {
  width: 200px;
  height: 2px;
  background: #3c8a93;
  position: absolute;
  top: 99px;
  z-index: 2;
  transform: rotate(120deg);
}
#fan .mask .line_6 {
  width: 200px;
  height: 2px;
  background: #3c8a93;
  position: absolute;
  top: 99px;
  z-index: 2;
  transform: rotate(150deg);
}
#fan .mask .leafs {
  z-index: 1;
  position: absolute;
  animation: leafRotate 0s infinite linear;
  transform-origin: center center;
  width: 200px;
  height: 200px;
}
#fan .mask .leafs .leaf {
  width: 72px;
  height: 60px;
  border-radius: 20% 40%;
  background: #bdcc2b;
  border: 2px solid #0e6873;
  position: absolute;
  left: 100px;
  top: 100px;
  transform-origin: left top;
}
#fan .mask .leafs .leaf_1 {
  width: 72px;
  height: 60px;
  border-radius: 20% 40%;
  background: #bdcc2b;
  border: 2px solid #0e6873;
  position: absolute;
  left: 100px;
  top: 100px;
  transform-origin: left top;
}
#fan .mask .leafs .leaf_2 {
  width: 72px;
  height: 60px;
  border-radius: 20% 40%;
  background: #bdcc2b;
  border: 2px solid #0e6873;
  position: absolute;
  left: 100px;
  top: 100px;
  transform-origin: left top;
  transform: rotate(120deg);
}
#fan .mask .leafs .leaf_3 {
  width: 72px;
  height: 60px;
  border-radius: 20% 40%;
  background: #bdcc2b;
  border: 2px solid #0e6873;
  position: absolute;
  left: 100px;
  top: 100px;
  transform-origin: left top;
  transform: rotate(240deg);
}
#fan .neck {
  width: 40px;
  height: 70px;
  border: 2px solid #0e6873;
  background: #42c7ea;
  position: absolute;
  left: 80px;
  z-index: 9;
  border-radius: 0 0 5% 5%;
}
#fan .neck_footer {
  width: 50px;
  height: 20px;
  border: 2px solid #0e6873;
  background: #77e1f1;
  position: absolute;
  top: 263px;
  left: 75px;
  border-radius: 50%;
  z-index: 8;
}
#fan .bottom {
  width: 200px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid #0e6873;
  background: #42c7ea;
  position: absolute;
  top: 250px;
  left: 0px;
  z-index: 7;
}
#fan .bottom_footer {
  width: 20px;
  height: 20px;
  background: #bdcc2b;
  border: 2px solid #0e6873;
  position: absolute;
  border-radius: 40%;
  z-index: 6;
  top: 310px;
}
#fan .bottom_footer_1 {
  width: 20px;
  height: 20px;
  background: #bdcc2b;
  border: 2px solid #0e6873;
  position: absolute;
  border-radius: 40%;
  z-index: 6;
  top: 310px;
  left: 20px;
}
#fan .bottom_footer_2 {
  width: 20px;
  height: 20px;
  background: #bdcc2b;
  border: 2px solid #0e6873;
  position: absolute;
  border-radius: 40%;
  z-index: 6;
  top: 310px;
  left: 160px;
}
#fan .switch {
  position: absolute;
  width: 24px;
  height: 24px;
  top: 296px;
  z-index: 13;
  opacity: 0;
  cursor: pointer;
}
#fan .switch_btn {
  display: inline-block;
  text-align: center;
  width: 18px;
  height: 20px;
  line-height: 20px;
  font-size: 12px;
  background: #bdcc2b;
  border: 2px solid #0e6873;
  position: absolute;
  border-radius: 50%;
  color: #0e6873;
  cursor: pointer;
  top: 296px;
  z-index: 12;
  transform: rotateX(45deg);
}
#fan .switch_0 {
  position: absolute;
  width: 24px;
  height: 24px;
  top: 296px;
  z-index: 13;
  opacity: 0;
  cursor: pointer;
  left: 50px;
}
#fan .switch_0:checked + div + input + div + input + div + input + div + .mask .leafs {
  animation-play-state:paused;
}
#fan .switch_1 {
  position: absolute;
  width: 24px;
  height: 24px;
  top: 296px;
  z-index: 13;
  opacity: 0;
  cursor: pointer;
  left: 75px;
}
#fan .switch_1:checked + div {
  background: #a9af27;
  color: #0e6873;
}
#fan .switch_1:checked + div + input + div + input + div + .mask .leafs {
  animation-duration: 0.7s;
}
#fan .switch_2 {
  position: absolute;
  width: 24px;
  height: 24px;
  top: 296px;
  z-index: 13;
  opacity: 0;
  cursor: pointer;
  left: 100px;
}
#fan .switch_2:checked + div {
  background: #a9af27;
  color: #0e6873;
}
#fan .switch_2:checked + div + input + div + .mask .leafs {
  animation-duration: 0.4s;
}
#fan .switch_3 {
  position: absolute;
  width: 24px;
  height: 24px;
  top: 296px;
  z-index: 13;
  opacity: 0;
  cursor: pointer;
  left: 125px;
}
#fan .switch_3:checked + div {
  background: #a9af27;
  color: #0e6873;
}
#fan .switch_3:checked + div + .mask .leafs {
  animation-duration: 0.3s;
}
#fan .switch_btn_0 {
  display: inline-block;
  text-align: center;
  width: 18px;
  height: 20px;
  line-height: 20px;
  font-size: 12px;
  background: #bdcc2b;
  border: 2px solid #0e6873;
  position: absolute;
  border-radius: 50%;
  color: #0e6873;
  cursor: pointer;
  top: 296px;
  z-index: 12;
  transform: rotateX(45deg);
  left: 50px;
}
#fan .switch_btn_1 {
  display: inline-block;
  text-align: center;
  width: 18px;
  height: 20px;
  line-height: 20px;
  font-size: 12px;
  background: #bdcc2b;
  border: 2px solid #0e6873;
  position: absolute;
  border-radius: 50%;
  color: #0e6873;
  cursor: pointer;
  top: 296px;
  z-index: 12;
  transform: rotateX(45deg);
  left: 75px;
}
#fan .switch_btn_2 {
  display: inline-block;
  text-align: center;
  width: 18px;
  height: 20px;
  line-height: 20px;
  font-size: 12px;
  background: #bdcc2b;
  border: 2px solid #0e6873;
  position: absolute;
  border-radius: 50%;
  color: #0e6873;
  cursor: pointer;
  top: 296px;
  z-index: 12;
  transform: rotateX(45deg);
  left: 100px;
}
#fan .switch_btn_3 {
  display: inline-block;
  text-align: center;
  width: 18px;
  height: 20px;
  line-height: 20px;
  font-size: 12px;
  background: #bdcc2b;
  border: 2px solid #0e6873;
  position: absolute;
  border-radius: 50%;
  color: #0e6873;
  cursor: pointer;
  top: 296px;
  z-index: 12;
  transform: rotateX(45deg);
  left: 125px;
}
#fan .on_off {
  position: absolute;
  width: 40px;
  height: 20px;
  top: 296px;
  z-index: 13;
  left: 80px;
  opacity: 0;
  cursor: pointer;
}
#fan .on_off:checked + div {
  box-shadow: none;
}
#fan .on_off:checked + div + .mask .leafs {
  animation: leafRotate 2s 1 ease-out;
  animation-delay: 1s;
  animation-fill-mode: forwards;
}
#fan .on_off_btn {
  display: inline-block;
  text-align: center;
  width: 40px;
  height: 20px;
  line-height: 20px;
  font-size: 12px;
  background: #bdcc2b;
  border: 2px solid #0e6873;
  position: absolute;
  border-radius: 50%;
  color: #0e6873;
  cursor: pointer;
  top: 296px;
  z-index: 12;
  left: 80px;
  box-shadow: inset 2px 2px 6px #555;
}
</style>
</head>
<body>
<div id="fan">
  <input type="radio" name="switch" class="switch_0">
  <div class="switch_btn_0">0</div>
  <input type="radio" checked="" name="switch" class="switch_1">
  <div class="switch_btn_1">1</div>
  <input type="radio" name="switch" class="switch_2">
  <div class="switch_btn_2">2</div>
  <input type="radio" name="switch" class="switch_3">
  <div class="switch_btn_3">3</div>
  <div class="mask">
    <div class="logo">风扇</div>
    <div class="line_1"></div>
    <div class="line_2"></div>
    <div class="line_3"></div>
    <div class="line_4"></div>
    <div class="line_5"></div>
    <div class="line_6"></div>
    <div class="leafs">
    <div class="leaf_1"></div>
    <div class="leaf_2"></div>
    <div class="leaf_3"></div>
    </div>
  </div>
  <div class="header"></div>
  <div class="neck"></div>
  <div class="neck_footer"></div>
  <div class="bottom"></div>
  <div class="bottom_footer_1"></div>
  <div class="bottom_footer_2"></div>
</div>

<div style="text-align:center;margin:10px 0; font:normal 14px/24px 'MicroSoft YaHei';">
<p>来源:<a href="http://haiyong.site" target="_blank">海拥</a></p>
</div>
</body>
</html>

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
HTTP协议之状态码详解
HTTP状态码,我都是现查现用。 我以前记得几个常用的状态码,比如200,302,304,404, 503。 一般来说我也只需要了解这些常用的状态码就可以了。  如果是做AJAX,REST,网络爬虫,机器人等程序。还是需要了解其他状态码。  本文我花了一个多月的时间把所有的状态码都总结了下,内容太多,看的时候麻烦耐心点了。
Java学习123
2019/03/12
1.7K0
HTTP协议之状态码详解
学习提升之HTTP状态码详解
2016-11-1410:23:53 发表评论 315℃热度 1.URL 2.URL中常见的协议 3.TCP/IP协议簇 4.TCP/IP参考模型 5.HTTP协议简介 6.HTTP协议的特点(为什么选择HTTP) 1 何谓HTTP状态码 2 状态码分类 3 常见的状态码 目录 最近太忙了,不好意思,没有更新博客,所以今天抽空把这些天积累的知识都写下来与大家分享。这篇文章是我在学习网络部分的一些学习笔记,在这里分享给大家。之前看到状态码都是搜索下就完事,常用的也都记得,毕竟搭建博客等过程
timhbw
2018/05/03
1.4K0
HTTP状态码是什么?常用的状态码有什么?
在Web开发中,HTTP状态码是服务器向客户端发送的一种响应状态标识。它提供了有关请求处理结果的信息,帮助客户端和开发人员了解请求的执行情况。本文将介绍HTTP状态码的基本概念,以及常用的HTTP状态码及其含义。
海拥
2023/06/27
1.4K0
HTTP状态码是什么?常用的状态码有什么?
Networks 06 - HTTP状态码
网络 06 - HTTP状态码 状态码 类别 原因 1XX Informational(信息性状态码) 接收的请求正在处理 2XX Success(成功状态码) 请求正常处理完毕 3XX Redirection(重定向状态码) 需要进行附加操作以完成操作 4XX Client Error(客户端错误状态码) 服务器无法处理请求 5XX Server Error(服务器错误状态码) 服务器处理请求出错 1XX 100 Continue: 表示到目前为止都正常, 客户端可以继续发送请求或者忽略这个响应. 2X
Reck Zhang
2021/08/11
4270
聊一聊HTTP协议常见的状态码及含义
在测试的过程中会遇到多种协议,比如ARP地址解析协议,FTP文件传输协议,HTTP超文本传输协议,IP互联网协议,SMTP简单邮件传输协议,TCP传输控制协议,UDP用户数据报协议等等,今天聊一聊HTTP协议常见的状态码及含义。 1xx、2xx、3xx、4xx、5xx。每个类别下的具体状态码需要详细说明。比如1xx是信息性状态码,像100 Continue和101 Switching Protocols。2xx是成功,比如200 OK,201 Created,204 No Content。3xx是重定向,包括301、302、304等。4xx是客户端错误,比如404 Not Found,403 Forbidden。5xx是服务器错误,如500 Internal Server Error。
漫谈测试
2025/03/22
3040
聊一聊HTTP协议常见的状态码及含义
一文牢记HTTP状态码(图解HTTP状态码)
HTTP状态码负责表示客户端HTTP请求的返回结果、标记服务器的处理是否正常、通知出现的错误等工作。
海盗船长
2020/08/27
12K1
返回结果的 HTTP 状态码
返回结果的 HTTP 状态码.png 返回结果的 HTTP 状态码 状态码的职责 当客户端向服务器端发送请求时,描述返回的请求结果 状态码的大致分类 1XX 信息性状态码 · 接收的请求正在处理 2XX 成功状态码 · 请求正常处理完毕 3XX 重定向状态码 · 需要进行附加操作以完成请求 4XX 客户端错误状态码 · 服务器无法处理请求 5XX 服务器错误状态码 · 服务器处理请求出错 2XX 成功 200 OK 表示从客户端发来的请求在服务器端被正常处理了 204 No Content 该状态码代表服
李才哥
2021/02/21
2.8K0
返回结果的 HTTP 状态码
必备指南:20个常见HTTP状态码的解析与应用
HTTP 状态码是在 Web 开发中经常遇到的重要概念之一。了解不同的状态码及其含义,对于调试和优化 Web 应用程序至关重要。本篇博客将深入探讨 HTTP 状态码的不同类别,解释常见状态码的含义,并提供一些实用的技巧和建议,帮助开发人员更好地理解和处理HTTP状态码。
小蓝枣
2023/07/10
4.3K0
http常见状态码
204 No Content:表示客户端发送给客户端的请求得到了成功处理,但在返回的响应报文中不含实体的主体部分(没有资源可以返回);
程序员小饭
2020/09/07
7040
Http状态码有哪些
HTTP 状态码是服务器对浏览器发出的请求所返回的响应的状态标识,用于表示服务器对请求的处理结果。常见的 HTTP 状态码包括:
程序员朱永胜
2023/11/15
3120
HTTP 状态码
状态码是来告诉客户端,发生了什么事情。状态码为客户端提供了一种理解事务处理结果的便捷方式。状态码位于响应的起始行中
ColinLiu
2019/05/04
2.9K0
HTTP 状态码
【网络系列】 HTTP状态码:网络通信的语言
在互联网的世界里,HTTP(超文本传输协议)是客户端和服务器之间通信的基础。HTTP 状态码是服务器对客户端请求的响应状态的数字代码,它们是网络通信中的重要语言,帮助我们理解请求是否成功,以及成功或失败的具体原因。
kwan的解忧杂货铺
2024/11/26
1390
面试突击53:常见的 HTTP 状态码有哪些?
HTTP 状态码是服务器端返回给客户端的响应状态码,根据(HTTP)状态码我们就能知道服务器端想要给客户端表达的具体含义,比如 200 就表示请求访问成功,500 就表示服务器端程序出错等。 HTTP 状态码可分为 5 大类:
磊哥
2022/06/02
7090
HTTP状态码列表
1xx消息——请求已被服务器接收,继续处理 2xx成功——请求已成功被服务器接收、理解、并接受 3xx重定向——需要后续操作才能完成这一请求 4xx请求错误——请求含有词法错误或者无法被执行 5xx服务器错误——服务器在处理某个正确请求时发生错误 100199:表示成功接收请求,要求客户端继续提交下一次请求才能完成整个处理过程。 200299:表示成功接收请求并已完成整个处理过程。常用200 300399:为完成请求,客户需进一步细化请求。例如:请求的资源已经移动一个新地址、常用302(意味着你请求我,我让你去找别人),307和304(我不给你这个资源,自己拿缓存) 400499:客户端的请求有错误,常用404(意味着你请求的资源在web服务器中没有)403(服务器拒绝访问,权限不够) 500~599:服务器端出现错误,常用500
Li_XiaoJin
2022/06/10
9540
状态码详解
HTTP状态码(HTTP Status Code)是用于表示网页服务器HTTP响应状态的3位数字代码。它们由RFC 2616规范定义,并得到RFC 2518、RFC 2817、RFC 2295、RFC 2774、RFC 4918等规范扩展。这些代码能够帮助客户端(如Web浏览器)了解服务器端请求的处理结果,从而做出相应的响应。
用户11397231
2025/06/02
2790
状态码详解
HTTP响应状态码:除了404,还有啥?
2.简单快速:客户向服务器请求服务时,只需传送请求方法和路径。由于HTTP协议简单,使得HTTP服务器的程序规模小,因而通信速度很快。
可可的测试小栈
2019/10/17
2.3K0
HTTP状态码大全
HTTP状态码,即HTTP协议状态码,是我们访问网站时会遇到的,服务器端返回的Http响应码,不同的数字分别代表着不同的响应状态。我们在做SEO或做网页开发过程中需要了解5类比较重要的HTTP状态码,可以根据请求响应代码检查服务器及程序是否正常,判断网页处于什么工作状态。我们就需要了解不同的状态码分别是什么含义。
摘繁华
2022/09/16
2.8K0
HTTP状态码及其含义
        开发Web项目的时候,因为环境搭建和配置的原因,经常会出现部署失败的情况;搭建这个博客的时候,也因为php-admin缺少某些库的原因,导致出现502的稀有的http状态。平时不是很留意这些状态码信息,也不是很了解出现这种状态的内在原因,每次出现都要查找。为了详细梳理和备忘,整理一份http状态码及其含义的解析。
王金龙
2018/09/05
1.9K0
四、《图解HTTP》- 状态码
状态码章节内容过于贫乏,参考资料找了一个澳大利亚的博客,里面收录了HTTP的状态码介绍,为什么选这个作参考?一个是网站挺漂亮,另一个是做了一张长图容纳了常见的响应码,存到手机可以时不时看看,并且博客有做国际化,点进去自动就是中文(但是团队确实是外国人),挺有意思的。
阿东
2022/08/12
1.3K0
四、《图解HTTP》- 状态码
HTTP状态码最全汇总(不求人宝典)
HTTP状态码,即HTTP协议状态码,是我们访问网站时会遇到的,服务器端返回的Http响应码,不同的数字分别代表着不同的响应状态。我们在做SEO或做网页开发过程中需要了解5类比较重要的HTTP状态码,可以根据请求响应代码检查服务器及程序是否正常,判断网页处于什么工作状态。我们就需要了解不同的状态码分别是什么含义。
IT运维技术圈
2022/10/24
1.6K0
相关推荐
HTTP协议之状态码详解
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验