formations.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <LayoutNavigation />
  3. <FormationBanner />
  4. <FormationMenuScroll />
  5. <div v-if="shouldShowStickyMenu" id="sticky-menu">
  6. <LayoutUIStickyMenu
  7. :shouldShowStickyMenu="shouldShowStickyMenu"
  8. :squaresData="squaresData"
  9. />
  10. </div>
  11. <FormationPresentation />
  12. <FormationCatalogue />
  13. <FormationOPCA />
  14. <FormationCertification />
  15. <FormationParticipation />
  16. <FormationReviews />
  17. <LayoutFAQ />
  18. <LayoutUISolutionsFooter id="layout-footer"/>
  19. <LayoutFooter id="layout-footer" />
  20. </template>
  21. <script setup>
  22. import { ref, onMounted } from "vue";
  23. import { useRouter } from 'vue-router';
  24. const router = useRouter();
  25. const shouldShowStickyMenu = ref(true);
  26. const squaresData = [
  27. {
  28. id: 1,
  29. bgColor: "green-square",
  30. iconClass: "fa-regular fa-comments icon",
  31. text: "Nous contacter",
  32. url: "/nous-contacter",
  33. },
  34. {
  35. id: 4,
  36. bgColor: "darkblue-square",
  37. iconClass: "fa-solid fa-phone icon",
  38. text: "Nous Appeler"
  39. },
  40. ];
  41. onMounted(() => {
  42. const stickyMenu = document.getElementById("sticky-menu");
  43. const footer = document.getElementById("layout-footer");
  44. const observer = new IntersectionObserver(
  45. ([entry]) => {
  46. shouldShowStickyMenu.value = !entry.isIntersecting;
  47. },
  48. {
  49. root: null,
  50. threshold: 0,
  51. }
  52. );
  53. observer.observe(footer);
  54. });
  55. </script>
  56. <style scoped>
  57. #sticky-menu {
  58. position: sticky;
  59. top: 20rem;
  60. z-index: 1;
  61. margin-bottom: -32rem;
  62. float: right;
  63. }
  64. @media (max-width: 1800px) {
  65. #sticky-menu {
  66. top: 16rem;
  67. margin-bottom: -28rem;
  68. }
  69. }
  70. </style>