div+css实现大气登录注册表单页面代码

代码语言:html

所属分类:表单美化

代码描述:div+css实现大气登录注册表单页面代码,输入框和按钮有交互动画。

代码标签: div css 大气 登录 注册 表单 页面 代码

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

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
<style>
    @import url("https://fonts.googleapis.com/css?family=IBM+Plex+Sans:400,700");
html,
body {
  font-family: "IBM Plex Sans", linkMacSystemFont, San Francisco, Roboto, Helvetica Neue, Segoe UI, sans-serif;
  -webkit-text-size-adjust: 100%;
     -moz-text-size-adjust: 100%;
          text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

.container {
  background: #101010;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url(//repo.bfw.wiki/bfwrepo/icon/6056bf753c238.jpg);
  background-position: center;
  background-size: cover;
  padding: 60px 30px;
  min-height: 100vh;
  height: 100%;
  width: 100vw;
  overflow-y: auto;
}
.container:before {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(16, 16, 16, 0.4);
}

@-webkit-keyframes form-open {
  0% {
    -webkit-clip-path: polygon(0 20px, 20px 0, 20px 0, 20px 0, 0 20px, 0 20px);
            clip-path: polygon(0 20px, 20px 0, 20px 0, 20px 0, 0 20px, 0 20px);
  }
  50% {
    -webkit-clip-path: polygon(0 20px, 20px 0, 20px 0, 20px calc(100% - 20px), 0 100%, 0 100%);
            clip-path: polygon(0 20px, 20px 0, 20px 0, 20px calc(100% - 20px), 0 100%, 0 100%);
  }
  100% {
    -webkit-clip-path: polygon(0 20px, 20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
            clip-path: polygon(0 20px, 20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
  }
}

@keyframes form-open {
  0% {
    -webkit-clip-path: polygon(0 20px, 20px 0, 20px 0, 20px 0, 0 20px, 0 20px);
            clip-path: polygon(0 20px, 20px 0, 20px 0, 20px 0, 0 20px, 0 20px);
  }
  50% {
    -webkit-clip-path: polygon(0 20px, 20px 0, 20px 0, 20px calc(100% - 20px), 0 100%, 0 100%);
            clip-path: polygon(0 20px, 20px 0, 20px 0, 20px calc(100% - 20px), 0 100%, 0 100%);
  }
  100% {
    -webkit-clip-path: polygon(0 20px, 20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
            clip-path: polygon(0 20px, 20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
  }
}
@-webkit-keyframes fade-in {
  0% {
    opacity: 0;
    transform: translate3d(-16px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
@keyframes fade-in {
  0% {
    opacity: 0;
    transform: translate3d(-16px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.form {
  display: grid;
  grid-gap: 36px;
  align-items: center;
  justify-content: center;
  max-width: 400px;
  width: 100%;
  padding: 30px;
  overflow: hidden;
  -webkit-clip-path: polygon(0 20px, 20px 0, 20px 0, 20px 0, 0 20px, 0 20px);
          clip-path: polygon(0 20px, 20px 0, 20px 0, 20px 0, 0 20px, 0 20px);
  -webkit-animation: form-open 1s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.5s;
          animation: form-open 1s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.5s;
}
.form > * {
  position: relative;
  opacity: 0;
  -webkit-animation: fade-in 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
          animation: fade-in 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.form > *:nth-child(2) {
  -webkit-animation-delay: 1.2s;
          animation-delay: 1.2s;
}
.form > *:nth-child(3) {
  -webkit-animation-delay: 1.3s;
          animation-delay: 1.3s;
}
.form > *:nth-child(4) {
  -webkit-animation-delay: 1.4s;
          animation-delay: 1.4s;
}
.form > *:nth-child(5) {
  -webkit-animation-delay: 1.5s;
          animation-delay: 1.5s;
}
.form > *:nth-child(6) {
  -webkit-animation-delay: 1.6s;
          animation-delay: 1.6s;
}

.form__image {
  position: absolute;
  -webkit-animation: none;
          animation: none;
  opacity: 1;
  filter: blur(16px);
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(rgba(16, 16, 16, 0.8), rgba(16, 16, 16, 0.8)), url("https://res.cloudinary.com/dokf7npvg/image/upload/v1540355245/0jbUKoX.jpg");
  background-position: center;
  background-size: cover;
}

.form__logo {
  width: 80%;
  height: auto;
  justify-self: center;
}

.input {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input__element {
  border: 0;
  margin: 0;
  width: 100%;
  box-shadow: inset 0 -1px 0 0 rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.3);
  height: 46px;
  transition: box-shadow 0.4s ease;
  padding-left: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
}
.input__element:focus {
  box-shadow: inset 0 -2px 0 0 #fdee06;
  outline: none;
}

.input__label {
  font-size: 16px;
  position: absolute;
  left: 10px;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.input__element:not(:-moz-placeholder-shown) + .input__label {
  top: -16px;
  left: 0;
  font-size: 14px;
  transform: translate3d(0, -5px, 0);
}

.input__element:not(:-ms-input-placeholder) + .input__label {
  top: -16px;
  left: 0;
  font-size: 14px;
  transform: translate3d(0, -5px, 0);
}

.input__element:focus + .input__label,
.input__element:not(:placeholder-shown) + .input__label {
  top: -16px;
  left: 0;
  font-size: 14px;
  transform: translate3d(0, -5px, 0);
}

.button {
  background: #fdee06;
  border: 0;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  height: 50px;
  -webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
          clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  text-transform: uppercase;
  text-align: left;
  padding: 0 20px;
  cursor: pointer;
}
.button:focus {
  outline: none;
}
.button:before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: #22edfc;
  transform-origin: right;
  transform: scaleX(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.button:hover:before, .button:focus:before {
  transform-origin: left center;
  transform: scaleX(1);
}

.button:hover .button__icon,
.button:focus .button__icon {
  transform: translate3d(10px, -50%, 0);
}

.button__label {
  position: relative;
}

.button__icon {
  position: absolute;
  top: 50%;
  transform: translate3d(0, -50%, 0);
  right: 25px;
  width: 24px;
  height: 24px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.button__icon:before {
  content: "";
  height: 1px;
  width: 100%;
  background: black;
  position: absolute;
  left: 0;
  top: 12px;
}
.button__icon:after {
  content: "";
  transform: rotate(45deg);
  border-top: 1px solid black;
  border-right: 1px solid black;
  width: 8px;
  height: 8px;
  position: absolute;
  right: 0;
  top: 8px;
}
</style>
    </head>
    <body>
        <!-- partial:index.partial.html -->
        <main class="container">
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0