App.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <div v-if="state.ready && $route.name !== 'NotFound'">
  3. <NavBar
  4. v-if="showNavBar"
  5. :show-nav-icons="!/^\/password/.test($route.path)"
  6. :fixed="true"
  7. />
  8. <div class="main-container" :class="{ 'white-down-md': state.bgWhite }">
  9. <router-view
  10. :class="[
  11. 'main-wrapper',
  12. { 'main-wrapper-fluid': $route.path === '/invite' },
  13. ]"
  14. />
  15. </div>
  16. <PageFooter v-if="$route.path !== '/'" />
  17. </div>
  18. </template>
  19. <script setup lang="ts">
  20. import { computed, watch, onMounted } from 'vue'
  21. import { useRoute } from 'vue-router'
  22. import { state } from './store'
  23. import NavBar from './components/nav-bar/index.vue'
  24. import PageFooter from './components/footer/index.vue'
  25. import getLocation from './utils/getLocation'
  26. const route = useRoute()
  27. const navBarIgnore = ['/login', '/register']
  28. const showNavBar = computed(() => !navBarIgnore.includes(route.path))
  29. watch(
  30. () => route.path,
  31. () => (state.bgWhite = false)
  32. )
  33. onMounted(getLocation)
  34. </script>
  35. <style lang="scss">
  36. .main-container {
  37. min-height: 100vh;
  38. padding-bottom: 160px;
  39. background: #f7f7f7;
  40. overflow: hidden;
  41. &:first-child {
  42. background: $primary-color url(@img/bg-sm.png) no-repeat;
  43. background-size: contain;
  44. @include media-breakpoint-up(md) {
  45. background-image: url(@img/bg-lg.jpeg);
  46. background-size: cover;
  47. }
  48. }
  49. &.white-down-md {
  50. @include media-breakpoint-down(md) {
  51. background: #fff;
  52. }
  53. }
  54. @include media-breakpoint-up(md) {
  55. min-height: auto;
  56. }
  57. @include media-breakpoint-only(md) {
  58. padding-bottom: 0;
  59. }
  60. @include media-breakpoint-up(lg) {
  61. padding-bottom: 64px;
  62. }
  63. .nav-bar + & {
  64. padding-top: var(--nav-bar-height);
  65. }
  66. }
  67. .main-wrapper {
  68. margin: auto;
  69. overflow: hidden;
  70. @include media-breakpoint-up(lg) {
  71. width: 768px * 2;
  72. }
  73. @include media-breakpoint-up(xl) {
  74. width: 999px * 2;
  75. }
  76. &-fluid {
  77. width: 100%;
  78. }
  79. .white-down-md & {
  80. background: #fff;
  81. @include media-breakpoint-up(lg) {
  82. margin-top: 64px;
  83. }
  84. }
  85. }
  86. .contents {
  87. padding-top: 50px;
  88. text-align: center;
  89. line-height: 74px;
  90. font-size: 36px;
  91. a {
  92. color: $primary-color;
  93. text-decoration: underline;
  94. }
  95. }
  96. </style>