当前位置: 首页 > news >正文

html设计(两种常见的充电效果)

第一种

完整代码:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>*{
padding: 0;
margin: 0;
}
.box{
width: 800px;
height: 800px;
background-color: black;
margin: 20px auto;
padding-top: 20px;
position: relative;
}
.battery{
width: 200px;
height: 320px;
background-color:white;
margin-top: 200px;
margin-left: 300px;
border-radius: 15px 15px 0px 0px;
position: relative;
/* top: 20px; */
}
.battery::before{
content: "";
width: 50px;
height: 20px;
background-color:white;
position: absolute;
top: -20px;
left: 38%;
}
.battery::after{
content: "";
position: absolute;
top: 90%;
left: 0;
right: 0;
bottom: 0;
background-image: linear-gradient(to bottom,#7abcff 0%,#00BCD4
44%,#2196F3 100%);
animation:change 10s linear infinite ;
}
@keyframes change{
0%{
top: 100%;
filter: hue-rotate(90deg);
}
95%{
top: 5%;
border-radius: 0;
}
100%{
top: 0%;
border-radius: 15px 15px 0px 0px;
filter: hue-rotate(0deg);
}
}
.cover{
width: 100%;
height: 100%;
/* background-color: #00BCD4; */
border-radius: 15px 15px 0px 0px;
position: absolute;
top: 0;
left: 0;
z-index: 1;
overflow: hidden;
}
.cover::before{
content: "";
width: 400px;
height: 400px;
background-color: rgba(255, 255, 255, 0.8);
position: absolute;
left: -50%;
border-radius: 42% 40%;
animation: coverBefore 10s linear infinite;
}
@keyframes coverBefore{
0%{
transform: rotate(0deg);
bottom: 0%;
}
100%{
transform: rotate(360deg);
bottom: 100%;
}
}
.cover::after{
content: "";
width: 400px;
height: 400px;
background-color: rgba(255, 255, 255, 0.7);
position: absolute;
left: -50%;
border-radius: 42% 40%;
animation: coverAfter 10s linear infinite;
}
@keyframes coverAfter{
0%{
transform: rotate(30deg);
bottom: 2%;
}
100%{
transform: rotate(360deg);
bottom: 95%;
}
}</style>
</head>
<body><div class="box"><div class="battery"><div class="cover"></div>
</body>
</html>

第二种

完整代码:

<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>充电效果</title><style>*{padding: 0;margin: 0;}/* .box{width: 1000px;height:1000px;background-color: black;margin: 20px auto;padding-top: 20px;position: relative;} */.contrast{width: 70%;height: 70%;background-color:black;position: absolute;top: 20px;left: 20%;filter: contrast(15);animation: hueRotate 5s linear infinite;}@keyframes hueRotate{0%{filter: contrast(15) hue-rotate(0);}100%{filter: contrast(15) hue-rotate(360deg);}}.circle{width: 300px;height: 300px;/* background-color: #2196F3; */position: absolute;top: 0;left: 50%;margin-left: -150px;filter: blur(8px);animation: circleRotate 5s linear infinite;}@keyframes circleRotate{0%{transform: rotate(0);}100%{transform: rotate(360deg);}}.circle::before{content: "";width: 200px;height: 200px;background-color: #00ff6f;position: absolute;top: 50%;left: 50%;border-radius: 42% 38% 64% 49%/45%;transform: translate(-50%,-50%);}.circle::after{content: "";width: 180px;height: 178px;background-color: black;position: absolute;top: 50%;left: 50%;border-radius: 50%;transform: translate(-50%,-50%);}.number{width: 200px;height: 200px;color: white;font-size: 30px;position: absolute;top: 9%;left: 55%;z-index: 1;line-height: 200px;text-align: center;margin-left: -100px;}.bubble_home{width: 150px;height: 50px;background-color: #00ff6f;position: absolute;bottom: 0;left: 45%;border-radius: 150px 150px 15px 15px;filter: blur(8px);}.bubble{/* width: 20px;height: 20px;background-color:#00ff6f;border-radius: 100%; */position: absolute;left: 50%;bottom: 0;z-index: 1;animation:bubbleMoveUp 5s ease-in-out infinite ;}@keyframes bubbleMoveUp{0%{bottom: 0;}100%{bottom: calc(100% - 260px);}}.bubble:nth-child(1){width: 20px;height: 20px;background-color:#00ff6f;border-radius: 100%;animation-duration: 5s;animation-delay: 1s;left: 50%;}.bubble:nth-child(2){width: 18px;height: 18px;background-color:#00ff6f;border-radius: 100%;animation-duration: 7s;animation-delay: 3s;left: 47%;}.bubble:nth-child(3){width: 22px;height: 22px;background-color:#00ff6f;border-radius: 100%;animation-duration: 3s;animation-delay: 0.5s;left: 51%;}.bubble:nth-child(4){width: 18px;height: 18px;background-color:#00ff6f;border-radius: 100%;animation-duration: 4s;animation-delay: 0s;left: 50%;}.bubble:nth-child(5){width: 20px;height: 18px;background-color:#00ff6f;border-radius: 100%;animation-duration: 7.5s;animation-delay: 3.6s;left: 48%;}.bubble:nth-child(6){width: 21px;height: 21px;background-color:#00ff6f;border-radius: 100%;animation-duration: 8s;animation-delay: 1.5s;left: 50%;}</style></head><body><div class="box"></div><div class="number">95.3%</div><div class="contrast"><div class="bubble"></div><div class="bubble"></div><div class="bubble"></div><div class="bubble"></div><div class="bubble"></div><div class="bubble"></div><div class="bubble"></div><div class="bubble"></div><div class="bubble"></div><div class="bubble"></div><div class="bubble"></div><div class="bubble"></div><div class="bubble"></div><div class="bubble"></div><span class="bubble_home"></span><div class="circle"></div></div></div></body></html>

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • HCIA学习笔记(6)-ACL+NAT
  • LabVIEW扬尘控制系统
  • NsightCompute教程入门
  • 【Django项目】基于Python+Django+MySQL的音乐网站系统项目
  • go 密码hash加密包 bcrypt
  • CUDA原子操作
  • uniapp 表格,动态表头表格封装渲染
  • 柯桥小语种学习外语培训|法语学习法语浪漫的话有哪些,来看看吧~
  • 【2024_CUMCM】Matlab快速入门
  • eMMC规范 - 寻址/信息寄存器/总线协议/时序图/速度模式
  • 【YOLO格式的数据标签,目标检测】
  • Onnx 1-深度学习-概述1
  • SpringCloudAlibaba基础五 Nacos配置中心
  • LabVIEW平台从离散光子到连续光子的光子计数技术
  • Redis的配置和优化
  • 【Redis学习笔记】2018-06-28 redis命令源码学习1
  • JAVA SE 6 GC调优笔记
  • Koa2 之文件上传下载
  • Twitter赢在开放,三年创造奇迹
  • Web Storage相关
  • 从零搭建Koa2 Server
  • 给Prometheus造假数据的方法
  • 基于web的全景—— Pannellum小试
  • 扑朔迷离的属性和特性【彻底弄清】
  • 前端 CSS : 5# 纯 CSS 实现24小时超市
  • 线性表及其算法(java实现)
  • 协程
  • 一个普通的 5 年iOS开发者的自我总结,以及5年开发经历和感想!
  • 继 XDL 之后,阿里妈妈开源大规模分布式图表征学习框架 Euler ...
  • 我们雇佣了一只大猴子...
  • ​ 无限可能性的探索:Amazon Lightsail轻量应用服务器引领数字化时代创新发展
  • ​Base64转换成图片,android studio build乱码,找不到okio.ByteString接腾讯人脸识别
  • ​补​充​经​纬​恒​润​一​面​
  • # SpringBoot 如何让指定的Bean先加载
  • (html转换)StringEscapeUtils类的转义与反转义方法
  • (rabbitmq的高级特性)消息可靠性
  • (附源码)springboot美食分享系统 毕业设计 612231
  • (附源码)ssm基于web技术的医务志愿者管理系统 毕业设计 100910
  • (回溯) LeetCode 77. 组合
  • (面试必看!)锁策略
  • (入门自用)--C++--抽象类--多态原理--虚表--1020
  • (删)Java线程同步实现一:synchronzied和wait()/notify()
  • (一)项目实践-利用Appdesigner制作目标跟踪仿真软件
  • (原创) cocos2dx使用Curl连接网络(客户端)
  • (原創) 如何讓IE7按第二次Ctrl + Tab時,回到原來的索引標籤? (Web) (IE) (OS) (Windows)...
  • (转)setTimeout 和 setInterval 的区别
  • (转)机器学习的数学基础(1)--Dirichlet分布
  • *Django中的Ajax 纯js的书写样式1
  • .bat批处理(二):%0 %1——给批处理脚本传递参数
  • .bat批处理(六):替换字符串中匹配的子串
  • .net core 6 集成 elasticsearch 并 使用分词器
  • .NET Micro Framework 4.2 beta 源码探析
  • .Net接口调试与案例
  • .NET中的Exception处理(C#)
  • .skip() 和 .only() 的使用