<template>
  <div class="login">
    <div class="login-subtitle">SMALL@小柒</div>

    <div
      class="login-content"
      :class="{ 'login-phone-content': activeName === 'phone' }"
    >
      <div class="login-content-title">vue-next-admin后台模板</div>
      <el-tabs v-model="activeName">
        <el-tab-pane label="账号密码登录" name="account">
          <transition name="el-zoom-in-center">
            <Account v-if="activeName === 'account'" />
          </transition>
        </el-tab-pane>
        <el-tab-pane label="手机号登录" name="phone">
          <transition name="el-zoom-in-center">
            <Phone v-if="activeName === 'phone'" />
          </transition>
        </el-tab-pane>
      </el-tabs>

      <div>
        <el-button type="text" size="small">第三方登录</el-button>
        <el-button type="text" size="small">友情链接</el-button>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from "vue";
import Account from "./components/account.vue";
import Phone from "./components/phone.vue";

export default defineComponent({
  setup() {
    const activeName = ref("account");

    return {
      activeName,
    };
  },

  components: {
    Account,
    Phone,
  },
});
</script>

<style lang="scss" scoped>
.login {
  position: relative;
  height: 100vh;
  background-image: url("https://gitee.com/lyt-top/vue-next-admin-images/raw/master/login/bg-login.png");
  background-size: 100% 100%;

  &-subtitle {
    position: absolute;
    top: 30px;
    left: 5%;
    font-size: 20px;
    color: var(--color-primary);
  }

  &-content {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 500px;
    height: 480px;
    padding: 20px 65px;
    background-color: #fff;
    border: 5px solid var(--color-primary-light-8);
    transform: translate(-50%, -50%);
    transition: height 0.2s linear;
    &.login-phone-content {
      height: 412px;
    }

    &-title {
      color: #333;
      font-weight: 500;
      font-size: 22px;
      text-align: center;
      letter-spacing: 4px;
      margin: 15px 0 30px;
    }
  }
}
</style>
