Navigation.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <!--
  2. Menu Navigation
  3. -->
  4. <template>
  5. <div v-if="nuxtReady" v-intersect="onIntersect">
  6. <!-- Navigation (écran large) -->
  7. <div v-if="lgAndUp">
  8. <LayoutNavigationLg :menu="menu" />
  9. </div>
  10. <!-- Navigation (petit écran) -->
  11. <div v-else>
  12. <LayoutNavigationMd :menu="menu" />
  13. </div>
  14. </div>
  15. <div v-else class="loading-screen">
  16. <v-progress-circular indeterminate />
  17. </div>
  18. </template>
  19. <script setup lang="ts">
  20. import { useDisplay } from 'vuetify'
  21. import type { MainMenuItem } from '~/types/interface'
  22. import { useLayoutStore } from '~/stores/layoutStore'
  23. // On force la version écran large au build côté serveur si l'écran fait plus de 1280px de large
  24. const nuxtReady = ref(false)
  25. onNuxtReady(() => {
  26. nuxtReady.value = true
  27. })
  28. const { lgAndUp } = useDisplay()
  29. const menu: Array<MainMenuItem> = [
  30. {
  31. label: 'Nos logiciels',
  32. children: [
  33. { label: 'Opentalent Artist', to: '/opentalent-artist' },
  34. { label: 'Opentalent School', to: '/opentalent-school' },
  35. { label: 'Opentalent Manager', to: '/opentalent-manager' },
  36. ],
  37. },
  38. {
  39. label: 'Nos services',
  40. children: [
  41. { label: 'Formations', to: '/formations' },
  42. { label: 'Webinaires', to: '/webinaires' },
  43. ],
  44. },
  45. {
  46. label: 'À propos',
  47. children: [
  48. { label: 'Qui sommes-nous', to: '/qui-sommes-nous' },
  49. { label: 'Nous rejoindre', to: '/nous-rejoindre' },
  50. ],
  51. },
  52. { label: 'Actualités', to: '/actualites' },
  53. { label: 'Contact', to: '/nous-contacter' },
  54. ]
  55. const layoutStore = useLayoutStore()
  56. const onIntersect = (isIntersecting: boolean) => {
  57. layoutStore.setIsHeaderVisible(isIntersecting)
  58. }
  59. </script>
  60. <style scoped lang="scss">
  61. .loading-screen {
  62. display: flex;
  63. flex-direction: row;
  64. align-items: center;
  65. justify-content: center;
  66. height: 120px;
  67. padding: 16px;
  68. margin: 0 10%;
  69. .v-img {
  70. max-width: 300px;
  71. }
  72. .v-progress-circular {
  73. color: var(--primary-color);
  74. }
  75. }
  76. </style>