WelcomeOverlay.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template lang='pug'>
  2. .welcome
  3. .welcome-bg
  4. .welcome-content
  5. .welcome-logo
  6. img(src='/_assets/logo-wikijs.svg')
  7. .welcome-title {{t('welcome.title')}}
  8. .welcome-subtitle {{t('welcome.subtitle')}}
  9. .welcome-actions
  10. q-btn(
  11. push
  12. color='primary'
  13. :label='t(`welcome.createHome`)'
  14. icon='las la-plus'
  15. no-caps
  16. )
  17. q-menu.translucent-menu(
  18. auto-close
  19. anchor='top left'
  20. self='bottom left'
  21. )
  22. q-list(padding)
  23. q-item(
  24. clickable
  25. @click='createHomePage(`wysiwyg`)'
  26. v-if='siteStore.editors.wysiwyg'
  27. )
  28. blueprint-icon(icon='google-presentation')
  29. q-item-section.q-pr-sm Using the Visual Editor
  30. q-item-section(side): q-icon(name='mdi-chevron-right')
  31. q-item(
  32. clickable
  33. @click='createHomePage(`markdown`)'
  34. v-if='siteStore.editors.markdown'
  35. )
  36. blueprint-icon(icon='markdown')
  37. q-item-section.q-pr-sm Using the Markdown Editor
  38. q-item-section(side): q-icon(name='mdi-chevron-right')
  39. q-item(
  40. clickable
  41. @click='createHomePage(`asciidoc`)'
  42. v-if='siteStore.editors.asciidoc'
  43. )
  44. blueprint-icon(icon='asciidoc')
  45. q-item-section.q-pr-sm Using the AsciiDoc Editor
  46. q-item-section(side): q-icon(name='mdi-chevron-right')
  47. q-btn(
  48. push
  49. color='primary'
  50. :label='t(`welcome.admin`)'
  51. icon='las la-cog'
  52. no-caps
  53. @click='loadAdmin'
  54. )
  55. </template>
  56. <script setup>
  57. import { useI18n } from 'vue-i18n'
  58. import { useRouter } from 'vue-router'
  59. import { useMeta, useQuasar } from 'quasar'
  60. import { useSiteStore } from 'src/stores/site'
  61. import { usePageStore } from 'src/stores/page'
  62. // QUASAR
  63. const $q = useQuasar()
  64. // STORES
  65. const pageStore = usePageStore()
  66. const siteStore = useSiteStore()
  67. // ROUTER
  68. const router = useRouter()
  69. // I18N
  70. const { t } = useI18n()
  71. // META
  72. useMeta({
  73. title: t('welcome.title')
  74. })
  75. // METHODS
  76. function createHomePage (editor) {
  77. siteStore.overlay = ''
  78. pageStore.pageCreate({
  79. editor,
  80. locale: 'en',
  81. path: 'home',
  82. title: t('welcome.homeDefault.title'),
  83. description: t('welcome.homeDefault.description'),
  84. content: t('welcome.homeDefault.content')
  85. })
  86. }
  87. function loadAdmin () {
  88. siteStore.overlay = ''
  89. router.push('/_admin')
  90. }
  91. </script>
  92. <style lang="scss">
  93. .welcome {
  94. background: #FFF radial-gradient(ellipse, #FFF, #DDD);
  95. color: $grey-9;
  96. height: 100vh;
  97. border: 10px solid #EEE;
  98. border-radius: 25px !important;
  99. &-bg {
  100. position: absolute;
  101. top: 50%;
  102. left: 50%;
  103. width: 320px;
  104. height: 320px;
  105. background: linear-gradient(0, #FFF 50%, $blue-5 50%);
  106. border-radius: 50%;
  107. filter: blur(100px);
  108. transform: translate(-50%, -55%);
  109. }
  110. &-content {
  111. position: absolute;
  112. top: 50%;
  113. left: 50%;
  114. transform: translate(-50%, -50%);
  115. display: flex;
  116. flex-direction: column;
  117. justify-content: center;
  118. align-items: center;
  119. width: 90vw;
  120. }
  121. &-logo {
  122. user-select: none;
  123. > img {
  124. height: 200px;
  125. user-select: none;
  126. }
  127. }
  128. &-title {
  129. font-size: 4rem;
  130. font-weight: 500;
  131. line-height: 4rem;
  132. text-align: center;
  133. @media (max-width: $breakpoint-md-max) {
  134. font-size: 2.5rem;
  135. line-height: 2.5rem;
  136. }
  137. }
  138. &-subtitle {
  139. font-size: 1.2rem;
  140. font-weight: 500;
  141. color: $blue-7;
  142. line-height: 1.2rem;
  143. margin-top: 1rem;
  144. }
  145. &-actions {
  146. margin-top: 2rem;
  147. text-align: center;
  148. > .q-btn {
  149. margin: 0 5px 5px 5px;
  150. }
  151. }
  152. }
  153. </style>