• Vue精美简洁登录页


    在这里插入图片描述
    在这里插入图片描述
    LoginBox.vue

    <template>
      <div class="main-box">
        <div :class="['container', 'container-register', { 'is-txl': isLogin }]">
          <form>
            <h2 class="title">Create Account</h2>
            <span class="text">or use email for registration</span>
            <input class="form__input" type="text" placeholder="Name" />
            <input class="form__input" type="text" placeholder="Email" />
            <input class="form__input" type="password" placeholder="Password" />
            <div class="primary-btn">立即注册</div>
          </form>
        </div>
        <div
          :class="['container', 'container-login', { 'is-txl is-z200': isLogin }]"
        >
          <form>
            <h2 class="title">Sign in to Website</h2>
            <span class="text">or use email for registration</span>
            <input class="form__input" type="text" placeholder="Email" />
            <input class="form__input" type="password" placeholder="Password" />
            <div class="primary-btn">立即登录</div>
          </form>
        </div>
        <div :class="['switch', { login: isLogin }]">
          <div class="switch__circle"></div>
          <div class="switch__circle switch__circle_top"></div>
          <div class="switch__container">
            <h2>{{ isLogin ? 'Hello Friend !' : 'Welcome Back !' }}</h2>
            <p>
              {{
                isLogin
                  ? 'Enter your personal details and start journey with us'
                  : 'To keep connected with us please login with your personal info'
              }}
            </p>
            <div class="primary-btn" @click="isLogin = !isLogin">
              {{ isLogin ? '立即注册' : '立即登录' }}
            </div>
          </div>
        </div>
      </div>
    </template>
    
    <script>
    export default {
      name: 'LoginBox',
      data() {
        return {
          isLogin: false,
          loginForm: {
            email: '',
            password: '',
          },
          registerForm: {
            name: '',
            email: '',
            password: '',
          },
        }
      },
      methods: {
        login() {},
        register() {},
      },
    }
    </script>
    
    <style lang="scss" scoped>
    .main-box {
      position: relative;
      width: 1000px;
      min-width: 1000px;
      min-height: 600px;
      height: 600px;
      padding: 25px;
      background-color: #ecf0f3;
      box-shadow: 10px 10px 10px #d1d9e6, -10px -10px 10px #f9f9f9;
      border-radius: 12px;
      overflow: hidden;
      .container {
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        top: 0;
        width: 600px;
        height: 100%;
        padding: 25px;
        background-color: #ecf0f3;
        transition: all 1.25s;
        form {
          display: flex;
          justify-content: center;
          align-items: center;
          flex-direction: column;
          width: 100%;
          height: 100%;
          color: #a0a5a8;
          .title {
            font-size: 34px;
            font-weight: 700;
            line-height: 3;
            color: #181818;
          }
          .text {
            margin-top: 30px;
            margin-bottom: 12px;
          }
          .form__input {
            width: 350px;
            height: 40px;
            margin: 4px 0;
            padding-left: 25px;
            font-size: 13px;
            letter-spacing: 0.15px;
            border: none;
            outline: none;
            // font-family: 'Montserrat', sans-serif;
            background-color: #ecf0f3;
            transition: 0.25s ease;
            border-radius: 8px;
            box-shadow: inset 2px 2px 4px #d1d9e6, inset -2px -2px 4px #f9f9f9;
            &::placeholder {
              color: #a0a5a8;
            }
          }
        }
      }
      .container-register {
        z-index: 100;
        left: calc(100% - 600px);
      }
      .container-login {
        left: calc(100% - 600px);
        z-index: 0;
      }
      .is-txl {
        left: 0;
        transition: 1.25s;
        transform-origin: right;
      }
      .is-z200 {
        z-index: 200;
        transition: 1.25s;
      }
      .switch {
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 400px;
        padding: 50px;
        z-index: 200;
        transition: 1.25s;
        background-color: #ecf0f3;
        overflow: hidden;
        box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #f9f9f9;
        color: #a0a5a8;
        .switch__circle {
          position: absolute;
          width: 500px;
          height: 500px;
          border-radius: 50%;
          background-color: #ecf0f3;
          box-shadow: inset 8px 8px 12px #d1d9e6, inset -8px -8px 12px #f9f9f9;
          bottom: -60%;
          left: -60%;
          transition: 1.25s;
        }
        .switch__circle_top {
          top: -30%;
          left: 60%;
          width: 300px;
          height: 300px;
        }
        .switch__container {
          display: flex;
          justify-content: center;
          align-items: center;
          flex-direction: column;
          position: absolute;
          width: 400px;
          padding: 50px 55px;
          transition: 1.25s;
          h2 {
            font-size: 34px;
            font-weight: 700;
            line-height: 3;
            color: #181818;
          }
          p {
            font-size: 14px;
            letter-spacing: 0.25px;
            text-align: center;
            line-height: 1.6;
          }
        }
      }
      .login {
        left: calc(100% - 400px);
        .switch__circle {
          left: 0;
        }
      }
      .primary-btn {
        width: 180px;
        height: 50px;
        border-radius: 25px;
        margin-top: 50px;
        text-align: center;
        line-height: 50px;
        font-size: 14px;
        letter-spacing: 2px;
        background-color: #4b70e2;
        color: #f9f9f9;
        cursor: pointer;
        box-shadow: 8px 8px 16px #d1d9e6, -8px -8px 16px #f9f9f9;
        &:hover {
          box-shadow: 4px 4px 6px 0 rgb(255 255 255 / 50%),
            -4px -4px 6px 0 rgb(116 125 136 / 50%),
            inset -4px -4px 6px 0 rgb(255 255 255 / 20%),
            inset 4px 4px 6px 0 rgb(0 0 0 / 40%);
        }
      }
    }
    </style>
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
  • 相关阅读:
    Qt页面布局
    ffplay数据读取线程
    用Java写一个贪吃蛇游戏
    [附源码]计算机毕业设计小区疫情事件处理系统Springboot程序
    Qt “$$“符号的讲解
    0基础学习VR全景平台篇 第93篇:智慧景区教程
    PC端配置定位服务步骤(依赖于腾讯位置服务)
    Golang | Leetcode Golang题解之第207题课程表
    人工智能学习之机器人路径规划优化
    在Java代码中指定用JAXB的XmlElement注解的元素的顺序
  • 原文地址:https://blog.csdn.net/Wind_AN/article/details/125539939