CSS3创建的Circle Loader动画特效代码

所属分类: 网页特效-动画效果    2023-12-18 11:22:41

CSS3创建的Circle Loader动画特效代码 ie兼容6
 查看演示  登录后下载 温馨提示
登录会员即可享受免费下载
 我要建站

CSS3创建的Circle Loader动画特效代码(共2个文件)

    • index.html

使用方法

@property --nose {
  syntax: "<percentage>";
  initial-value: 0%;
  inherits: true;
}

@property --tail {
  syntax: "<percentage>";
  initial-value: 0%;
  inherits: true;
}

:root {
  --size: 25;
}
.cd__main{
   background: hsl(0, 0%, 8%) !important;
}

body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: hsl(0, 0%, 8%);
}

.loader {
  height: calc(var(--size) * 1vmin);
  width: calc(var(--size) * 1vmin);
  position: relative;
  border-style: solid;
  border-width: 5vmin;
  border-color: transparent;
  border-radius: 50%;
  -webkit-mask: conic-gradient(
    from 45deg,
    transparent 0 var(--tail),
    white 0 var(--nose),
    transparent 0
  );
          mask: conic-gradient(
    from 45deg,
    transparent 0 var(--tail),
    white 0 var(--nose),
    transparent 0
  );
  -webkit-animation: load 2.5s both infinite ease-in-out, spin 3.25s infinite linear;
          animation: load 2.5s both infinite ease-in-out, spin 3.25s infinite linear;
}

.loader::after {
  content: "";
  position: absolute;
  inset: -5vmin;
  background: conic-gradient(
      from 95deg in hsl longer hue,
      hsl(240deg 100% 75%),
      hsl(240deg 100% 75%)
    ) -5vmin -5vmin / calc(100% + 10vmin) calc(100% + 10vmin);
  background: goldenrod;
  border-style: solid;
  border-width: 5vmin;
  border-color: transparent;
  border-radius: 50%;
  -webkit-mask: linear-gradient(white 0 0) padding-box,
    linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(white 0 0) padding-box exclude,
    linear-gradient(white 0 0);
}

@-webkit-keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@-webkit-keyframes load {
  0% {
    --tail: 0%;
    --nose: 0%;
  }
  40%,
  60% {
    --nose: 100%;
    --tail: 0%;
  }
  100% {
    --nose: 100%;
    --tail: 100%;
  }
}

@keyframes load {
  0% {
    --tail: 0%;
    --nose: 0%;
  }
  40%,
  60% {
    --nose: 100%;
    --tail: 0%;
  }
  100% {
    --nose: 100%;
    --tail: 100%;
  }
}

@supports (background: conic-gradient(from 95deg in hsl longer hue, red, red)) {
  .loader::after {
    background: conic-gradient(
        from 95deg in hsl longer hue,
        hsl(240deg 100% 75%),
        hsl(240deg 100% 75%)
      ) -5vmin -5vmin / calc(100% + 10vmin) calc(100% + 10vmin);
  }
}

站长提示:
1. 苦力吧素材官方QQ群:950875342
2. 平台上所有素材资源,需注册登录会员方能正常下载。
3. 会员用户积极反馈网站、素材资源BUG或错误问题,每次奖励2K币
4. PHP源码类素材,如需协助安装调试,或你有二次开发需求,可联系苦力吧客服。
5. 付费素材资源,需充值后方能下载,如有任何疑问可直接联系苦力吧客服
相关资源 / 动画效果

CSS悬停绘制的HTML图片对角边框动画特效代码

它使用了CSS圆锥梯度函数,作为背景图片属性,来设置对象的对角边界。支持:图片、文本、iframe或任何其他HTML元素。
  动画效果
 3937  0

jquery跟随鼠标移动的动画特效插件

一款不规则图形跟随鼠标轨迹移动的动画效果,鼠标移至任意地方,不规则图形和一个小红点延迟跟随。
  动画效果
 3732  0

jquery轻量级返回顶部代码

一款带白天/夜晚网页背景切换的特效插件,还有拉动滚动条右下角有返回顶部。
  动画效果
 7830  0

纯CSS3鼠标悬停图片翻转动画特效

一款图片悬停翻转动画效果,鼠标悬停在图片上,即可触发图片翻转动画。
  动画效果
 7798  0

评论数(0) 回复有机会获得K币 用户协议

^_^ 还没有人评论,快来抢个沙发!
😀
  • 😀
  • 😊
  • 😂
  • 😍
  • 😑
  • 😷
  • 😵
  • 😛
  • 😣
  • 😱
  • 😋
  • 😎
  • 😵
  • 😕
  • 😶
  • 😚
  • 😜
  • 😭
发表评论