乐于分享
好东西不私藏

科技感加载loading效果!!附源码!!

科技感加载loading效果!!附源码!!

  效果展示  

  完整源码

HTML
<!DOCTYPE html><htmllang="zh-CN"><head>    <metacharset="UTF-8">    <metaname="viewport"content="width=device-width, initial-scale=1.0">    <title>科技感Loading页面</title>    <linkhref="css/css.css"rel="stylesheet" /></head><body>    <divclass="particles"id="particles"></div>    <divclass="container">        <divclass="text">系统初始化中</div>        <divclass="loader">            <divclass="orb"></div>            <divclass="inner-orb"></div>            <divclass="core">TECH LOADING</div>        </div>        <divclass="progress">            <divclass="progress-bar"></div>        </div>        <divclass="dots">            <divclass="dot"></div>            <divclass="dot"></div>            <divclass="dot"></div>        </div>    </div>    <scriptsrc="js/js.js"></script></body></html>
CSS
 * {     margin0;     padding0;     box-sizing: border-box; } body {     background#0a0e17;     color#00f3ff;     font-family'Arial', sans-serif;     min-height100vh;     display: flex;     justify-content: center;     align-items: center;     overflow: hidden;     position: relative; } .container {     text-align: center;     z-index10;     position: relative; } .loader {     position: relative;     width200px;     height200px;     margin0 auto 30px; } .orb {     position: absolute;     top0;     left0;     width100%;     height100%;     border-radius50%;     border2px solid rgba(02432550.2);     animation: rotate 3s linear infinite; } .orb::before {     content'';     position: absolute;     top: -10px;     left50%;     transformtranslateX(-50%);     width20px;     height20px;     background#00f3ff;     border-radius50%;     box-shadow0 0 20px #00f3ff0 0 40px #00f3ff; } .inner-orb {     position: absolute;     top30px;     left30px;     right30px;     bottom30px;     border-radius50%;     border2px solid rgba(02432550.2);     animation: rotateReverse 2.5s linear infinite; } .core {     position: absolute;     top60px;     left60px;     right60px;     bottom60px;     border-radius50%;     backgroundrgba(02432550.1);     box-shadow0 0 40px rgba(02432550.2);     animation: pulse 2s ease-in-out infinite alternate;     display: flex;     justify-content: center;     align-items: center;     color#fff;     font-size14px; } .progress {     width300px;     height4px;     backgroundrgba(2552552550.1);     border-radius4px;     margin30px auto;     overflow: hidden; } .progress-bar {     height100%;     width0%;     backgroundlinear-gradient(90deg#00f3ff#0099ff);     box-shadow0 0 10px rgba(02432550.6);     animation: loading 5s ease-in-out infinite;     border-radius4px; } .text {     font-size24px;     letter-spacing2px;     margin-bottom20px;     text-shadow0 0 10px rgba(02432550.7); } .dots {     display: flex;     justify-content: center;     gap5px; } .dot {     width10px;     height10px;     background#00f3ff;     border-radius50%;     box-shadow0 0 10px #00f3ff;     animation: bounce 1.5s infinite ease-in-out; } .dot:nth-child(2) {     animation-delay0.2s; } .dot:nth-child(3) {     animation-delay0.4s; } .particles {     position: absolute;     top0;     left0;     width100%;     height100%;     z-index1; } @keyframes rotate {     0% {         transformrotate(0deg);     }     100% {         transformrotate(360deg);     } } @keyframes rotateReverse {     0% {         transformrotate(0deg);     }     100% {         transformrotate(-360deg);     } } @keyframes pulse {     0% {         box-shadow0 0 40px rgba(02432550.2);         transformscale(1);     }     100% {         box-shadow0 0 60px rgba(02432550.4);         transformscale(1.05);     } } @keyframes loading {     0% {         width0%;     }     70% {         width90%;     }     100% {         width100%;     } } @keyframes bounce {     0%100% {         transformtranslateY(0);     }     50% {         transformtranslateY(-15px);     } } /* 响应式设计 */ @media (max-width768px) {     .loader {         width150px;         height150px;     }     .inner-orb {         top20px;         left20px;         right20px;         bottom20px;     }     .core {         top40px;         left40px;         right40px;         bottom40px;         font-size12px;     }     .text {         font-size20px;     }     .progress {         width250px;     } } @media (max-width480px) {     .loader {         width120px;         height120px;     }     .inner-orb {         top15px;         left15px;         right15px;         bottom15px;     }     .core {         top30px;         left30px;         right30px;         bottom30px;         font-size10px;     }     .text {         font-size18px;     }     .progress {         width200px;     } }
JS
    // 创建粒子效果    document.addEventListener('DOMContentLoaded'function() {        const container = document.getElementById('particles');        const particleCount = 50;        for (let i = 0; i < particleCount; i++) {            createParticle(container);        }        function createParticle(container) {            const particle = document.createElement('div');            particle.style.position = 'absolute';            particle.style.width = Math.random() * 3 + 2 + 'px';            particle.style.height = particle.style.width;            particle.style.background = '#00f3ff';            particle.style.boxShadow = '0 0 5px #00f3ff, 0 0 10px #00f3ff';            particle.style.borderRadius = '50%';            // 随机位置            const posX = Math.random() * 100;            const posY = Math.random() * 100;            particle.style.left = posX + 'vw';            particle.style.top = posY + 'vh';            // 动画            const duration = Math.random() * 10 + 5;            particle.style.animation = `float ${duration}s linear infinite`;            const keyframes = `            @keyframes float {                0% {                    transform: translate(0, 0);                    opacity: ${Math.random() * 0.5 + 0.2};                }                100% {                    transform: translate(${Math.random() * 100 - 50}px, ${Math.random() * 100 - 50}px);                    opacity: ${Math.random() * 0.5 + 0.2};                }            }`;            const styleSheet = document.createElement('style');            styleSheet.textContent = keyframes;            document.head.appendChild(styleSheet);            container.appendChild(particle);        }    });
本站文章均为手工撰写未经允许谢绝转载:夜雨聆风 » 科技感加载loading效果!!附源码!!

评论 抢沙发

2 + 5 =
  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
×
订阅图标按钮