分享两个有意思的登录界面

news/2025/3/14 5:42:24/

1.带有浮动占位符和灯光按钮的登录界面
先上效果:
在这里插入图片描述
代码如下:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Title</title><style>html {height: 100%;}body {margin:0;padding:0;font-family: sans-serif;background: linear-gradient(#141e30, #243b55);}.login-box {position: absolute;top: 50%;left: 50%;width: 400px;padding: 40px;transform: translate(-50%, -50%);background: rgba(0,0,0,.5);box-sizing: border-box;box-shadow: 0 15px 25px rgba(0,0,0,.6);border-radius: 10px;}.login-box h2 {margin: 0 0 30px;padding: 0;color: #fff;text-align: center;}.login-box .user-box {position: relative;}.login-box .user-box input {width: 100%;padding: 10px 0;font-size: 16px;color: #fff;margin-bottom: 30px;border: none;border-bottom: 1px solid #fff;outline: none;background: transparent;}.login-box .user-box label {position: absolute;top:0;left: 0;padding: 10px 0;font-size: 16px;color: #fff;pointer-events: none;transition: .5s;}.login-box .user-box input:focus ~ label,.login-box .user-box input:valid ~ label {top: -20px;left: 0;color: #03e9f4;font-size: 12px;}.login-box form a {position: relative;display: inline-block;padding: 10px 20px;color: #03e9f4;font-size: 16px;text-decoration: none;text-transform: uppercase;overflow: hidden;transition: .5s;margin-top: 40px;letter-spacing: 4px}.login-box a:hover {background: #03e9f4;color: #fff;border-radius: 5px;box-shadow: 0 0 5px #03e9f4,0 0 25px #03e9f4,0 0 50px #03e9f4,0 0 100px #03e9f4;}.login-box a span {position: absolute;display: block;}.login-box a span:nth-child(1) {top: 0;left: -100%;width: 100%;height: 2px;background: linear-gradient(90deg, transparent, #03e9f4);animation: btn-anim1 1s linear infinite;}@keyframes btn-anim1 {0% {left: -100%;}50%,100% {left: 100%;}}.login-box a span:nth-child(2) {top: -100%;right: 0;width: 2px;height: 100%;background: linear-gradient(180deg, transparent, #03e9f4);animation: btn-anim2 1s linear infinite;animation-delay: .25s}@keyframes btn-anim2 {0% {top: -100%;}50%,100% {top: 100%;}}.login-box a span:nth-child(3) {bottom: 0;right: -100%;width: 100%;height: 2px;background: linear-gradient(270deg, transparent, #03e9f4);animation: btn-anim3 1s linear infinite;animation-delay: .5s}@keyframes btn-anim3 {0% {right: -100%;}50%,100% {right: 100%;}}.login-box a span:nth-child(4) {bottom: -100%;left: 0;width: 2px;height: 100%;background: linear-gradient(360deg, transparent, #03e9f4);animation: btn-anim4 1s linear infinite;animation-delay: .75s}@keyframes btn-anim4 {0% {bottom: -100%;}50%,100% {bottom: 100%;}}</style>
</head>
<body>
<div class="login-box"><h2>Login</h2><form><div class="user-box"><input type="text" name="" required=""><label>Username</label></div><div class="user-box"><input type="password" name="" required=""><label>Password</label></div><a href="#"><span></span><span></span><span></span><span></span>Submit</a></form>
</div>
</body>
</html>

2.跳跃的登录字符登陆界面
先上效果:
在这里插入图片描述
代码如下:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><link rel="stylesheet" href="style.css" /><title>Form Input Wave</title><style>@import url('https://fonts.googleapis.com/css?family=Muli&display=swap');* {box-sizing: border-box;}body {background-color: steelblue;color: #fff;font-family: 'Muli', sans-serif;display: flex;flex-direction: column;align-items: center;justify-content: center;height: 100vh;overflow: hidden;margin: 0;}.container {background-color: rgba(0, 0, 0, 0.4);padding: 20px 40px;border-radius: 5px;}.container h1 {text-align: center;margin-bottom: 30px;}.container a {text-decoration: none;color: lightblue;}.btn {cursor: pointer;display: inline-block;width: 100%;background: lightblue;padding: 15px;font-family: inherit;font-size: 16px;border: 0;border-radius: 5px;}.btn:focus {outline: 0;}.btn:active {transform: scale(0.98);}.text {margin-top: 30px;}.form-control {position: relative;margin: 20px 0 40px;width: 300px;}.form-control input {background-color: transparent;border: 0;border-bottom: 2px #fff solid;display: block;width: 100%;padding: 15px 0;font-size: 18px;color: #fff;}.form-control input:focus,.form-control input:valid {outline: 0;border-bottom-color: lightblue;}.form-control label {position: absolute;top: 15px;left: 0;pointer-events: none;}.form-control label span {display: inline-block;font-size: 18px;min-width: 5px;transition: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);}.form-control input:focus + label span,.form-control input:valid + label span {color: lightblue;transform: translateY(-30px);}</style>
</head>
<body>
<div class="container"><h1>Please Login</h1><form><div class="form-control"><input type="text" required><label>Email</label><!-- <label><span style="transition-delay: 0ms">E</span><span style="transition-delay: 50ms">m</span><span style="transition-delay: 100ms">a</span><span style="transition-delay: 150ms">i</span><span style="transition-delay: 200ms">l</span></label> --></div><div class="form-control"><input type="password" required><label>Password</label></div><button class="btn">Login</button><p class="text">Don't have an account? <a href="#">Register</a> </p></form>
</div>
<script>const labels = document.querySelectorAll('.form-control label')labels.forEach(label => {label.innerHTML = label.innerText.split('').map((letter, idx) => `<span style="transition-delay:${idx * 50}ms">${letter}</span>`).join('')})
</script>
</body>
</html>

http://www.ppmy.cn/news/57075.html

相关文章

ClickHouse的资料

官方 项目主页官方文档代码仓库技术资料 专栏 BigData魔法盒 帖子 【ClickHouse 技术系列】- ClickHouse 中的嵌套数据结构硬核优化 - SIMD 在ClickHouse中的应用ClickHouse 设计模式与实践ClickHouse 源码解析: 综述ClickHouse 源码解析: MergeTree Write-PathClickHouse…

ID3算法报告理解笔记

专有名词解释&#xff1a; 决策树&#xff1a;决策树是根据已知若干条件&#xff0c;来对事件做出判断。从根节点到叶子结点。自上而下生成&#xff0c;每个决策或事件都可能引发两个或多个事件。将这些事件根据不同的特征进行划分&#xff0c;最后将类别分出&#xff0c;得到…

vue3如果用setup写如何获取类似于vue2中的this

Vue 3 是一款用于构建用户界面的 JavaScript 框架。 在 Vue 3 中&#xff0c;SFC&#xff08;Single File Component&#xff09;的 API 风格发生了变化&#xff0c;新增了 setup 函数而废弃了之前版本的 options API。setup 函数被认为是 Vue 3 的精华所在&#xff0c;它可以让…

FPGA中有限状态机的状态编码采用格雷码还是独热码?

有限状态机是由寄存器组和组合逻辑构成的硬件时序电路&#xff0c;其状态&#xff08;即由寄存器组的1和0的组合状态所构成的有限个状态&#xff09;只可能在同一时钟跳变沿的情况下才能从一个状态转向另一个状态&#xff0c;究竟转向哪一状态还是留在原状态不但取决于各个输入…

07 KVM虚拟机引导固件安装

文章目录 07 KVM虚拟机引导固件安装7.1 概述7.2 安装方法7.2.1 安装edk软件包7.2.2 查询edk软件是否安装成功 07 KVM虚拟机引导固件安装 7.1 概述 针对不同的架构&#xff0c;引导的方式有所差异。x86支持UEFI&#xff08;Unified Extensible Firmware Interface&#xff09;…

JavaWeb之过滤器Filter(通俗易懂版)

今天开发遇到了&#xff0c;简单记录一下&#xff01; 简介&#xff1a;Filter是JavaWeb三大组件之一&#xff08;Servlet程序、Listener监听器、Filter过滤器&#xff09; 作用&#xff1a;既可以对请求进行拦截&#xff0c;也可以对响应进行处理。 1、Filter中的三个方法 …

Maven 笔记

1. Maven 的简介 1.1 简介 Maven 这个词可以翻译为"专家","内行"。作为Apache 组织中的一个开源项目&#xff0c;主要服务于基于java平台的项目构建&#xff0c;依赖管理和项目信息管理。 无论是小型的开源类库项目&#xff0c;还是大型的企业级应用&am…

第十八章 协程

我们知道脚本都是继承自MonoBehaviour类&#xff0c;而其中的Update方法里面放置了大部分的游戏逻辑处理代码。Update方法是游戏循环的每一帧都去执行&#xff0c;这就要求我们的代码“无时无刻”不在处理所有的可能发生的情况&#xff0c;并做出相应的处理。如果我们想要完成“…