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. 付费素材资源,需充值后方能下载,如有任何疑问可直接联系苦力吧客服
相关资源 / 动画效果

JS+CSS3柳枝随风飘摇交互动画特效

一款画布模拟柳树随风摇摆的动画特效,所有柳枝和柳叶的动画都通过CSS实现,将鼠标悬停在柳枝上时,就像微风拂过一般,将柳枝和柳叶飘摇起来。
  动画效果
 8985  0

CSS创建的鼠标悬停动画效果

一款鼠标悬停触发动画特效,鼠标在悬停导航菜单上时突出边框和过渡阴影特效。
  动画效果
 51313  0

css3 svg气泡加载动画特效

一款白色气泡式加载动画特效代码,纯css3编写,很好看!
  动画效果
 9710  0

CSS3实现的图片上鼠标悬停显示文本文字特效

一款纯css悬停动画效果,鼠标悬停在图片上,触发显示文本文字动画及图片模糊特效。
  动画效果
 5678  0

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

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