diff --git a/web/themes/custom/reha/dist/bundle.js b/web/themes/custom/reha/dist/bundle.js index aaf4f37..2af5046 100644 --- a/web/themes/custom/reha/dist/bundle.js +++ b/web/themes/custom/reha/dist/bundle.js @@ -15,7 +15,7 @@ \********************/ /***/ (() => { -eval("/**\n * @file\n * reha behaviors.\n */\n(function (Drupal) {\n\n 'use strict';\n\n Drupal.behaviors.reha = {\n attach: function (context, settings) {\n\n console.log('It works!');\n\n }\n };\n\n \n} (Drupal));\n\njQuery(document).ready(function($){\n\n // menu déroulant\n\n ////////////// contacts ///////\n\n $(\".bouton-contact\").click(function(event) {\n // Fermer .connexion-full s'il est déroulé\n if ($(\".connexion-full\").is(\":visible\")) {\n $(\".connexion-full\").slideUp();\n }\n if ($(\".connected-full\").is(\":visible\")) {\n $(\".connected-full\").slideUp();\n }\n // Ouvrir .contacts-full\n $(\".contacts-full\").slideToggle();\n\n });\n\n////////////// connexion ///////\n\n $(\".bouton-connexion\").click(function(event) {\n // Fermer .contacts-full s'il est déroulé\n if ($(\".contacts-full\").is(\":visible\")) {\n $(\".contacts-full\").slideUp();\n }\n // Ouvrir .connexion-full\n $(\".connexion-full\").slideToggle();\n });\n \n $(\".bouton-connected\").click(function(event) {\n // Fermer .contacts-full s'il est déroulé\n if ($(\".contacts-full\").is(\":visible\")) {\n $(\".contacts-full\").slideUp();\n }\n // Ouvrir .connected-full\n $(\".connected-full\").slideToggle();\n });\n \n $(\".titre\").click(function(event) {\n if ($(\".connected-full\").is(\":visible\")) {\n $(\".connected-full\").slideUp();\n }\n if ($(\".contacts-full\").is(\":visible\")) {\n $(\".contacts-full\").slideUp();\n }\n if ($(\".connexion-full\").is(\":visible\")) {\n $(\".connexion-full\").slideUp();\n }\n // // Ouvrir .connexion-full\n // $(\".connected-full\").slideToggle();\n });\n \n $(\"#edit-field-dossier-de-candidature-0--label\").click(function(event) {\n event.preventDefault();\n // Ouvrir .connexion-full\n $(\"#edit-field-dossier-de-candidature-0--description>ul.main\").slideToggle();\n });\n\n\n ////////////// tiroir fichiers ///////\n\n // $(\".profile--type--collaborateur\").click(function(event) {\n // // Ouvrir .tiroir fichiers\n // $(\".layout-sidebar-second\").animate({translate:'90%'},350);\n // });\n // $(\"#block-reha-views-block-current-user-doc-profile-block-1 > h2\").click(function(event) {\n // // Ouvrir .tiroir fichiers\n // $(\".layout-sidebar-second\").animate({translate:'0%'},350);\n // });\n $(document).ready(function() {\n // Vérifier l'état initial depuis sessionStorage\n if (sessionStorage.getItem('asideOpened') === 'true') {\n $(\".layout-sidebar-second\").addClass('close');\n $(\"h2\").addClass('__close');\n }\n\n $(\".profile--type--collaborateur\").click(function(event) {\n // Ouvrir .tiroir fichiers\n $(\".layout-sidebar-second\").addClass('close');\n $(\"h2\").addClass('__close');\n sessionStorage.setItem('asideOpened', 'true');\n });\n\n $(\"#block-reha-views-block-current-user-doc-profile-block-1 > h2\").click(function(event) {\n // Fermer .tiroir fichiers\n $(\".layout-sidebar-second\").removeClass('close');\n $(\"h2\").removeClass('__close');\n sessionStorage.setItem('asideOpened', 'false');\n });\n });\n\n});\n\n\n// slideshow home \n\n(function($, window) {\n console.log('hello slick')\n $(document).ready(function(){\n $('.view-id-sites.view-display-id-block_1').slick({\n slidesToShow: 1,\n // slidesToScroll: 1,\n dots: false,\n arrows: true,\n centerMode: true,\n adaptiveHeight: true,\n // centerPadding: '100px',\n responsive: [\n {\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n adaptiveHeight: true,\n arrows: false,\n draggable: true,\n centerMode: true,\n }\n }]\n });\n console.log('salut slick home');\n\n });\n\n $(document).ready(function(){\n $('.view-id-actus.view-display-id-block_1').slick({\n slidesToShow: 3,\n // slidesToScroll: 1,\n dots: false,\n arrows: true,\n centerMode: true,\n // centerPadding: '100px',\n responsive: [\n {\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n adaptiveHeight: true,\n arrows: false,\n draggable: true,\n centerMode: true,\n }\n }]\n });\n console.log('slick actu');\n });\n $(document).ready(function(){\n $('.page-node-site .node-type-site .field--name-field-image > div:nth-child(2)').slick({\n slidesToShow: 1,\n slidesToScroll: 1,\n dots: true,\n arrows: false,\n adaptiveHeight: true,\n // centerMode: true,\n // centerPadding: '100px',\n responsive: [\n {\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n adaptiveHeight: true,\n arrows: false,\n draggable: true,\n centerMode: true,\n }\n }]\n });\n console.log('slick actu');\n });\n\n\n \n\n// /////////////////\n//// ancre dans texte au click parragraphe correspondant arrive en dessous du header \n\n\n\n// function adjustAnchor() {\n// var $anchor = $(window.location.hash); // Select the anchor element based on the hash in the URL\n// var fixedElementHeight = $('.block-region-first').outerHeight(); // Get the height of the sticky element\n\n// if ($anchor.length > 0) {\n// $('html, body').stop().animate({\n// scrollTop: $anchor.offset().top - fixedElementHeight // Adjust the scroll position to account for the sticky element height\n// }, 0);\n// }\n// }\n\n// // Call the function on page load if there's a hash\n// if (window.location.hash) {\n// adjustAnchor();\n// }\n\n// // Adjust the anchor on hash change\n// $(window).on('hashchange', function() {\n// adjustAnchor();\n// });\n\n\n\n//////////////////////////////////////////\n// menu ancre paragraphe quand actif\n \n jQuery(function($) {\n // Function to set the active class based on the current path\n function setActiveLink() {\n var path = window.location.href;\n console.log(path);\n $(\".layout__region--first .block-region-first li a\").each(function() {\n if (this.href === path) {\n $(this).closest('a').addClass('active');\n }\n });\n }\n\n // Initially set the active link based on the current URL\n setActiveLink();\n\n // Update the active link on click\n $(\".layout__region--first .block-region-first li a\").on('click', function() {\n $(\".layout__region--first .block-region-first li a\").removeClass('active');\n $(this).addClass('active');\n });\n });\n\n\n})(jQuery, window);\n\n\n\n//# sourceURL=webpack://dev.reha.fr/./js/reha.js?"); +eval("/**\n * @file\n * reha behaviors.\n */\n(function (Drupal) {\n\n 'use strict';\n\n Drupal.behaviors.reha = {\n attach: function (context, settings) {\n\n console.log('It works!');\n\n }\n };\n\n \n} (Drupal));\n\njQuery(document).ready(function($){\n\n // menu déroulant\n\n ////////////// contacts ///////\n\n $(\".bouton-contact\").click(function(event) {\n // Fermer .connexion-full s'il est déroulé\n if ($(\".connexion-full\").is(\":visible\")) {\n $(\".connexion-full\").slideUp();\n }\n if ($(\".connected-full\").is(\":visible\")) {\n $(\".connected-full\").slideUp();\n }\n // Ouvrir .contacts-full\n $(\".contacts-full\").slideToggle();\n\n });\n\n////////////// connexion ///////\n\n $(\".bouton-connexion\").click(function(event) {\n // Fermer .contacts-full s'il est déroulé\n if ($(\".contacts-full\").is(\":visible\")) {\n $(\".contacts-full\").slideUp();\n }\n // Ouvrir .connexion-full\n $(\".connexion-full\").slideToggle();\n });\n \n $(\".bouton-connected\").click(function(event) {\n // Fermer .contacts-full s'il est déroulé\n if ($(\".contacts-full\").is(\":visible\")) {\n $(\".contacts-full\").slideUp();\n }\n // Ouvrir .connected-full\n $(\".connected-full\").slideToggle();\n });\n \n $(\".titre\").click(function(event) {\n if ($(\".connected-full\").is(\":visible\")) {\n $(\".connected-full\").slideUp();\n }\n if ($(\".contacts-full\").is(\":visible\")) {\n $(\".contacts-full\").slideUp();\n }\n if ($(\".connexion-full\").is(\":visible\")) {\n $(\".connexion-full\").slideUp();\n }\n // // Ouvrir .connexion-full\n // $(\".connected-full\").slideToggle();\n });\n \n $(\"#edit-field-dossier-de-candidature-0--label\").click(function(event) {\n event.preventDefault();\n // Ouvrir .connexion-full\n $(\"#edit-field-dossier-de-candidature-0--description>ul.main\").slideToggle();\n });\n\n\n ////////////// tiroir fichiers ///////\n\n // $(\".profile--type--collaborateur\").click(function(event) {\n // // Ouvrir .tiroir fichiers\n // $(\".layout-sidebar-second\").animate({translate:'90%'},350);\n // });\n // $(\"#block-reha-views-block-current-user-doc-profile-block-1 > h2\").click(function(event) {\n // // Ouvrir .tiroir fichiers\n // $(\".layout-sidebar-second\").animate({translate:'0%'},350);\n // });\n $(document).ready(function() {\n // Vérifier l'état initial depuis sessionStorage\n if (sessionStorage.getItem('asideOpened') === 'true') {\n $(\".layout-sidebar-second\").addClass('close');\n $(\"h2\").addClass('__close');\n }\n\n $(\".profile--type--collaborateur\").click(function(event) {\n // Ouvrir .tiroir fichiers\n $(\".layout-sidebar-second\").addClass('close');\n $(\"h2\").addClass('__close');\n sessionStorage.setItem('asideOpened', 'true');\n });\n\n $(\"#block-reha-views-block-current-user-doc-profile-block-1 > h2\").click(function(event) {\n // Fermer .tiroir fichiers\n $(\".layout-sidebar-second\").removeClass('close');\n $(\"h2\").removeClass('__close');\n sessionStorage.setItem('asideOpened', 'false');\n });\n });\n\n});\n\n\n// slideshow home \n\n(function($, window) {\n console.log('hello slick')\n $(document).ready(function(){\n $('.view-id-sites.view-display-id-block_1').slick({\n slidesToShow: 1,\n // slidesToScroll: 1,\n dots: false,\n arrows: true,\n centerMode: true,\n adaptiveHeight: true,\n // centerPadding: '100px',\n responsive: [\n {\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n adaptiveHeight: true,\n arrows: false,\n draggable: true,\n centerMode: true,\n }\n }]\n });\n console.log('salut slick home');\n\n });\n\n $(document).ready(function(){\n $('.view-id-actus.view-display-id-block_1').slick({\n slidesToShow: 3,\n // slidesToScroll: 1,\n dots: false,\n arrows: true,\n centerMode: true,\n // centerPadding: '100px',\n responsive: [\n {\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n adaptiveHeight: true,\n arrows: false,\n draggable: true,\n centerMode: true,\n }\n }]\n });\n console.log('slick actu');\n });\n $(document).ready(function(){\n $('.page-node-site .node-type-site .field--name-field-image > div:nth-child(2)').slick({\n slidesToShow: 1,\n slidesToScroll: 1,\n dots: true,\n arrows: false,\n adaptiveHeight: true,\n // centerMode: true,\n // centerPadding: '100px',\n responsive: [\n {\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n adaptiveHeight: true,\n arrows: false,\n draggable: true,\n centerMode: true,\n }\n }]\n });\n console.log('slick actu');\n });\n\n\n \n\n// /////////////////\n//// ancre dans texte au click parragraphe correspondant arrive en dessous du header \n\n\n// (function($, window) {\n// var adjustAnchor = function() {\n// var $anchor = $('.block-region-first'),\n// fixedElementHeight = 300;\n// console.log($anchor);\n// if ($anchor.length > 0) {\n// $('html, body').stop().animate({scrollTop: $anchor.offset().top - fixedElementHeight }, 0);\n// }\n// };\n\n// $(window).on('hashchange', function() {\n// adjustAnchor();\n// });\n// }); \n\nfunction adjustAnchor() {\n var $anchor = $(window.location.hash); // Select the anchor element based on the hash in the URL\n var fixedElementHeight = $('.block-region-first').outerHeight(); // Get the height of the sticky element\n\n if ($anchor.length > 0) {\n $('html, body').stop().animate({\n scrollTop: $anchor.offset().top - fixedElementHeight // Adjust the scroll position to account for the sticky element height\n }, 0);\n }\n}\n\n// Call the function on page load if there's a hash\nif (window.location.hash) {\n adjustAnchor();\n}\n\n// Adjust the anchor on hash change\n$(window).on('hashchange', function() {\n adjustAnchor();\n});\n\n\n\n//////////////////////////////////////////\n// menu ancre paragraphe quand actif\n \njQuery(function($) {\n // Function to set the active class based on the current path\n function setActiveLink() {\n var path = window.location.href;\n console.log(path);\n $(\".layout__region--first .block-region-first li a\").each(function() {\n if (this.href === path) {\n $(this).closest('a').addClass('active');\n }\n });\n }\n\n // Initially set the active link based on the current URL\n setActiveLink();\n\n // Update the active link on click\n $(\".layout__region--first .block-region-first li a\").on('click', function() {\n $(\".layout__region--first .block-region-first li a\").removeClass('active');\n $(this).addClass('active');\n });\n});\n\n\n})(jQuery, window);\n\n\n\n//# sourceURL=webpack://dev.reha.fr/./js/reha.js?"); /***/ }), diff --git a/web/themes/custom/reha/dist/css/bundle.css b/web/themes/custom/reha/dist/css/bundle.css index b4d5287..81a3e89 100644 --- a/web/themes/custom/reha/dist/css/bundle.css +++ b/web/themes/custom/reha/dist/css/bundle.css @@ -170,6 +170,8 @@ } .layout-content { + position: relative; + top: 110px; order: 2; padding-top: 3rem; padding-bottom: 6rem; @@ -295,8 +297,7 @@ header { z-index: 101; width: 100vw; max-width: 100vw; - position: -webkit-sticky; - position: sticky; + position: fixed; top: 0; box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; } @@ -2584,11 +2585,10 @@ html.js body.node-type-operation.node-id-7 div.dialog-off-canvas-main-canvas div position: relative; } .page-programme .layout__region--first .block-region-first { - padding-left: 20%; + padding-left: 3rem; display: flex; justify-content: flex-end; - position: -webkit-sticky; - position: sticky; + position: fixed; top: 10rem; } .page-programme .layout__region--first .block-region-first > .block-block-content { diff --git a/web/themes/custom/reha/js/reha.js b/web/themes/custom/reha/js/reha.js index 7cc8377..5c711ef 100644 --- a/web/themes/custom/reha/js/reha.js +++ b/web/themes/custom/reha/js/reha.js @@ -194,54 +194,68 @@ jQuery(document).ready(function($){ //// ancre dans texte au click parragraphe correspondant arrive en dessous du header +// (function($, window) { +// var adjustAnchor = function() { +// var $anchor = $('.block-region-first'), +// fixedElementHeight = 300; +// console.log($anchor); +// if ($anchor.length > 0) { +// $('html, body').stop().animate({scrollTop: $anchor.offset().top - fixedElementHeight }, 0); +// } +// }; -// function adjustAnchor() { -// var $anchor = $(window.location.hash); // Select the anchor element based on the hash in the URL -// var fixedElementHeight = $('.block-region-first').outerHeight(); // Get the height of the sticky element +// $(window).on('hashchange', function() { +// adjustAnchor(); +// }); +// }); -// if ($anchor.length > 0) { -// $('html, body').stop().animate({ -// scrollTop: $anchor.offset().top - fixedElementHeight // Adjust the scroll position to account for the sticky element height -// }, 0); -// } -// } +function adjustAnchor() { + var $anchor = $(window.location.hash); // Select the anchor element based on the hash in the URL + var fixedElementHeight = $('.block-region-first').outerHeight(); // Get the height of the sticky element -// // Call the function on page load if there's a hash -// if (window.location.hash) { -// adjustAnchor(); -// } + if ($anchor.length > 0) { + $('html, body').stop().animate({ + scrollTop: $anchor.offset().top - fixedElementHeight // Adjust the scroll position to account for the sticky element height + }, 0); + } +} -// // Adjust the anchor on hash change -// $(window).on('hashchange', function() { -// adjustAnchor(); -// }); +// Call the function on page load if there's a hash +if (window.location.hash) { + adjustAnchor(); +} + +// Adjust the anchor on hash change +$(window).on('hashchange', function() { + adjustAnchor(); +}); ////////////////////////////////////////// // menu ancre paragraphe quand actif - jQuery(function($) { - // Function to set the active class based on the current path - function setActiveLink() { - var path = window.location.href; - console.log(path); - $(".layout__region--first .block-region-first li a").each(function() { - if (this.href === path) { - $(this).closest('a').addClass('active'); - } - }); - } +jQuery(function($) { + // Function to set the active class based on the current path + function setActiveLink() { + var path = window.location.href; + console.log(path); + $(".layout__region--first .block-region-first li a").each(function() { + if (this.href === path) { + $(this).closest('a').addClass('active'); + } + }); + } - // Initially set the active link based on the current URL - setActiveLink(); + // Initially set the active link based on the current URL + setActiveLink(); - // Update the active link on click - $(".layout__region--first .block-region-first li a").on('click', function() { - $(".layout__region--first .block-region-first li a").removeClass('active'); - $(this).addClass('active'); - }); + // Update the active link on click + $(".layout__region--first .block-region-first li a").on('click', function() { + $(".layout__region--first .block-region-first li a").removeClass('active'); + $(this).addClass('active'); }); +}); })(jQuery, window); diff --git a/web/themes/custom/reha/scss/global/_layout.scss b/web/themes/custom/reha/scss/global/_layout.scss index ed92239..e249c37 100644 --- a/web/themes/custom/reha/scss/global/_layout.scss +++ b/web/themes/custom/reha/scss/global/_layout.scss @@ -29,6 +29,8 @@ $width-menu-slidedown : 550px; } .layout-content{ + position: relative; + top: $header-height; order: 2; padding-top: 3rem; padding-bottom: 6rem; diff --git a/web/themes/custom/reha/scss/pages/le-programme.scss b/web/themes/custom/reha/scss/pages/le-programme.scss index 9c6c961..69939cf 100644 --- a/web/themes/custom/reha/scss/pages/le-programme.scss +++ b/web/themes/custom/reha/scss/pages/le-programme.scss @@ -1,17 +1,20 @@ .page-programme{ + .layout__region--first{ position: relative; .block-region-first{ - - padding-left: 20%; + // position: relative; + padding-left:3rem; display: flex; justify-content: flex-end; - position: -webkit-sticky; - position: sticky; + position: fixed; top: 10rem; > .block-block-content{ + // position: -webkit-sticky; + // position: sticky; + // top: 10rem; width: 100%; ul{ padding-left: 0; diff --git a/web/themes/custom/reha/scss/partials/_header.scss b/web/themes/custom/reha/scss/partials/_header.scss index 9b8610f..3f16f38 100644 --- a/web/themes/custom/reha/scss/partials/_header.scss +++ b/web/themes/custom/reha/scss/partials/_header.scss @@ -7,8 +7,7 @@ header{ z-index: 101; width: 100vw; max-width: 100vw; - position: -webkit-sticky; - position: sticky; + position: fixed; top: 0; box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; @media (max-width:800px) {