绝美的登录界面!滑动切换效果

news2024/10/5 10:07:00

绝美登录界面!添加了管理员账号和测试账号

<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <title>绝美登录界面!滑动切换效果</title>
</head>
<style>
    * {
        /* 禁止文本选中 */
        user-select: none;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    html,
    body {
        height: 100%;
    }

    body {
        display: flex;
    }

    .wrapper {
        width: 100%;
        background-image: url('file:///D:/img/开门.png');
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-size: 100% 100%;
    }

    .container {
        transform: scale(1.5);
        width: 525px;
        height: 300px;
        display: flex;
        position: relative;
        border-radius: 8px;
        margin: 19% auto;
        border: 1px solid rgba(255, 255, 255, 6);
        background-image: linear-gradient(to top left,
                rgba(255, 255, 255, 0.1),
                rgba(255, 255, 255, 0.1) 30%,
                rgba(255, 255, 255, 0));
        backdrop-filter: blur(4px);
        box-shadow:
            inset 4px 4px 3px rgba(255, 255, 255, 0.6),
            inset -4px -4px 3px rgba(0, 0, 0, 0.6);
    }

    .welcome-box {
        width: calc(525px / 2);
        height: 100%;
        left: 0;
        top: 0;
        position: absolute;
        border: 5px;
        background-color: rgb(225 139 166);
        transition: 0.5s ease-in-out;
        border-radius: 8px 0 0 8px;
        background-image: linear-gradient(to top left,
                rgba(0, 0, 0, 0.2),
                rgba(0, 0, 0, 0.2) 30%,
                rgba(0, 0, 0, 0));
        box-shadow:
            inset 2px 2px 3px rgba(255, 255, 255, 0.6),
            inset -2px -2px 3px rgba(0, 0, 0, 0.6);
        text-shadow: 1px 1px 1px #100000;
        z-index: 9;
    }

    p,
    h1 {
        color: rgb(255, 255, 255);
    }

    .welcome-box h1 {
        margin-top: 45px;
        text-align: center;
        letter-spacing: 5px;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    }

    .welcome-box p {
        height: 25px;
        line-height: 25px;
        text-align: center;
        margin: 10px 0;
        font-weight: bold;
        text-shadow: 2px 2px 2px #100000;
    }

    .image-container {
        width: 100px;
        height: 100px;
        margin: 10px auto;
        border-radius: 50%;
        overflow: hidden;
        background-image: linear-gradient(to top left,
                rgba(0, 0, 0, 0.2),
                rgba(0, 0, 0, 0.2) 30%,
                rgba(0, 0, 0, 0));
        box-shadow:
            inset 2px 2px 3px rgba(255, 255, 255, 0.6),
            inset -2px -2px 3px rgba(0, 0, 0, 0.6);
        text-shadow: 1px 1px 1px #100000;
    }

    .image-container img {
        width: 100%;
        height: 100%;
    }

    .form-container {
        margin: 120px auto;
    }

    .form-container,
    .registration-container {
        flex: 1;
        height: 100%;
        margin: 40px auto;
    }

    .title-container {
        height: 50px;
        line-height: 4px;
    }

    .title-container h1 {
        text-align: center;
        letter-spacing: 5px;
        background-image: linear-gradient(to top left,
                rgba(0, 0, 0, 0.2),
                rgba(0, 0, 0, 0.2) 30%,
                rgba(0, 0, 0, 0));
        box-shadow:
            inset 2px 2px 3px rgba(255, 255, 255, 0.6),
            inset -2px -2px 3px rgba(0, 0, 0, 0.6);
        text-shadow: 1px 1px 1px #100000;
    }

    .input-group {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    input {
        width: 60%;
        height: 25px;
        margin-bottom: 20px;
        text-indent: 4px;
        border-radius: 3px;
        box-shadow: 0px 0px 5px 5px #f7c750;
    }

    .form-container input[type="password"] {
        transform: translateY(20px);
    }

    input:focus {
        color: rgb(61, 185, 71);
    }

    .button-container {
        display: flex;
        justify-content: center;
    }

    .form-container .button-container {
        margin-top: 45px;
    }

    button {
        width: 100px;
        height: 30px;
        margin: 0 3px;
        border: none;
        border-radius: 3px;
        color: #fff;
        background-color: #2196F3;
        background-image: linear-gradient(to top left,
                rgba(0, 0, 0, 0.2),
                rgba(0, 0, 0, 0.2) 30%,
                rgba(0, 0, 0, 0));
        box-shadow:
            inset 2px 2px 3px rgba(255, 255, 255, 0.6),
            inset -2px -2px 3px rgba(0, 0, 0, 0.6);
        text-shadow: 1px 1px 1px #100000;
    }

    .register-btn {
        background-color: #4CAF50;
    }

    button:hover {
        cursor: pointer;
        background-color: aqua;
    }

    .button-container p {
        height: 30px;
        line-height: 30px;
        padding: 0 10px;
        font-size: 14px;
        background-color: #f56c6c;
        border-radius: 3px;
        background-image: linear-gradient(to top left,
                rgba(0, 0, 0, 0.2),
                rgba(0, 0, 0, 0.2) 30%,
                rgba(0, 0, 0, 0));
        box-shadow:
            inset 2px 2px 3px rgba(255, 255, 255, 0.6),
            inset -2px -2px 3px rgba(0, 0, 0, 0.6);
        text-shadow: 1px 1px 1px #d3bfbf;
    }

    button:hover,
    .button-container p:hover {
        cursor: pointer;
        /* opacity: 0.6; */
        background-color: rgb(251, 16, 16);
        background-image: linear-gradient(to top left,
                rgba(0, 0, 0, 0.2),
                rgba(0, 0, 0, 0.2) 30%,
                rgba(0, 0, 0, 0));
        box-shadow:
            inset 2px 2px 3px rgba(255, 255, 255, 0.6),
            inset -2px -2px 3px rgba(0, 0, 0, 0.6);
    }

    .button-container p:active,
    button:active {
        box-shadow:
            inset -2px -2px 3px rgba(255, 255, 255, 0.6),
            inset 2px 2px 3px rgba(0, 0, 0, 0.6);
    }

    ::placeholder {
        color: rgb(36, 192, 127);
        letter-spacing: 25px;
        font-size: 15px;
    }

    #mask {
        width: 100%;
        background-image: url('file:///D:/img/原神.jpg');
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-size: 100% 100%;
        z-index: 99;
        padding: 20px;
        text-shadow: 1px 1px 1px #100000;
    }

    .img-responsive {
        position: absolute;
        width: 200px;
        top: 77px;
        right: 553px;
    }

    .translation p {
        display: inline-block;
    }
</style>

<body>
    <div class="wrapper">
        <div class="container">
            <div class="welcome-box">
                <h1>欢迎</h1>
                <p>加入我们!</p>
                <div class="image-container">
                    <img src="file:///D:/img/空.png" alt="正方形图片">
                </div>
            </div>
            <div class="registration-container">
                <div class="title-container">
                    <h1>注册</h1>
                </div>
                <div class="input-group">
                    <input type="text" id="reg-username" placeholder="用户名">
                    <input type="password" id="reg-password" placeholder="密码">
                    <input type="password" id="reg-confirm-password" placeholder="确认密码">
                </div>
                <div class="button-container">
                    <button class="register-btn" onclick="register()">注册</button>
                    <p onclick="mySwitch()">已有账号?去登录</p>
                </div>
            </div>
            <div class="form-container">
                <div class="title-container">
                    <h1>登录</h1>
                </div>
                <div class="input-group">
                    <input type="text" id="login-username" placeholder="用户名">
                    <input type="password" id="login-password" placeholder="密码">
                </div>
                <div class="button-container">
                    <button onclick="login()">登录</button>
                    <p onclick="mySwitch()">没有账号?去注册</p>
                </div>
            </div>
        </div>
    </div>
    <div style="display:none" id="mask">
        <div style="width: 100%; text-align: center; margin: auto;">
            <h1>欢迎来到受保护的页面</h1> <button onclick="document.getElementById('mask').style.display='none'"
                style="background-color: #f56c6c; border: none; border-radius: 5px;  cursor: pointer;float: right;">退出登录</button>
            <p>这里是您想要保护的内容。</p>
            <div>
                <h2>
                    <div style="user-select: text; color: rgb(255, 250, 250); font-size: 20px; text-align: center;">
                        <div
                            style="color: rgb(250, 213, 1);display:inline-block; background-color: rgba(31, 31, 31, 0.5); backdrop-filter: blur(4px); text-align: center; padding: 10px; border-radius: 8px;">
                            <div>小时候爱吃西红柿</div>
                            <div>以为会一辈子爱吃</div>
                            <div>等到长大不爱吃了就是不爱吃了</div>
                            <div>没有理由,我没有错</div>
                            <div>西红柿也没有错</div>
                            <div>错的只是那些自以为是的一辈子</div>
                        </div>
                    </div>
                    <div style="user-select: text;" class="translation">
                        <p
                            style="color: #f56c6c; backdrop-filter: blur(4px); background-color: rgba(31, 31, 31, 0.5); padding: 5px; border-radius: 5px;">
                            十年生死两茫茫,不思量,自难忘。千里孤坟,无处话凄凉。纵使相逢应不识,尘满面,鬓如霜。</p>
                        <p
                            style="color: #f56c6c; backdrop-filter: blur(4px); background-color: rgba(31, 31, 31, 0.5); padding: 5px; border-radius: 5px;">
                            夜来幽梦忽还乡,小轩窗,正梳妆。相顾无言,惟有泪千行。料得年年肠断处,明月夜,短松冈。</p>
                        <h3 style="color: #67c23a;">译文</h3>
                        <p
                            style="color: #e6a23c; backdrop-filter: blur(4px); background-color: rgba(31, 31, 31, 0.5); padding: 5px; border-radius: 5px;">
                            你我夫妻诀别已经整整十年,强忍不去思念可终究难以忘怀。你的坟墓远在千里之外,没有地方能诉说我心中的悲伤凄凉。即使你我夫妻相逢怕是也认不出我来了,我四处奔波早已是灰尘满面两鬓如霜。
                        </p>
                        <p
                            style="color: #e6a23c; backdrop-filter: blur(4px); background-color: rgba(31, 31, 31, 0.5); padding: 5px; border-radius: 5px;">
                            昨夜在梦中回到了家乡,看见你正在小室的窗前对镜梳妆。你我二人默默相对无言,只有泪落千行。料想你年年都为我柔肠寸断,在那凄冷的月明之夜,在那长满矮松的山冈上。
                        </p>
                    </div>
                </h2>
                <img src="file:///D:/img/我来了.jpg" alt="我来了" class="img-responsive">
            </div>
        </div>
        <script>
            let flag = true;
            const users = [
                { username: "admin", password: "admin123" }, // 添加管理员账户
                { username: "2", password: "2" } // 添加管理员测试账户
            ]; // 存储用户信息的数组
            const mySwitch = () => {
                if (flag) {
                    $(".welcome-box").css({
                        "transform": "translateX(100%)",
                        "background-color": "rgb(170, 211, 244)",
                        "border-radius": "0 8px 8px 0" // 添加边框圆角
                    });
                    $("img").css("transform", "scale(1.3)"); // 这个图片有点小了,添加缩放效果
                    $("img").attr("src", "file:///D:/img/荧.png");
                } else {
                    $(".welcome-box").css({
                        "transform": "translateX(0%)",
                        "background-color": "rgb(225, 139, 166)",
                        "border-radius": "8px 0 0 8px" // 添加圆角效果
                    });
                    $("img").css("transform", "scale(1)"); // 这个图片返回原大小,添加缩放效果
                    $("img").attr("src", "file:///D:/img/空.png");
                }
                flag = !flag;
            }
            const register = () => {
                const username = document.getElementById("reg-username").value;
                const password = document.getElementById("reg-password").value;
                const confirmPassword = document.getElementById("reg-confirm-password").value;
                // 检查账号和密码是否为空
                if (!username || !password) {
                    alert("账号和密码不能为空!");
                    return;
                }
                if (password !== confirmPassword) {
                    alert("密码不匹配!");
                    return;
                }
                // 检查用户名是否已存在
                const userExists = users.some(user => user.username === username);
                if (userExists) {
                    alert("用户名已存在,请选择其他用户名!");
                    return;
                }
                // 注册用户
                users.push({ username, password });
                alert("注册成功,请登录!");
                mySwitch(); // 切换到登录界面
            }
            const login = () => {
                const username = document.getElementById("login-username").value;
                const password = document.getElementById("login-password").value;
                // 验证用户信息
                const user = users.find(user => user.username === username && user.password === password);
                if (user) {
                    alert("登录成功!");
                    // 显示受保护的页面
                    document.getElementById("mask").style.display = "block"; // 显示内容
                    document.querySelector('.wrapper').style.display = "none"; // 隐藏注册和登录盒子
                    document.querySelector('.img-responsive').src = "file:///D:/img/我来了.jpg"; // 更新图片路径
                } else {
                    alert("用户名或密码错误!");
                }
            }
        </script>
</body>

</html>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2189694.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

RC正弦波振荡电路

0、判断电路能否产生正弦波震荡的条件 如上图所示&#xff0c; Xo:输出量&#xff1b; A:放大器的增益&#xff1b; F:反馈系数。 上式分别为RC正弦波震荡器的幅值条件和相位条件&#xff0c;为了使输出量在合闸后能够有一个从小到大直至平衡在一定幅值的过程&#xff0c;电…

《Linux服务与安全管理》| 配置YUM源并验证

《Linux服务与安全管理》配置YUM源并验证 目录 《Linux服务与安全管理》配置YUM源并验证 任务一&#xff1a;配置本地YUM源 任务二&#xff1a;配置网络YUM源 学生姓名 **** 学号 **** 专业 **** 任务名称 配置YUM源并验证 完成日期 **** 任务目标 知识 了解配…

docker安装kafka-manager

kafkamanager docker安装_mob64ca12d80f3a的技术博客_51CTO博客 # 1、拉取镜像及创建容器 docker pull hlebalbau/kafka-manager docker run -d --name kafka-manager -p 9000:9000 --networkhost hlebalbau/kafka-manager# 2、增设端口 腾讯云# 3、修改防火墙 sudo firewall-…

Salesforce AI 推全新大语言模型评估家族SFR-Judge 基于Llama3构建

在自然语言处理领域&#xff0c;大型语言模型&#xff08;LLMs&#xff09;的发展迅速&#xff0c;已经在多个领域取得了显著的进展。不过&#xff0c;随着模型的复杂性增加&#xff0c;如何准确评估它们的输出就变得至关重要。传统上&#xff0c;我们依赖人类来进行评估&#…

【目标检测】yolo的三种数据集格式

目标检测中数据集格式之间的相互转换--coco、voc、yolohttps://zhuanlan.zhihu.com/p/461488682?utm_mediumsocial&utm_psn1825483604463071232&utm_sourcewechat_session【目标检测】yolo的三种数据集格式https://zhuanlan.zhihu.com/p/525950939?utm_mediumsocial&…

Python小示例——质地不均匀的硬币概率统计

在概率论和统计学中&#xff0c;随机事件的行为可以通过大量实验来研究。在日常生活中&#xff0c;我们经常用硬币进行抽样&#xff0c;比如抛硬币来决定某个结果。然而&#xff0c;当我们处理的是“质地不均匀”的硬币时&#xff0c;事情就变得复杂了。质地不均匀的硬币意味着…

【宽搜】4. leetcode 103 二叉树的锯齿形层序遍历

1 题目描述 题目链接&#xff1a;二叉树的锯齿形层序遍历 2 题目解析 根据题目描述&#xff0c;第一行是从左往右遍历&#xff0c;第二行是从右往左遍历。和层序遍历的区别就是&#xff1a; 在偶数行需要从右往左遍历。 因此&#xff0c;只需要在层序遍历的基础上增加一个变…

网络基础:TCP/IP五层模型、数据在局域网传输和跨网络传输的基本流程、IP地址与MAC地址的简单解析

目录 背景介绍 网络协议 OSI七层模型 TCP/IP五层模型 TCP/IP协议与OS的关系 网络协议的本质 数据在局域网传输的基本流程 MAC地址 报文的封装和解包 补充内容 数据的跨网络传输基本流程 IP地址 IP地址和MAC地址的区别 ​​​ 背景介绍 网络的发展经理了四个阶段…

dijstra算法——单元最短路径算法

Dijkstra算法 用来计算从一个点到其他所有点的最短路径的算法&#xff0c;是一种单源最短路径算法。也就是说&#xff0c;只能计算起点只有一个的情况。Dijkstra的时间复杂度是O(n^2)&#xff0c;它不能处理存在负边权的情况。 算法描述&#xff1a; 设起点为s&#xff0c;d…

云原生(四十六) | MySQL软件安装部署

文章目录 MySQL软件安装部署 一、MySQL软件部署步骤 二、安装MySQL MySQL软件安装部署 一、MySQL软件部署步骤 第一步&#xff1a;删除系统自带的mariadb 第二步&#xff1a;下载MySQL源&#xff0c;安装MySQL软件 第三步&#xff1a;启动MySQL&#xff0c;获取默认密码…

【无标题】提升快递管理效率的必备技能:教你批量查询与导出物流信息

在当今快节奏的商业环境中&#xff0c;快递与物流行业的效率直接关系到企业的运营成本和客户满意度。随着订单量的不断增加&#xff0c;如何高效地管理和追踪大量的物流信息成为了企业面临的一大挑战。批量查询与导出物流信息作为一种高效的数据处理手段&#xff0c;正逐渐成为…

信息安全工程师(33)访问控制概述

前言 访问控制是信息安全领域中至关重要的一个环节&#xff0c;它提供了一套方法&#xff0c;旨在限制用户对某些信息项或资源的访问权限&#xff0c;从而保护系统和数据的安全。 一、定义与目的 定义&#xff1a;访问控制是给出一套方法&#xff0c;将系统中的所有功能和数据…

ElliQ 老年身边的陪伴

前记 国庆回家发现爸爸之前干活脚崴了&#xff0c;找个临时拐杖撑住&#xff0c;我心里很不是滋味。虽然总和爸妈说&#xff0c;不要干重活&#xff0c;但老人总是担心成为儿女的负担&#xff0c;所以只要能动&#xff0c;就找活干。 给爸妈一点零花钱&#xff0c;老妈只收了…

多系统萎缩患者的运动指南【健康守护,动出希望】

亲爱的朋友们&#xff0c;今天我们来聊聊一个特别而重要的话题——多系统萎缩患者的运动指南。面对这一挑战&#xff0c;适量的运动不仅能缓解病情&#xff0c;还能提升生活质量。让我们一起&#xff0c;用爱与坚持&#xff0c;为生命加油&#xff01; &#x1f308; ‌为什么…

Linux系统字符命令关机方法对比

一、相同点&#xff1a;都可以达到关机或重启系统的目的。 二、不同点&#xff1a;命令内部的工作过程不同。 1、shutdown 安全的关机命令&#xff1a;系统管理员会通知所有登录的用户系统将要关闭且 login 指令会被冻结&#xff0c;即新的用户不能再登录。根据使用的参数不同…

Spring Boot RESTful API开发教程

一、RESTful API简介 RESTful API是一种基于HTTP协议的Web API&#xff0c;其设计原则是简单、可扩展、轻量级、可缓存、可靠、可读性强。RESTful API通常使用HTTP请求方法&#xff08;GET、POST、PUT、DELETE等&#xff09;来操作资源&#xff0c;使用HTTP状态码来表示操作结…

SysML案例-电磁轨道炮

DDD领域驱动设计批评文集>> 《软件方法》强化自测题集>> 《软件方法》各章合集>> 图片示例摘自intercax.com&#xff0c;作者是Intercax公司总裁Dirk Zwemer博士。

【需求分析】软件系统需求设计报告,需求分析报告,需求总结报告(原件PPT)

第1章 序言 第2章 引言 2.1 项目概述 2.1.1 项目背景 2.1.2 项目目标 2.2 编写目的 2.3 文档约定 2.4 预期读者及阅读建议 第3章 技术要求 3.1 软件开发要求 3.1.1 接口要求 3.1.2 系统专有技术 3.1.3 查询功能 3.1.4 数据安全 3.1.5 可靠性要求 3.1.6 稳定性要求 3.1.7 安全性…

车载入行:HIL测试、功能安全测试、CAN一致性测试、UDS测试、ECU测试、OTA测试、TBOX测试、导航测试、车控测试

FOTA模块中OTA的知识点&#xff1a;1.测试过程中发现哪几类问题&#xff1f; 可能就是一个单键的ecu&#xff0c;比如升了一个门的ecu&#xff0c;他的升了之后就关不上&#xff0c;还有就是升级组合ecu的时候&#xff0c;c屏上不显示进度条。 2.在做ota测试的过程中&#xff…

【Python】Streamlit:为数据科学与机器学习打造的简易应用框架

Streamlit 是一个开源的 Python 库&#xff0c;专为数据科学家和机器学习开发者设计&#xff0c;旨在快速构建数据应用。通过简单的 Python 脚本&#xff0c;开发者无需掌握前端技术&#xff0c;即可将数据分析和模型结果转化为直观、交互式的 Web 应用。其简洁的 API 设计使得…