web建站教程
  1. 首页
  2. vuejs
  3. js
  4. 好玩
  5. seo教程
  6. 前端知识
  7. 百度echarts
  8. 更多
    php入门
    nodejs
    mockjs
    reactjs
    mysql
    wordpress
    织梦cms
    帝国cms
    git教程
    IT知识
    模板大全
    休息站

利用css3做一个动态loading效果

564 ℃
     

如何利用css3做一个动态loading效果,下面web建站小编给大家简单介绍一下实现代码!

html代码:

<div class="loader">
  <div class="face">
    <div class="circle"></div>
  </div>
  <div class="face">
    <div class="circle"></div>
  </div>
</div>

css3代码:

body {
  margin:0;
  height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  background-color:black;
}
.loader {
  width:20em;
  height:20em;
  font-size:10px;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
}
.loader .face {
  position:absolute;
  border-radius:50%;
  border-style:solid;
  animation:animate 3s linear infinite;
}
.loader .face:nth-child(1) {
  width:100%;
  height:100%;
  color:gold;
  border-color:currentColor transparent transparent currentColor;
  border-width:0.2em 0.2em 0em 0em;
  --deg:-45deg;
  animation-direction:normal;
}
.loader .face:nth-child(2) {
  width:70%;
  height:70%;
  color:lime;
  border-color:currentColor currentColor transparent transparent;
  border-width:0.2em 0em 0em 0.2em;
  --deg:-135deg;
  animation-direction:reverse;
}
.loader .face .circle {
  position:absolute;
  width:50%;
  height:0.1em;
  top:50%;
  left:50%;
  background-color:transparent;
  transform:rotate(var(--deg));
  transform-origin:left;
}
.loader .face .circle::before {
  position:absolute;
  top:-0.5em;
  right:-0.5em;
  content:'';
  width:1em;
  height:1em;
  background-color:currentColor;
  border-radius:50%;
  box-shadow:0 0 2em,0 0 4em,0 0 6em,0 0 8em,0 0 10em,0 0 0 0.5em rgba(255,255,0,0.1);
}
@keyframes animate {
  to {
    transform:rotate(1turn);
  }
}

css3+js菜单点击动态效果

css3如何利用Flex实现响应式表格布局(Flex弹性布局)

网站加载中loading..样式五代码介绍

网站加载中loading..样式四代码介绍

网站加载中loading..样式三代码介绍

标签: css3, loading, 动态效果

上面是“利用css3做一个动态loading效果”的全面内容,想了解更多关于 好玩 内容,请继续关注web建站教程。

当前网址:https://ipkd.cn/webs_2815.html

声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

当前位置: 网站首页 > 好玩
本文共计1319个字,预计阅读时长9分钟
生活小工具,收录了80多款小工具
上一篇: 推荐2款充满科技感的艺术字体——小新黑体、小新潮酷体
下一篇: 推荐一款浏览器数据库的开源工具库——Dexie.js(JavaScript调用)
x 打工人ai神器