卡通锁登录页面

代码语言: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%;
  width: 66%;
  height: 46%;
  left: 50%;
  -webkit-transform: translate(-50%, 0);
          transform: translate(-50%, 0);
  background: var(--color);
  box-shadow: -30px 0 0px 0px var(--color-one) inset, 10px 0 0px 0px var(--color-two) inset;
}
.padlock__face {
  height: 25%;
  width: 40%;
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, 0);
          transform: translate(-50%, 0);
}
.padlock__eye {
  position: absolute;
  height: 15px;
  width: 15px;
  background: #000;
  top: 0;
  border-radius: 50%;
  -webkit-animation: blink 4s infinite linear;
          animation: blink 4s infinite linear;
}
.padlock__eye:after {
  content: '';
  height: 25%;
  width: 25%;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-100%, -100%);
          transform: translate(-100%, -100%);
}
.padlock__eye--left {
  left: 0;
}
.padlock__eye--right {
  right: 0;
}
@-webkit-keyframes blink {
  0%, 24%, 27%, 100% {
    -webkit-transform: scaleY(1);
            transform: scaleY(1);
  }
  25%, 26% {
    -webkit-transform: scaleY(0);
            transform: scaleY(0);
  }
}
@keyframes blink {
  0%, 24%, 27%, 100% {
    -webkit-transform: scaleY(1);
            transform: scaleY(1);
  }
  25%, 26% {
    -webkit-transform: scaleY(0);
            transform: scaleY(0);
  }
}
.padlock__mouth {
  width: 25%;
  height: 10px;
  position: absolute;
  bottom: 0;
  left: 50%;
  -webkit-transform: translate(-50%, 0);
          transform: translate(-50%, 0);
}
.padlock__mouth--one {
  background: #000;
  height: 5px;
  width: 40%;
  left: 45%;
  bottom: 25%;
  display: block;
}
.padlock__mouth--two,
.padlock__mouth--three {
  height: 24px;
  width: 20px;
  border-radius: 50%;
  bottom: 24%;
  background: transparent;
  -webkit-clip-path: inset(64% 0 0 0);
  clip-path: inset(64% 0 0 0);
  display: none;
  overflow: hidden;
}
.padlock__mouth--two:before,
.padlock__mouth--three:before {
  content: '';
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0