2025-04-21

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>QQ音乐 - 登录</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Microsoft YaHei', sans-serif;
}

    body {
        background: #f5f5f5;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .container {
        width: 100%;
        max-width: 1200px;
        padding: 20px;
        text-align: center;
        background: white;
        border-radius: 10px;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }

    .title {
        font-size: 2.5em;
        color: #31c27c;
        margin-bottom: 30px;
        font-weight: bold;
    }

    .login-button {
        display: inline-block;
        padding: 15px 30px;
        background: #31c27c;
        color: white;
        border: none;
        border-radius: 30px;
        font-size: 1.2em;
        cursor: pointer;
        transition: all 0.3s;
    }

    .login-button:hover {
        background: #2aad6d;
        transform: scale(1.05);
    }

    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    .login-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: white;
        padding: 30px;
        border-radius: 10px;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
        z-index: 1001;
        width: 400px;
        animation: popup 0.3s ease-out;
    }

    @keyframes popup {
        0% { transform: translate(-50%, -60%); opacity: 0; }
        100% { transform: translate(-50%, -50%); opacity: 1; }
    }

    .close-button {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        background: #f5f5f5;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2em;
        transition: all 0.3s;
    }

    .close-button:hover {
        background: #e0e0e0;
    }

    .login-form {
        margin-top: 20px;
    }

    .form-group {
        margin-bottom: 20px;
        text-align: left;
    }

    .form-group label {
        display: block;
        margin-bottom: 5px;
        color: #333;
    }

    .form-group input {
        width: 100%;
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 5px;
        font-size: 1em;
    }

    .form-group input:focus {
        outline: none;
        border-color: #31c27c;
    }

    .submit-button {
        width: 100%;
        padding: 12px;
        background: #31c27c;
        color: white;
        border: none;
        border-radius: 5px;
        font-size: 1.1em;
        cursor: pointer;
        transition: all 0.3s;
    }

    .submit-button:hover {
        background: #2aad6d;
    }

    .other-login {
        margin-top: 20px;
        display: flex;
        justify-content: center;
        gap: 20px;
    }

    .other-login button {
        padding: 10px 20px;
        border: 1px solid #ddd;
        border-radius: 5px;
        background: white;
        cursor: pointer;
        transition: all 0.3s;
    }

    .other-login button:hover {
        background: #f5f5f5;
    }
</style>

</head>
<body>
<div class="container">
<h1 class="title">QQ音乐</h1>
<button class="login-button" onclick="showLoginPopup()">登录</button>
</div>

<div class="overlay" id="overlay"></div>
<div class="login-popup" id="loginPopup">
    <button class="close-button" onclick="closeLoginPopup()">×</button>
    <h2>登录QQ音乐</h2>
    <div class="login-form">
        <div class="form-group">
            <label for="username">用户名</label>
            <input type="text" id="username" placeholder="请输入用户名">
        </div>
        <div class="form-group">
            <label for="password">密码</label>
            <input type="password" id="password" placeholder="请输入密码">
        </div>
        <button class="submit-button" onclick="login()">登录</button>
        <div class="other-login">
            <button>微信登录</button>
            <button>QQ登录</button>
        </div>
    </div>
</div>

<script>
    function showLoginPopup() {
        document.getElementById('overlay').style.display = 'block';
        document.getElementById('loginPopup').style.display = 'block';
    }

    function closeLoginPopup() {
        document.getElementById('overlay').style.display = 'none';
        document.getElementById('loginPopup').style.display = 'none';
    }

    function login() {
        const username = document.getElementById('username').value;
        const password = document.getElementById('password').value;
        
        if (username && password) {
            alert('登录成功!');
            closeLoginPopup();
        } else {
            alert('请输入用户名和密码!');
        }
    }

    // 点击遮罩层也可以关闭登录窗口
    document.getElementById('overlay').addEventListener('click', closeLoginPopup);
</script>

</body>
</html>

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容