卡通锁登录页面

代码语言:html

所属分类:表单美化

代码描述:卡通锁登录页面

代码标签: 页面

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
*,
*:after,
*:before {
  box-sizing: border-box;
}
:root {
  --transition: 0.2;
  --bg-one: #0f0514;
  --bg-two: #320449;
  --stop: 40;
  --angle: 45;
  --border-width: 5;
  --padlock-size: 300;
  --border-radius: 6;
}
body {
  -webkit-box-align: center;
          align-items: center;
  display: -webkit-box;
  display: flex;
  -webkit-box-pack: center;
          justify-content: center;
  min-height: 100vh;
  font-family: sans-serif;
  background: -webkit-gradient(linear, left top, left bottom, from(calc(var(--angle) * 1deg)), color-stop(var(--bg-one)), to(var(--bg-two)));
  background: linear-gradient(calc(var(--angle) * 1deg), var(--bg-one) calc(var(--stop) * 1%), var(--bg-two) calc(var(--stop) * 1%));
}
form {
  display: grid;
  grid-template-columns: auto;
  grid-gap: 0.5rem 1rem;
  justify-items: center;
  position: relative;
}
[type='password'] {
  padding: 12px 20px;
  font-size: 1rem;
  border-width: calc(var(--border-width) * 1px);
  border-style: solid;
  border-color: var(--accent);
  border-radius: calc(var(--border-radius) * 1px);
  text-align: center;
  outline: transparent;
  width: 100%;
  -webkit-transition: border-color calc(var(--transition, 0.2) * 1s) ease;
  transition: border-color calc(var(--transition, 0.2) * 1s) ease;
}
[type='password']:valid {
  --accent: #5f0;
}
[type='password']:invalid {
  --accent: rgba(255,43,0,0.5);
}
[type='password']:placeholder-shown {
  --accent: #fff;
}
.app {
  height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  display: -webkit-box;
  display: flex;
  -webkit-box-align: center;
          align-items: center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
          flex-direction: column;
  -webkit-box-pack: center;
          justify-content: center;
  background: #f2f2f2;
  -webkit-transform: scale(var(--scale));
          transform: scale(var(--scale));
  -webkit-transition: -webkit-transform calc(var(--transition, 0.2) * 1s) ease;
  transition: -webkit-transform calc(var(--transition, 0.2) * 1s) ease;
  transition: transform calc(var(--transition, 0.2) * 1s) ease;
  transition: transform calc(var(--transition, 0.2) * 1s) ease, -webkit-transform calc(var(--transition, 0.2) * 1s) ease;
}
[for='password'],
#login {
  height: 0;
  width: 0;
  -webkit-transform: scale(0);
          transform: scale(0);
  position: absolute;
}
.logout-button {
  --size: 52;
  --lightness: 45;
  height: calc(var(--size) * 1px);
  padding: 12px 20px;
  text-transform: uppercase;
  font-weight: bold;
  color: #fff;
  background: hsl(10, 80%, calc(var(--lightness) * 1%));
  border: 0;
  border-radius: calc(var(--border-radius) * 1px);
  cursor: pointer;
}
.logout-button:hover {
  --lightness: 30;
}
.logout-button:active {
  --lightness: 20;
}
.login-button {
  --size: 52;
  --lightness: 45;
  -webkit-box-align: center;
          align-items: center;
  background: hsl(100, 80%, calc(var(--lightness) * 1%));
  border-radius: calc(var(--border-radius) * 1px);
  cursor: pointer;
  display: -webkit-box;
  display: flex;
  height: calc(var(--size) * 1px);
  -webkit-box-pack: center;
          justify-content: center;
  padding: 12px 20px;
  text-transform: uppercase;
  font-weight: bold;
  color: #fff;
  width: 100%;
  -webkit-transition: background calc(var(--transition, 0.2) * 1s) ease;
  transition: background calc(var(--transition, 0.2) * 1s) ease;
}
.login-button svg {
  -webkit-transform: translate(50%, 0);
          transform: translate(50%, 0);
}
.login-button * {
  cursor: pointer;
}
.login-button:hover {
  --lightness: 30;
}
.login-button:active {
  --lightness: 20;
}
.login-button svg {
  height: 24px;
  width: 24px;
}
.login-button svg path {
  fill: #fff;
}
.padlock {
  --hue: 65;
  --color: #ffd500;
  --color-one: #ffa200;
  --color-two: #fff;
  height: calc(var(--padlock-size) * 1px);
  width: calc(var(--padlock-size) * 1px);
  grid-row: 1;
  position: relative;
}
.padlock__body {
  border: 8px solid #000;
  border-radius: 20px;
  position: absolute;
  bottom: 10%;
  .........完整代码请登录后点击上方下载按钮下载查看

网友评论0