index.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <LayoutNavigation />
  3. <div v-if="shouldShowStickyMenu" id="sticky-menu">
  4. <LayoutUIStickyMenu
  5. :shouldShowStickyMenu="shouldShowStickyMenu"
  6. :squaresData="squaresData"
  7. />
  8. </div>
  9. <HomeCaroussel />
  10. <HomePromotion />
  11. <!-- <HomeSolution /> -->
  12. <HomeEventAgenda />
  13. <HomeBesoin />
  14. <HomeReviews />
  15. <!-- <HomeNews /> -->
  16. <HomeHelp id="layout-footer"/>
  17. <LayoutPrefooter id="layout-footer"/>
  18. <LayoutFooter id="layout-footer"/>
  19. </template>
  20. <script setup>
  21. import { ref, onMounted } from "vue";
  22. const shouldShowStickyMenu = ref(true);
  23. const squaresData = [
  24. {
  25. id: 1,
  26. bgColor: "blue-square",
  27. iconClass: "fa-regular fa-comments icon",
  28. text: "Nous contacter",
  29. },
  30. {
  31. id: 2,
  32. bgColor: "blue-square",
  33. iconClass: "fa-solid fa-circle-info icon",
  34. text: "Demander une demo",
  35. },
  36. {
  37. id: 3,
  38. bgColor: "blue-square",
  39. iconClass: "fa-brands fa-readme icon",
  40. text: "Brochure",
  41. },
  42. {
  43. id: 4,
  44. bgColor: "darkblue-square",
  45. iconClass: "fa-solid fa-phone icon",
  46. text: "Nous Appeler",
  47. },
  48. ];
  49. onMounted(() => {
  50. const stickyMenu = document.getElementById("sticky-menu");
  51. const footer = document.getElementById("layout-footer");
  52. const observer = new IntersectionObserver(
  53. ([entry]) => {
  54. shouldShowStickyMenu.value = !entry.isIntersecting;
  55. },
  56. {
  57. root: null,
  58. threshold: 0,
  59. }
  60. );
  61. observer.observe(footer);
  62. });
  63. </script>
  64. <style scoped>
  65. #sticky-menu {
  66. position: sticky;
  67. top: 25rem;
  68. z-index: 1;
  69. margin-bottom: -30rem;
  70. float: right;
  71. }
  72. </style>