123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <template>
- <v-app>
- <LoadingView v-if="loggedIn === null" />
- <RouterView v-else />
- <NotificationsManager />
- </v-app>
- </template>
- <script setup lang="ts">
- import { RouterView } from "vue-router";
- import { useMainStore } from "@/stores/main";
- import { onMounted } from "vue";
- import LoadingView from "@/components/Loading.vue";
- import { storeToRefs } from "pinia";
- import NotificationsManager from "@/components/NotificationsManager.vue";
- //store
- const mainStore = useMainStore();
- const mainStoreRef = storeToRefs(mainStore);
- //variable
- const loggedIn = mainStoreRef.readIsLoggedIn;
- //getter
- //action
- //excute in setup
- //lifecycle
- onMounted(() => {
- mainStore.checkLoggedIn();
- });
- </script>
- <style lang="scss">
- :root {
- --main-color: #ea5413;
- }
- a {
- transition: 0.3s;
- color: var(--main-color);
- text-decoration: none;
- &:hover {
- opacity: 0.7;
- }
- }
- .login-form {
- margin: auto;
- max-width: 500px;
- position: relative;
- .v-input__details {
- padding: 3px;
- .v-messages {
- color: #b00020 !important;
- text-align: end;
- }
- }
- .login-btn {
- display: flex;
- margin: 50px auto 0;
- padding: 20px 40px;
- font-size: 16px;
- }
- .v-alert {
- position: absolute;
- width: 100%;
- bottom: -110px;
- margin-bottom: 10px;
- padding: 10px !important;
- .v-alert__content {
- text-align: start;
- }
- .v-icon--size-default {
- padding: 0;
- }
- }
- .v-input__append {
- position: relative;
- margin-inline-start: 0 !important;
- .material-icons {
- position: absolute !important;
- right: 10px;
- }
- }
- }
- .banner-item {
- position: relative;
- img {
- width: 100%;
- height: 100vh;
- object-fit: cover;
- margin-bottom: -7px;
- animation: scale 3s ease-in-out;
- filter: brightness(60%); // 圖片遮罩
- @media (max-width: 959px) {
- height: 40vh;
- }
- }
- h2 {
- width: 100%;
- padding: 0 10px;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- color: #fff;
- font-size: 30px;
- font-weight: bold;
- text-align: center;
- letter-spacing: 1px;
- @media (max-width: 959px) {
- top: 55%;
- }
- @media (max-width: 575px) {
- top: 60%;
- font-size: 22px;
- }
- }
- }
- @keyframes scale {
- 0% {
- transform: scale(1.3);
- }
- 100% {
- transform: scale(1);
- }
- }
- .form-title {
- display: flex;
- flex-direction: column;
- align-items: center;
- h3 {
- font-size: 32px;
- font-weight: bold;
- letter-spacing: 3px;
- @media (max-width: 575px) {
- font-size: 28px;
- }
- }
- span {
- width: 60px;
- height: 3px;
- margin: 20px auto 35px;
- display: block;
- background: var(--main-color);
- }
- }
- </style>
|