# 登录页模板
# 可选1

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*,
*::before,
*::after {
box-sizing: border-box;
}
body {
margin: 0;
font-family: Roboto, -apple-system, 'Helvetica Neue', 'Segoe UI', Arial, sans-serif;
background: #3b4465;
}
.forms-section {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.section-title {
font-size: 32px;
letter-spacing: 1px;
color: #fff;
}
.forms {
display: flex;
align-items: flex-start;
margin-top: 30px;
}
.form-wrapper {
animation: hideLayer .3s ease-out forwards;
}
.form-wrapper.is-active {
animation: showLayer .3s ease-in forwards;
}
@keyframes showLayer {
50% {
z-index: 1;
}
100% {
z-index: 1;
}
}
@keyframes hideLayer {
0% {
z-index: 1;
}
49.999% {
z-index: 1;
}
}
.switcher {
position: relative;
cursor: pointer;
display: block;
margin-right: auto;
margin-left: auto;
padding: 0;
text-transform: uppercase;
font-family: inherit;
font-size: 16px;
letter-spacing: .5px;
color: #999;
background-color: transparent;
border: none;
outline: none;
transform: translateX(0);
transition: all .3s ease-out;
}
.form-wrapper.is-active .switcher-login {
color: #fff;
transform: translateX(90px);
}
.form-wrapper.is-active .switcher-signup {
color: #fff;
transform: translateX(-90px);
}
.underline {
position: absolute;
bottom: -5px;
left: 0;
overflow: hidden;
pointer-events: none;
width: 100%;
height: 2px;
}
.underline::before {
content: '';
position: absolute;
top: 0;
left: inherit;
display: block;
width: inherit;
height: inherit;
background-color: currentColor;
transition: transform .2s ease-out;
}
.switcher-login .underline::before {
transform: translateX(101%);
}
.switcher-signup .underline::before {
transform: translateX(-101%);
}
.form-wrapper.is-active .underline::before {
transform: translateX(0);
}
.form {
overflow: hidden;
min-width: 260px;
margin-top: 50px;
padding: 30px 25px;
border-radius: 5px;
transform-origin: top;
}
.form-login {
animation: hideLogin .3s ease-out forwards;
}
.form-wrapper.is-active .form-login {
animation: showLogin .3s ease-in forwards;
}
@keyframes showLogin {
0% {
background: #d7e7f1;
transform: translate(40%, 10px);
}
50% {
transform: translate(0, 0);
}
100% {
background-color: #fff;
transform: translate(35%, -20px);
}
}
@keyframes hideLogin {
0% {
background-color: #fff;
transform: translate(35%, -20px);
}
50% {
transform: translate(0, 0);
}
100% {
background: #d7e7f1;
transform: translate(40%, 10px);
}
}
.form-signup {
animation: hideSignup .3s ease-out forwards;
}
.form-wrapper.is-active .form-signup {
animation: showSignup .3s ease-in forwards;
}
@keyframes showSignup {
0% {
background: #d7e7f1;
transform: translate(-40%, 10px) scaleY(.8);
}
50% {
transform: translate(0, 0) scaleY(.8);
}
100% {
background-color: #fff;
transform: translate(-35%, -20px) scaleY(1);
}
}
@keyframes hideSignup {
0% {
background-color: #fff;
transform: translate(-35%, -20px) scaleY(1);
}
50% {
transform: translate(0, 0) scaleY(.8);
}
100% {
background: #d7e7f1;
transform: translate(-40%, 10px) scaleY(.8);
}
}
.form fieldset {
position: relative;
opacity: 0;
margin: 0;
padding: 0;
border: 0;
transition: all .3s ease-out;
}
.form-login fieldset {
transform: translateX(-50%);
}
.form-signup fieldset {
transform: translateX(50%);
}
.form-wrapper.is-active fieldset {
opacity: 1;
transform: translateX(0);
transition: opacity .4s ease-in, transform .35s ease-in;
}
.form legend {
position: absolute;
overflow: hidden;
width: 1px;
height: 1px;
clip: rect(0 0 0 0);
}
.input-block {
margin-bottom: 20px;
}
.input-block label {
font-size: 14px;
color: #a1b4b4;
}
.input-block input {
display: block;
width: 100%;
margin-top: 8px;
padding-right: 15px;
padding-left: 15px;
font-size: 16px;
line-height: 40px;
color: #3b4465;
background: #eef9fe;
border: 1px solid #cddbef;
border-radius: 2px;
}
.form [type='submit'] {
opacity: 0;
display: block;
min-width: 120px;
margin: 30px auto 10px;
font-size: 18px;
line-height: 40px;
border-radius: 25px;
border: none;
transition: all .3s ease-out;
}
.form-wrapper.is-active .form [type='submit'] {
opacity: 1;
transform: translateX(0);
transition: all .4s ease-in;
}
.btn-login {
color: #fbfdff;
background: #a7e245;
transform: translateX(-30%);
}
.btn-signup {
color: #a7e245;
background: #fbfdff;
box-shadow: inset 0 0 0 2px #a7e245;
transform: translateX(30%);
}
</style>
</head>
<body>
<section class="forms-section">
<h1 class="section-title">Animated Forms</h1>
<div class="forms">
<div class="form-wrapper is-active">
<button type="button" class="switcher switcher-login">
登录
<span class="underline"></span>
</button>
<form class="form form-login">
<fieldset>
<legend>Please, enter your email and password for login.</legend>
<div class="input-block">
<label for="login-email">E-mail</label>
<input id="login-email" type="email" required>
</div>
<div class="input-block">
<label for="login-password">Password</label>
<input id="login-password" type="password" required>
</div>
</fieldset>
<button type="submit" class="btn-login">Login</button>
</form>
</div>
<div class="form-wrapper">
<button type="button" class="switcher switcher-signup">
注册
<span class="underline"></span>
</button>
<form class="form form-signup">
<fieldset>
<legend>Please, enter your email, password and password confirmation for sign up.</legend>
<div class="input-block">
<label for="signup-email">E-mail</label>
<input id="signup-email" type="email" required>
</div>
<div class="input-block">
<label for="signup-password">Password</label>
<input id="signup-password" type="password" required>
</div>
<div class="input-block">
<label for="signup-password-confirm">Confirm password</label>
<input id="signup-password-confirm" type="password" required>
</div>
</fieldset>
<button type="submit" class="btn-signup">Continue</button>
</form>
</div>
</div>
</section>
</body>
<script src="https://cdn.staticfile.net/jquery/1.10.2/jquery.min.js"></script>
<script>
const switchers = [...document.querySelectorAll('.switcher')]
switchers.forEach(item => {
item.addEventListener('click', function () {
switchers.forEach(item => item.parentElement.classList.remove('is-active'))
this.parentElement.classList.add('is-active')
})
})
</script>
</html>
# 可选2

<!DOCTYPE html>
<html>
<head>
<title>Slide Navbar</title>
<link rel="stylesheet" type="text/css" href="slide navbar style.css">
<link href="https://fonts.googleapis.com/css2?family=Jost:wght@500&display=swap" rel="stylesheet">
<style>
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
font-family: 'Jost', sans-serif;
background: linear-gradient(to bottom, #0f0c29, #302b63, #24243e);
}
.main {
width: 350px;
height: 500px;
background: red;
overflow: hidden;
background: url("https://doc-08-2c-docs.googleusercontent.com/docs/securesc/68c90smiglihng9534mvqmq1946dmis5/fo0picsp1nhiucmc0l25s29respgpr4j/1631524275000/03522360960922298374/03522360960922298374/1Sx0jhdpEpnNIydS4rnN4kHSJtU1EyWka?e=view&authuser=0&nonce=gcrocepgbb17m&user=03522360960922298374&hash=tfhgbs86ka6divo3llbvp93mg4csvb38") no-repeat center/ cover;
border-radius: 10px;
box-shadow: 5px 20px 50px #000;
}
#chk {
display: none;
}
.signup {
position: relative;
width: 100%;
height: 100%;
}
label {
color: #fff;
font-size: 2.3em;
justify-content: center;
display: flex;
margin: 50px;
font-weight: bold;
cursor: pointer;
transition: .5s ease-in-out;
}
input {
width: 60%;
height: 10px;
background: #e0dede;
justify-content: center;
display: flex;
margin: 20px auto;
padding: 12px;
border: none;
outline: none;
border-radius: 5px;
}
button {
width: 60%;
height: 40px;
margin: 10px auto;
justify-content: center;
display: block;
color: #fff;
background: #573b8a;
font-size: 1em;
font-weight: bold;
margin-top: 30px;
outline: none;
border: none;
border-radius: 5px;
transition: .2s ease-in;
cursor: pointer;
}
button:hover {
background: #6d44b8;
}
.login {
height: 460px;
background: #eee;
border-radius: 60% / 10%;
transform: translateY(-180px);
transition: .8s ease-in-out;
}
.login label {
color: #573b8a;
transform: scale(.6);
}
#chk:checked~.login {
transform: translateY(-500px);
}
#chk:checked~.login label {
transform: scale(1);
}
#chk:checked~.signup label {
transform: scale(.6);
}
</style>
</head>
<body>
<div class="main">
<input type="checkbox" id="chk" aria-hidden="true">
<div class="signup">
<form>
<label for="chk" aria-hidden="true">没有账号?</label>
<input type="text" name="txt" placeholder="User name" required="">
<input type="email" name="email" placeholder="Email" required="">
<input type="number" name="broj" placeholder="BrojTelefona" required="">
<input type="password" name="pswd" placeholder="Password" required="">
<button>注册</button>
</form>
</div>
<div class="login">
<form>
<label for="chk" aria-hidden="true">已有账号</label>
<input type="email" name="email" placeholder="Email" required="">
<input type="password" name="pswd" placeholder="Password" required="">
<button>登录</button>
</form>
</div>
</div>
</body>
</html>
# 可选3

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<title>Document</title>
<style>
@import url(https://fonts.googleapis.com/css?family=Roboto:300);
.login-page {
width: 360px;
padding: 8% 0 0;
margin: auto;
}
.form {
position: relative;
z-index: 1;
background: #FFFFFF;
max-width: 360px;
margin: 0 auto 100px;
padding: 45px;
text-align: center;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
.form input {
font-family: "Roboto", sans-serif;
outline: 0;
background: #f2f2f2;
width: 100%;
border: 0;
margin: 0 0 15px;
padding: 15px;
box-sizing: border-box;
font-size: 14px;
}
.form button {
font-family: "Roboto", sans-serif;
text-transform: uppercase;
outline: 0;
background: #4CAF50;
width: 100%;
border: 0;
padding: 15px;
color: #FFFFFF;
font-size: 14px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
}
.form button:hover,
.form button:active,
.form button:focus {
background: #43A047;
}
.form .message {
margin: 15px 0 0;
color: #b3b3b3;
font-size: 12px;
}
.form .message a {
color: #4CAF50;
text-decoration: none;
}
.form .register-form {
display: none;
}
.container {
position: relative;
z-index: 1;
max-width: 300px;
margin: 0 auto;
}
.container:before,
.container:after {
content: "";
display: block;
clear: both;
}
.container .info {
margin: 50px auto;
text-align: center;
}
.container .info h1 {
margin: 0 0 15px;
padding: 0;
font-size: 36px;
font-weight: 300;
color: #1a1a1a;
}
.container .info span {
color: #4d4d4d;
font-size: 12px;
}
.container .info span a {
color: #000000;
text-decoration: none;
}
.container .info span .fa {
color: #EF3B3A;
}
body {
background: #76b852;
/* fallback for old browsers */
background: rgb(141, 194, 111);
background: linear-gradient(90deg, rgba(141, 194, 111, 1) 0%, rgba(118, 184, 82, 1) 50%);
font-family: "Roboto", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
</style>
</head>
<body>
<div class="login-page">
<div class="form">
<form class="register-form">
<input type="text" placeholder="name" />
<input type="password" placeholder="password" />
<input type="text" placeholder="email address" />
<button>create</button>
<p class="message">Already registered? <a href="#">Sign In</a></p>
</form>
<form class="login-form">
<input type="text" placeholder="username" />
<input type="password" placeholder="password" />
<button>login</button>
<p class="message">Not registered? <a href="#">Create an account</a></p>
</form>
</div>
</div>
</body>
<script>
$('.message a').click(function () {
$('form').animate({ height: "toggle", opacity: "toggle" }, "slow");
});
</script>
</html>