Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Loading
Reload
css
body { display: grid; place-items: center; height: 100vh; margin: 0; background: #0f0514; font-family: monospace; } .loader { font-size: 25vmin; width: 1em; height: 1em; background-color: #21346e; border-radius: 1em; position: relative; } .loader::after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border: 0.1rem solid #21346e; border-radius: inherit; } .loader.loaded::after { opacity: 0; border-color: #3d7af5; transform: scale(1.6); transition: opacity 0.6s ease, transform 0.6s ease-out; } .loader .meter { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: inherit; overflow: hidden; } .loader .meter .fill { background-color: #3d7af5; width: 100%; height: 0%; position: absolute; left: 0; bottom: 0; z-index: 10; transform: translateY(1.5vh); filter: drop-shadow(0 0 1rem black); transition: height 0.2s linear; } .loader .meter .fill svg { color: #3d7af5; position: absolute; transform: translateY(calc(-100% + 1px)); width: 200%; animation: waves 4s ease-in-out infinite alternate; } @keyframes waves { 0% { left: -10%; top: 2vh; } 50% { top: 0vh; } 100% { left: -60%; top: 1vh; } } .loader .meter .fill-text { position: absolute; z-index: 15; top: 50%; left: 50%; font-size: 1rem; transform: translate(-50%, -50%); color: rgba(15, 5, 20, 0.9); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 900; pointer-events: none; } .loader .ball { position: absolute; background-color: #21346e; top: 50%; left: 0; border-radius: inherit; } .loader .ball.a { width: 0.25em; height: 0.25em; transform-origin: 1.5em; animation: rotate-a 4s linear infinite; } .loader .ball.b { width: 0.3em; height: 0.3em; transform-origin: 1em; animation: rotate-b 7s linear reverse infinite; } @keyframes rotate-a { from { transform: translate(-1em, -50%) rotate(0deg); } to { transform: translate(-1em, -50%) rotate(360deg); } } @keyframes rotate-b { from { transform: translate(-0.5em, -50%) rotate(0deg); } to { transform: translate(-0.5em, -50%) rotate(360deg); } } .reload-button { position: absolute; bottom: 1rem; left: 1rem; border: 0; background-color: #21346e; font-family: monospace; color: rgba(15, 5, 20, 0.9); border-radius: 8px; padding: 1rem 2rem; box-shadow: 0 0 1rem 0.25rem rgba(0, 0, 0, 0.5); text-transform: uppercase; letter-spacing: 0.1em; outline: none; font-weight: 900; } .reload-button:hover { background-color: #3d7af5; cursor: pointer; box-shadow: 0 0 0.5rem 0.125rem rgba(0, 0, 0, 0.5); } .reload-button:active { transform: translateY(0.5em); } .signature { position: absolute; bottom: 1rem; right: 1rem; } .signature a { display: flex; align-items: center; text-decoration: none; color: #ffffff; font-family: monospace; } .signature img { height: 2rem; width: 2rem; margin-left: 1em; border-radius: 2rem; }
JavaScript
const fillDOM = document.querySelector(".fill"); const loaderDOM = document.querySelector(".loader"); const updateFill = (percent) => { fillDOM.style.height = `${percent}%`; if (percent >= 100) { loaderDOM.classList.add("loaded"); } }; // Dummy loading let loadingPos = 0; let loop; const startLoop = () => { loop = setInterval(() => { if (loadingPos >= 100) { clearInterval(loop); loop = null; } else { loadingPos++; updateFill(loadingPos); } }, 100); }; startLoop(); // Reload button const reloadButtonDOM = document.querySelector(".reload-button"); let timeout; reloadButtonDOM.addEventListener("click", () => { if (!timeout) { if (loop) { clearInterval(loop); } if (loaderDOM.classList.contains("loaded")) { loaderDOM.classList.remove("loaded"); } loadingPos = 0; updateFill(loadingPos); timeout = setTimeout(() => { timeout = null; startLoop(); }, 500); } });
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>加载动画-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号