webinaires.vue 1.4 KB

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