当前位置: 首页 > article >正文

巨好看的登录注册界面源码

展示效果
在这里插入图片描述
在这里插入图片描述
源码

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            width: 100%;
            height: 100%;
        }

        .container {
            width: 100%;
            height: 100vh;
            background-color: #f0f8ff;
            /* 淡蓝色背景 */
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .form-container {
            width: 900px;
            height: 550px;
            background: #ffffff;
            border-radius: 4px;
            position: relative;
        }

        .form-panel {
            position: absolute;
            left: 0;
            transition: 0.5s all ease-in-out;
        }

        .form-panel .login-form,
        .registration-form {
            width: 640px;
            height: 100%;
            display: flex;
            flex-flow: column nowrap;
            align-items: center;
            padding: 50px 30px;
        }

        .form-panel h1 {
            margin-bottom: 35px;
        }

        .form-panel .form-section {
            width: 100%;
            margin-bottom: 30px;
            display: flex;
            align-items: flex-end;
            justify-content: center;
            gap: 6px;
        }

        .form-panel .form-section label {
            font-size: 14px;
            color: #909399;
            text-transform: uppercase;
            /* margin-bottom: 8px; */
        }

        .form-panel .form-section input {
            width: 50%;
            outline: 0;
            border: none;
            font-size: 18px;
            color: #008080;
            /* 马卡龙淡绿色 */
            text-align: center;
            padding: 4px 10px;
            border-bottom: 1px solid rgba(0, 0, 0, 0.4);
        }

        .form-panel .form-section span {
            color: #5f9ea0;
            /* 马卡龙淡绿色 */
            font-size: 15px;
            cursor: pointer;
            margin-top: 18px;
        }

        .form-panel button {
            width: 50%;
            padding: 6px 0;
            text-align: center;
            border: 3px solid #87cefa;
            /* 淡蓝色 */
            border-radius: 20px;
            background: #87cefa;
            /* 淡蓝色 */
            color: #fff;
            font-size: 17px;
            letter-spacing: 6px;
            text-indent: 6px;
            margin-bottom: 15px;
            cursor: pointer;
        }

        .form-panel .alternative-login {
            border: 3px solid #add8e6;
            /* 浅淡蓝色 */
            background: #ffffff;
            color: #add8e6;
            /* 浅淡蓝色 */
            font-weight: 600;
        }

        .registration-panel {
            width: 260px;
            height: 100%;
            background: linear-gradient(to bottom right, #add8e6 0%, #87cefa 50%, #00bfff 100%);
            /* 淡蓝色渐变 */
            border-top-right-radius: 4px;
            border-bottom-right-radius: 4px;
            position: absolute;
            left: 640px;
            top: 0;
            display: flex;
            flex-flow: column nowrap;
            align-items: center;
            padding: 50px 0;
            color: white;
            transition: all 1s ease-in-out;
        }

        .registration-panel .panel-title {
            margin-bottom: 10px;
            transition: all 0.3s ease-in-out;
        }

        .registration-panel button {
            margin-top: 260px;
            width: 50%;
            padding: 8px 0;
            border-radius: 14px;
            letter-spacing: 10px;
            text-indent: 10px;
            font-size: 18px;
            color: #fff;
            border: 3px solid #fff;
            background: transparent;
            font-weight: 700;
            cursor: pointer;
        }

        .registration-panel button:hover {
            border: 3px solid #00bfff;
            /* 马卡龙淡蓝色 */
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="form-container">
            <div class="form-panel">
                <div class="login-form">
                    <h1>欢迎回来</h1>
                    <section class="form-section">
                        <label for="email">邮箱</label>
                        <input type="text" id="email" />
                    </section>
                    <section class="form-section">
                        <label for="password">密码</label>
                        <input type="password" id="password" />
                    </section>
                    <span style="margin-bottom: 8px;">忘记密码?</span>

                    <button type="button">登录</button>
                    <button type="button" class="alternative-login"> 使用<span
                            style="font-weight: 900; color: #455a81">二维码</span>登录 </button>
                </div>
                <div class="registration-form" style="display: none">
                    <h1>立即注册</h1>
                    <section class="form-section">
                        <label for="username">用户名</label>
                        <input type="text" id="username" />
                    </section>
                    <section class="form-section">
                        <label for="email">邮箱</label>
                        <input type="text" id="email" />
                    </section>
                    <section class="form-section">
                        <label for="password">密码</label>
                        <input type="password" id="password" />
                    </section>
                    <button type="button">注册</button>
                    <button type="button" class="alternative-login"> 使用<span
                            style="font-weight: 900; color: #455a81">二维码</span>扫码注册 </button>
                </div>
            </div>
            <div class="registration-panel">
                <h1 class="panel-title">还未注册?</h1>
                <span class="subTitle">立即注册,发现大量机会!</span>
                <button type="button" id="toggleForm">注册</button>
            </div>
        </div>
    </div>
    <script>
        const toggleButton = document.getElementById('toggleForm');
        const loginForm = document.querySelector('.login-form');
        const registrationForm = document.querySelector('.registration-form');
        const formPanel = document.querySelector('.form-panel');
        const registrationPanel = document.querySelector('.registration-panel');
        const panelTitle = document.querySelector('.panel-title');
        const subTitle = document.querySelector('.subTitle');
        let isRegistrationMode = false;

        function toggleLoginAndRegistration() {
            if (isRegistrationMode) {
                registrationPanel.style.left = '640px';
                formPanel.style.left = '0';
                toggleButton.innerText = '注册';
                panelTitle.innerText = '还未注册?';
                subTitle.innerText = '立即注册,发现大量机会!';
                setTimeout(() => {
                    loginForm.style.display = 'flex';
                    registrationForm.style.display = 'none';
                }, 300);
            } else {
                registrationPanel.style.left = '0';
                formPanel.style.left = '260px';
                toggleButton.innerText = '登录';
                panelTitle.innerText = '已有帐号?';
                subTitle.innerText = '有帐号就登录吧,好久不见了!';
                setTimeout(() => {
                    loginForm.style.display = 'none';
                    registrationForm.style.display = 'flex';
                }, 300);
            }
            isRegistrationMode = !isRegistrationMode;
        }

        toggleButton.addEventListener('click', toggleLoginAndRegistration);
    </script>
</body>

</html>

http://www.kler.cn/a/374904.html

相关文章:

  • .net core中间件Polly
  • 推荐一款功能强大的文字处理工具:Atlantis Word Processor
  • Linux 安装nacos
  • 飞桨首创 FlashMask :加速大模型灵活注意力掩码计算,长序列训练的利器
  • 如何在Linux系统中使用Zabbix进行监控
  • 测试管理|如何做好质量管理、提高研发的代码质量?
  • 【 纷享销客-注册安全分析报告-无验证方式导致安全隐患】
  • C++:二叉搜索树进阶
  • flink 自定义kudu connector中使用Metrics计数平均吞吐量,并推送到自定义kafkaReporter
  • DDIM扩散模型的加速采样(去噪)算法 Denoising Diffusion Implicit Models
  • windows 11 配置 kafka 使用SASL SCRAM-SHA-256 认证
  • 操作符详解
  • Java第二阶段---15异常---第三节 自定义异常
  • 【智能算法应用】秃鹰搜索算法求解二维路径规划问题
  • 适合视频搬运的素材网站推荐——短视频素材下载宝库
  • DirectShow过滤器开发-写MP3音频文件过滤器(再写 写MP3)
  • 鸿蒙系统的优势 不足以及兼容性与未来发展前景分析
  • C++基础_类的基本理解
  • 『 Linux 』网络传输层 - TCP(二)
  • NLP算法工程师精进之路:顶会论文研读精华
  • Rust整合Elasticsearch
  • el-tree展开子节点后宽度没有撑开,溢出内容隐藏了,不显示横向滚动条
  • 使用LangChain控制大模型的输出——解析器Parser
  • 人工智能:塑造未来生活的强大力量
  • 计组-层次化存储结构
  • uniapp+vite配置环境变量