<template>
  <div class="login-container">
    <div class="login-box">
      <h2 style="color: white">登录</h2>
      <div class="input-box">
        <el-input
          v-model="username"
          placeholder="请输入用户名"
          size="large"
          :prefix-icon="User"
        ></el-input>
        <el-input
          v-model="password"
          type="password"
          placeholder="请输入密码"
          show-password
          size="large"
          :prefix-icon="Lock"
        >
        </el-input>
      </div>

      <div class="login-btn">
        <el-button size="large" type="primary" round @click="login"
          >登录</el-button
        >
        <el-button size="large" type="success" round @click="register"
          >注册</el-button
        >
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";
import { Lock, User } from "@element-plus/icons-vue";
import { useRouter } from "vue-router";

let username = ref("");
let password = ref("");

let router = useRouter();

function login() {
  router.push("/home");
}

function register() {}
</script>
<style scoped lang="scss">
.login-container {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: ghostwhite;
  background: url(../../assets/img/login-bg.jpg);
  background-size: cover;
  .login-box {
    width: 400px;
    height: 300px;
    background-color: rgba(45, 205, 195, 0.4);
    position: relative;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    border: 1px solid whitesmoke;
    box-shadow: 0px 0px 50px gainsboro;

    display: flex;
    flex-direction: column;
    align-items: center;

    .input-box {
      position: relative;
      top: 16px;
      width: 80%;
      height: 30%;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }

    .login-btn {
      position: absolute;
      display: flex;
      bottom: 40px;
      width: 60%;
      justify-content: space-around;
      button {
        width: 110px;
      }
    }
  }
}
</style>
