App.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <v-app>
  3. <LoadingView v-if="loggedIn === null" />
  4. <RouterView v-else />
  5. <NotificationsManager />
  6. </v-app>
  7. </template>
  8. <script setup lang="ts">
  9. import { RouterView } from "vue-router";
  10. import { useMainStore } from "@/stores/main";
  11. import { onMounted } from "vue";
  12. import LoadingView from "@/components/Loading.vue";
  13. import { storeToRefs } from "pinia";
  14. import NotificationsManager from "@/components/NotificationsManager.vue";
  15. //store
  16. const mainStore = useMainStore();
  17. const mainStoreRef = storeToRefs(mainStore);
  18. //variable
  19. const loggedIn = mainStoreRef.readIsLoggedIn;
  20. //getter
  21. //action
  22. //excute in setup
  23. //lifecycle
  24. onMounted(() => {
  25. mainStore.checkLoggedIn();
  26. });
  27. </script>
  28. <style lang="scss">
  29. :root {
  30. --main-color: #ea5413;
  31. }
  32. a {
  33. transition: 0.3s;
  34. color: var(--main-color);
  35. text-decoration: none;
  36. &:hover {
  37. opacity: 0.7;
  38. }
  39. }
  40. .login-form {
  41. margin: auto;
  42. max-width: 500px;
  43. position: relative;
  44. .v-input__details {
  45. padding: 3px;
  46. .v-messages {
  47. color: #b00020 !important;
  48. text-align: end;
  49. }
  50. }
  51. .login-btn {
  52. display: flex;
  53. margin: 50px auto 0;
  54. padding: 20px 40px;
  55. font-size: 16px;
  56. }
  57. .v-alert {
  58. position: absolute;
  59. width: 100%;
  60. bottom: -110px;
  61. margin-bottom: 10px;
  62. padding: 10px !important;
  63. .v-alert__content {
  64. text-align: start;
  65. }
  66. .v-icon--size-default {
  67. padding: 0;
  68. }
  69. }
  70. .v-input__append {
  71. position: relative;
  72. margin-inline-start: 0 !important;
  73. .material-icons {
  74. position: absolute !important;
  75. right: 10px;
  76. }
  77. }
  78. }
  79. .banner-item {
  80. position: relative;
  81. img {
  82. width: 100%;
  83. height: 100vh;
  84. object-fit: cover;
  85. margin-bottom: -7px;
  86. animation: scale 3s ease-in-out;
  87. filter: brightness(60%); // 圖片遮罩
  88. @media (max-width: 959px) {
  89. height: 40vh;
  90. }
  91. }
  92. h2 {
  93. width: 100%;
  94. padding: 0 10px;
  95. position: absolute;
  96. top: 50%;
  97. left: 50%;
  98. transform: translate(-50%, -50%);
  99. color: #fff;
  100. font-size: 30px;
  101. font-weight: bold;
  102. text-align: center;
  103. letter-spacing: 1px;
  104. @media (max-width: 959px) {
  105. top: 55%;
  106. }
  107. @media (max-width: 575px) {
  108. top: 60%;
  109. font-size: 22px;
  110. }
  111. }
  112. }
  113. @keyframes scale {
  114. 0% {
  115. transform: scale(1.3);
  116. }
  117. 100% {
  118. transform: scale(1);
  119. }
  120. }
  121. .form-title {
  122. display: flex;
  123. flex-direction: column;
  124. align-items: center;
  125. h3 {
  126. font-size: 32px;
  127. font-weight: bold;
  128. letter-spacing: 3px;
  129. @media (max-width: 575px) {
  130. font-size: 28px;
  131. }
  132. }
  133. span {
  134. width: 60px;
  135. height: 3px;
  136. margin: 20px auto 35px;
  137. display: block;
  138. background: var(--main-color);
  139. }
  140. }
  141. </style>