div+css实现背景loading动画的登录表单页面代码

代码语言:html

所属分类:表单美化

代码描述:div+css实现背景loading动画的登录表单页面代码

代码标签: div css 背景 loading 动画 登录 表单 页面 代码

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

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


  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <style>
    @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap");

    * {
      margin: 0;
      padding: 0;
      font-family: "Poppins";
      box-sizing: border-box;
    }

    body {
      display: flex;
      justify-content: center;
      align-items: center;
      background: #1d1d1d;
      min-height: 100vh;
    }

    .container {
      position: relative;
      width: 256px;
      height: 256px;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .container span {
      position: absolute;
      left: 0;
      width: 32px;
      height: 6px;
      background: #501e17;
      border-radius: 8px;
      transform-origin: 128px;
      transform: scale(2.2) rotate(calc(var(--i) * (360deg / 50)));
      animation: animateBlink 3s linear infinite;
      animation-delay: calc(var(--i) * (3s / 50));
    }

    @keyframes animateBlink {
      0% {
        background: #ff4000;
        box-shadow: 0px 0px 5px rgb(255, 64, 0);
      }

      25% {
        background: #501e17;
        box-shadow: 0px 0px 1px rgb(255, 64, 0);
      }
    }

    .login-box {
      position: absolute;
      width: 400px;
    }

    .login-box form {
      width: 100%;
      padding: 0 50px;
    }

    h2 {
      font-size: 2em;
      color: #ff4000;
      text-align: center;
    }

    .input-box {
      position: relative;
      margin: 25px 0;
    }

    .input-box input {
      width: 100%;
      height: 50px;
      background: transparent;
      border: 2px solid #501e17;
      outline: none;
      border-radius: 40px;
      font-size: 1em;
      color: #fff;
      padding: 0 20px;
      transition: .5s;
    }

    .input-box input:focus,
    .input-box input:valid {
      border-color: #ff4000;
    }

    .input-box label {
      position: absolute;
      top: 50%;
      left: 20px;
      transform: translateY(-50%);
      font-size: 1em;
      color: #fff;
      pointer-events: none;
      transition: .5s ease;
    }

    .input-box input:focus~label,
    .input-box input:valid~label {
      top: 1px;
      font-size: .8em;
      background-color: #1d1d1d;
      padding: 0 6px;
      color: #ff4000;
      border-radius: 20px;
    }

    .forgot-password {
      margin: -15px 0 10px;
      text-align: center;
    }

    .forgot-password a {
      font-size: .85em;
      color: #fff;
      text-decoration: none;
    }


    .forgot-password a:hover {
      text-decoration: underline;
    }

    .btn {
      width: 100%;
      height: 45px;
      border-radius: 45px;
      background: #ff4000;
      border: none;
      outline: none;
      cursor: pointer;
      font-size: 1em;
      color: #FFF;
      font-weight: 600;
    }
  </style>
</head>

<body>
  <div class="container">
    <div class="login-box">
      <h2>Login</h2>
      <form action="#">
        <div class="input-box">
          <input type="email" re.........完整代码请登录后点击上方下载按钮下载查看

网友评论0