乐于分享
好东西不私藏

科技感炫酷的HTML登录页面代码!!附源码!!

科技感炫酷的HTML登录页面代码!!附源码!!

  效果展示  

  完整源码  

HTML
<!DOCTYPE html><htmllang="zh-CN"><head>    <metacharset="UTF-8">    <metaname="viewport"content="width=device-width, initial-scale=1.0">    <title>科技感登录系统</title>    <style>        * {            margin0;            padding0;            box-sizing: border-box;            font-family'Arial', sans-serif;        }        body {            background-color#0a0a1a;            color#fff;            overflow: hidden;            height100vh;            display: flex;            justify-content: center;            align-items: center;        }        /* 粒子背景 */        .particles {            position: absolute;            top0;            left0;            width100%;            height100%;            z-index1;        }        .particle {            position: absolute;            backgroundrgba(01502550.5);            border-radius50%;            filterblur(1px);            animation: float linear infinite;        }        @keyframes float {            0% { transformtranslateY(0translateX(0); }            50% { transformtranslateY(-100pxtranslateX(100px); }            100% { transformtranslateY(0translateX(0); }        }        /* 登录框 */        .login-container {            position: relative;            z-index2;            width400px;            padding40px;            backgroundrgba(1020400.7);            border-radius10px;            box-shadow0 0 30px rgba(01502550.3);            backdrop-filterblur(10px);            border1px solid rgba(01502550.2);            transform-style: preserve-3d;            transformperspective(1000px);            transition: all 0.5s ease;        }        .login-container:hover {            box-shadow0 0 50px rgba(01502550.5);        }        .login-header {            text-align: center;            margin-bottom40px;        }        .login-header h1 {            font-size28px;            margin-bottom10px;            backgroundlinear-gradient(90deg#00d2ff#3a7bd5);            -webkit-background-clip: text;            -webkit-text-fill-color: transparent;            letter-spacing2px;        }        .login-header p {            color#aaa;            font-size14px;        }        /* 输入框样式 */        .input-group {            position: relative;            margin-bottom30px;        }        .input-group input {            width100%;            padding15px 20px;            backgroundrgba(2030500.5);            border1px solid rgba(01502550.3);            border-radius5px;            color#fff;            font-size16px;            outline: none;            transition: all 0.3s;        }        .input-group input:focus {            border-color#0096ff;            box-shadow0 0 10px rgba(01502550.5);        }        .input-group label {            position: absolute;            top15px;            left20px;            color#aaa;            font-size16px;            pointer-events: none;            transition: all 0.3s;        }        .input-group input:focus + label,        .input-group input:valid + label {            top: -10px;            left10px;            font-size12px;            backgroundrgba(1020400.9);            padding0 5px;            color#0096ff;        }        /* 按钮样式 */        .login-btn {            width100%;            padding15px;            backgroundlinear-gradient(90deg#00d2ff#3a7bd5);            border: none;            border-radius5px;            color#fff;            font-size16px;            font-weight: bold;            cursor: pointer;            transition: all 0.3s;            position: relative;            overflow: hidden;        }        .login-btn:hover {            transformtranslateY(-3px);            box-shadow0 10px 20px rgba(01502550.3);        }        .login-btn:active {            transformtranslateY(-1px);        }        .login-btn::after {            content"";            display: block;            position: absolute;            width100%;            height100%;            top0;            left: -100%;            backgroundlinear-gradient(90deg, transparent, rgba(2552552550.2), transparent);            transition: all 0.5s;        }        .login-btn:hover::after {            left100%;        }        /* 底部链接 */        .login-footer {            margin-top20px;            text-align: center;            font-size14px;            color#aaa;        }        .login-footer a {            color#0096ff;            text-decoration: none;            transition: all 0.3s;        }        .login-footer a:hover {            text-decoration: underline;            color#00d2ff;        }        /* 科技感装饰元素 */        .tech-decoration {            position: absolute;            width100%;            height100%;            top0;            left0;            pointer-events: none;            z-index: -1;        }        .corner {            position: absolute;            width30px;            height30px;            border2px solid #0096ff;            opacity0.7;        }        .corner-top-left {            top10px;            left10px;            border-right: none;            border-bottom: none;        }        .corner-top-right {            top10px;            right10px;            border-left: none;            border-bottom: none;        }        .corner-bottom-left {            bottom10px;            left10px;            border-right: none;            border-top: none;        }        .corner-bottom-right {            bottom10px;            right10px;            border-left: none;            border-top: none;        }        .scan-line {            position: absolute;            top0;            left0;            width100%;            height1px;            backgroundlinear-gradient(90deg, transparent, #0096ff, transparent);            animation: scan 3s linear infinite;            opacity0.5;        }        @keyframes scan {            0% { top0; }            100% { top100%; }        }    </style></head><body>    <!-- 粒子背景 -->    <divclass="particles"id="particles"></div>    <!-- 登录框 -->    <divclass="login-container">        <!-- 科技感装饰元素 -->        <divclass="tech-decoration">            <divclass="corner corner-top-left"></div>            <divclass="corner corner-top-right"></div>            <divclass="corner corner-bottom-left"></div>            <divclass="corner corner-bottom-right"></div>            <divclass="scan-line"></div>        </div>        <divclass="login-header">            <h1>SYSTEM LOGIN</h1>            <p>请输入您的凭证以访问系统</p>        </div>        <form>            <divclass="input-group">                <inputtype="text"id="username"required>                <labelfor="username">用户名</label>            </div>            <divclass="input-group">                <inputtype="password"id="password"required>                <labelfor="password">密码</label>            </div>            <buttontype="submit"class="login-btn">登 录</button>        </form>        <divclass="login-footer">            <ahref="#">忘记密码?</a> | <ahref="#">注册账号</a>        </div>    </div>    <script>        // 创建粒子效果        document.addEventListener('DOMContentLoaded'function() {            const particles = document.getElementById('particles');            const particleCount = 50;            for (let i = 0; i < particleCount; i++) {                const particle = document.createElement('div');                particle.classList.add('particle');                // 随机大小                const size = Math.random() * 5 + 1;                particle.style.width = `${size}px`;                particle.style.height = `${size}px`;                // 随机位置                particle.style.left = `${Math.random() * 100}%`;                particle.style.top = `${Math.random() * 100}%`;                // 随机透明度                particle.style.opacity = Math.random() * 0.5 + 0.1;                // 随机动画时间和延迟                const duration = Math.random() * 20 + 10;                const delay = Math.random() * 10;                particle.style.animationDuration = `${duration}s`;                particle.style.animationDelay = `${delay}s`;                particles.appendChild(particle);            }            // 3D倾斜效果            const loginContainer = document.querySelector('.login-container');            document.addEventListener('mousemove'(e) => {                const xAxis = (window.innerWidth / 2 - e.pageX) / 25;                const yAxis = (window.innerHeight / 2 - e.pageY) / 25;                loginContainer.style.transform = `perspective(1000px) rotateY(${xAxis}deg) rotateX(${yAxis}deg)`;            });            // 鼠标进入时恢复原状            loginContainer.addEventListener('mouseenter'() => {                loginContainer.style.transition = 'all 0.3s ease';            });            // 鼠标离开时恢复动画            loginContainer.addEventListener('mouseleave'() => {                loginContainer.style.transition = 'all 0.5s ease';                loginContainer.style.transform = 'perspective(1000px) rotateY(0deg) rotateX(0deg)';            });        });    </script></body></html>