motionsites中文站 / Anime.js · SVG 进度环
Anime.js · SVG 进度环
aadmin2026-09-19 发布动效2 阅读

Anime.js · SVG 进度环

类型:动效 · 分类:Anime.js 动效 · 收录:2026-09-19 · 源码:会员可见

[hidecontent type="vip1"]

源码

<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><style>html,body{margin:0;height:100%;display:flex;align-items:center;justify-content:center;background:#0d0d0f;overflow:hidden}body>*{max-width:100%}@media(prefers-color-scheme:light){html,body{background:#f6f7f8}}</style></head><body><!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><style>html,body{margin:0;height:100%;display:flex;align-items:center;justify-content:center;
background:#0d0d0f;overflow:hidden;font-family:system-ui,-apple-system,'PingFang SC',sans-serif;color:#f5f5f5}
.wrap{position:relative;display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;max-width:92%}
.box{width:74px;height:74px;border-radius:18px;background:linear-gradient(135deg,#e5a34a,#c88038)}
.blue{background:linear-gradient(135deg,#60a5fa,#3b6ef5)}
.dim{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.16)}
.tip{position:fixed;left:0;right:0;bottom:10px;text-align:center;font-size:11px;color:#6a707a;letter-spacing:.04em}
@media(prefers-color-scheme:light){html,body{background:#f6f7f8;color:#272b33}.dim{background:rgba(0,0,0,.05);border-color:rgba(0,0,0,.1)}}
</style></head><body><div class="wrap"><svg width="170" height="170" viewBox="0 0 170 170"><circle cx="85" cy="85" r="66" fill="none" stroke="rgba(255,255,255,.14)" stroke-width="12"/><circle id="arc" cx="85" cy="85" r="66" fill="none" stroke="#e5a34a" stroke-width="12" stroke-linecap="round" transform="rotate(-90 85 85)"/></svg><div id="pct" style="position:absolute;font-size:26px;font-weight:800;color:#f5f5f5">0%</div></div><script src="https://skillx.work/wp-content/uploads/yunjing/media/lib/anime.min.js"></script><script>var c=document.getElementById('arc'),L=2*Math.PI*66;c.style.strokeDasharray=L;c.style.strokeDashoffset=L;var o={v:0};anime({targets:o,v:100,round:1,duration:2200,easing:'easeInOutQuad',loop:true,direction:'alternate',update:function(){c.style.strokeDashoffset=L*(1-o.v/100);document.getElementById('pct').textContent=o.v+'%'}});</script></body></html></body></html>
[/hidecontent]
← 返回首页