您现在的位置是:网站首页> 编程资料编程资料
CSS loading效果之 吃豆人的实现10种CSS3实现的loading动画,挑一个走吧?CSS3制作3D立方体loading特效CSS3实现渐变的loading加载进度条特效代码使用css实现android系统的loading加载动画CSS 实现各种 Loading 效果附带解析过程
2023-10-19
291人已围观
简介 这篇文章主要介绍了CSS loading效果之 吃豆人的实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
emmm 名字瞎想的2333
前言
这是一个用来练习的css demo,如果有哪里写的不好,还请各位指正,一定虚心接受。嘻嘻
HTML布局
CSS 样式
主要使用了动画效果,通过不断控制元素的角度位置实现一个类似于吃豆人一样的loading demo。
body { margin: 0; padding: 0; background: #fff; } .container { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .loading { position: relative; width: 200px; height: 50px; display: flex; } .eat { position: relative; width: 50px; height: 50px; left: 0; color: #ff0000; animation: eat-animate 2.4s ease-in-out infinite; } @keyframes eat-animate { 100% { left: 150px; } } .eat::before { content: ''; position: absolute; width: 0; height: 0; width: 50px; height: 25px; top: 0; border-radius: 50px 50px 0 0; background: currentColor; transform: rotate(-30deg); animation: eat-top 2.4s ease-in-out infinite; } @keyframes eat-top { 20% { transform: rotate(-30deg); } 35% { transform: rotate(0deg); } 45% { transform: rotate(-30deg); } 60% { transform: rotate(0deg); } 70% { transform: rotate(-30deg); } 85% { transform: rotate(0deg); } 100% { transform: rotate(0deg); } } .eat::after { content: ''; position: absolute; width: 0; height: 0; width: 50px; height: 25px; bottom: 0; border-radius: 0 0 50px 50px; background: currentColor; transform: rotate(30deg); animation: eat-bottom 2.4s ease-in-out infinite; } @keyframes eat-bottom { 20% { transform: rotate(30deg); } 35% { transform: rotate(0deg); } 45% { transform: rotate(30deg); } 60% { transform: rotate(0deg); } 70% { transform: rotate(30deg); } 85% { transform: rotate(0deg); } 100% { transform: rotate(0deg); } } .load { position: relative; width:30px; height: 30px; margin: 10px; color: #e47272; border-radius: 50%; background: currentColor; } .load:nth-child(2) { animation: load1 2.4s linear infinite; transform: scale(1); } @keyframes load1 { 35% { transform: scale(0); } 100% { transform: scale(0); } } .load:nth-child(3) { animation: load2 2.4s linear infinite; transform: scale(1); } @keyframes load2 { 30% { transform: scale(1); } 58% { transform: scale(0); } 100% { transform: scale(0); } } .load:nth-child(4) { animation: load3 2.4s linear infinite; transform: scale(1); } @keyframes load3 { 60% { transform: scale(1); } 80% { transform: scale(0); } 100% { transform: scale(0); } }Preview

整体如上所示,如果有看不懂的也欢迎直接回复...
目前持续更新中 https://github.com/ajycc20/easy-css-layout ,欢迎大佬们提出意见!!!
以及,有个star会更好啊 ( hhhh 逃
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
相关内容
- 用CSS防Lightbox实现点击小图无刷新显示大图代码jQuery和CSS3超酷图片遮罩层和lightbox动画特效css3实现的半透明遮罩lightbox效果源码jquery+css3实现的超酷动画效果Lightbox灯箱特效纯CSS3实现的绚丽的图片点击放大显示lightbox效果纯CSS实现的lightbox风格的高亮弹出框效果CSS 鼠标经过放大图片+Lightbox图片展示
- 割绳子2废车场3-1三星通关图文攻略推荐_手机游戏_游戏攻略_
- 全民英雄春节版新英雄术士技能全方位解析_手机游戏_游戏攻略_
- 全民英雄春节版新英雄巫妖技能全方位解析_手机游戏_游戏攻略_
- 全民英雄 巫妖好不好 巫妖技能介绍_手机游戏_游戏攻略_
- 全民英雄 术士好不好 术士技能介绍_手机游戏_游戏攻略_
- 全民英雄春节版新英雄暗影牧师技能全方位解析_手机游戏_游戏攻略_
- 全民英雄春节版新英雄黑鸟技能全方位解析_手机游戏_游戏攻略_
- 全民英雄春节版新英雄乱入_全民英雄春节版新英雄都有哪些_手机游戏_游戏攻略_
- 全民英雄卡魂最大化获取攻略_全民英雄卡魂获得方法_手机游戏_游戏攻略_
