Introduction.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <div class="view-introduction" :class="{ 'overflow-hidden': visited === false }">
  3. <b-overlay
  4. class="intro"
  5. :show="page === undefined"
  6. z-index="0"
  7. >
  8. <page-view
  9. v-if="page"
  10. :page="page" slug="intro"
  11. @close="$router.push({ name: 'home' })"
  12. />
  13. </b-overlay>
  14. <div v-if="visited === false" class="page-popup">
  15. <div class="page-popup-container h-100">
  16. <b-overlay :show="popup === undefined" z-index="0" class="h-100">
  17. <page-view
  18. v-if="popup"
  19. :page="popup" slug="welcome"
  20. @close="onPopupClose()"
  21. />
  22. </b-overlay>
  23. </div>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. import { mapGetters } from 'vuex'
  29. import { PageView } from '@/components/layouts'
  30. export default {
  31. name: 'Introduction',
  32. components: {
  33. PageView
  34. },
  35. data () {
  36. return {
  37. page: undefined,
  38. popup: undefined
  39. }
  40. },
  41. computed: {
  42. ...mapGetters(['visited']),
  43. },
  44. methods: {
  45. onPopupClose () {
  46. this.$store.commit('SET_VISITED', true)
  47. }
  48. },
  49. async created () {
  50. if (this.visited === false) {
  51. this.popup = await this.$store.dispatch('QUERY_PAGE', 'welcome')
  52. }
  53. this.page = await this.$store.dispatch('QUERY_PAGE', 'intro')
  54. }
  55. }
  56. </script>
  57. <style lang="scss" scoped>
  58. .view-introduction {
  59. height: 100%;
  60. position: relative;
  61. &.overflow-hidden {
  62. overflow: hidden;
  63. }
  64. }
  65. .intro {
  66. height: 100%;
  67. .page-intro {
  68. font-family: $font-family-text;
  69. font-size: 1.5rem;
  70. @include media-breakpoint-up($size-bp) {
  71. font-size: 2rem;
  72. }
  73. @include media-breakpoint-up($layout-bp) {
  74. ::v-deep .page-wrapper {
  75. max-width: 70%;
  76. margin: auto;
  77. }
  78. }
  79. }
  80. }
  81. .page-popup {
  82. border: $line;
  83. background-color: $white;
  84. position: absolute;
  85. width: 100%;
  86. &-container {
  87. height: 100%;
  88. width: 100%;
  89. overflow-y: auto;
  90. }
  91. @include media-breakpoint-down($size-bp-down) {
  92. top: -2px;
  93. height: calc(100% + 2px);
  94. margin-bottom: -2px;
  95. }
  96. @include media-breakpoint-up($size-bp) {
  97. height: 80%;
  98. width: 80%;
  99. left: 10%;
  100. top: 50%;
  101. transform: translate(0, -50%);
  102. }
  103. }
  104. </style>