From 63a8ee1c9a641705d82d8e75f459f70ee7506525 Mon Sep 17 00:00:00 2001 From: ouidade Date: Mon, 1 Jul 2024 20:41:06 +0200 Subject: [PATCH] sites slick --- web/themes/custom/reha/dist/bundle.js | 2 +- web/themes/custom/reha/dist/css/bundle.css | 21 ++++---- web/themes/custom/reha/js/reha.js | 46 +++++++++--------- .../custom/reha/scss/pages/node-site.scss | 48 +++++++++++-------- 4 files changed, 64 insertions(+), 53 deletions(-) diff --git a/web/themes/custom/reha/dist/bundle.js b/web/themes/custom/reha/dist/bundle.js index 58c6926..dd22c6d 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 // html.js body.node-type-site.node-id-58 div.dialog-off-canvas-main-canvas div.layout-container.page-node-site main div.layout-content.home-page-layout-content div.region.region-content div#block-reha-contenudelapageprincipale.block.block-system.block-system-main-block article.node-type-site div.entete_site div.image-site div.field.field--name-field-image.field--type-image.field--label-visually_hidden div.field__items\n // $(document).ready(function(){\n // $('.page-node-site .node-type-site .entete_site .image-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 site');\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?"); +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 // html.js body.node-type-site.node-id-58 div.dialog-off-canvas-main-canvas div.layout-container.page-node-site main div.layout-content.home-page-layout-content div.region.region-content div#block-reha-contenudelapageprincipale.block.block-system.block-system-main-block article.node-type-site div.entete_site div.image-site div.field.field--name-field-image.field--type-image.field--label-visually_hidden div.field__items\n $(document).ready(function(){\n $('.page-node-site .field--name-field-image .field__items').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 site');\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 4349a51..9d42c36 100644 --- a/web/themes/custom/reha/dist/css/bundle.css +++ b/web/themes/custom/reha/dist/css/bundle.css @@ -2753,32 +2753,35 @@ html.js body.node-type-operation.node-id-7 div.dialog-off-canvas-main-canvas div margin: auto; } .page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .entete_site .image-site { + height: 520px; + width: 771px; order: 1; } .page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .entete_site .image-site .field--name-field-image { width: 100%; margin: auto; } -.page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .entete_site .image-site .field--name-field-image .field__item { +.page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .entete_site .image-site .field--name-field-image .slick-dots { + z-index: 999; +} +.page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .entete_site .image-site .field--name-field-image .slick-list { + padding: 0 !important; +} +.page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .entete_site .image-site .field--name-field-image .slick-list .field__item { display: flex; flex-direction: column; align-items: flex-end; } -.page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .entete_site .image-site .field--name-field-image .field__item img { +.page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .entete_site .image-site .field--name-field-image .slick-list .field__item img { height: 520px; width: auto; object-fit: contain; } -.page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .entete_site .image-site .field--name-field-image .field__item blockquote { - position: relative; +.page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .entete_site .image-site .field--name-field-image .slick-list .field__item blockquote { font-style: italic; margin: 0; - width: 20vw; - z-index: 900; - left: 20vw; - top: -50px; } -.page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .entete_site .image-site .field--name-field-image .field__item blockquote p { +.page-node-site .region-content #block-reha-contenudelapageprincipale .node-type-site .entete_site .image-site .field--name-field-image .slick-list .field__item blockquote p { margin: 0; padding-left: 1rem; } diff --git a/web/themes/custom/reha/js/reha.js b/web/themes/custom/reha/js/reha.js index d79adae..7542c9c 100644 --- a/web/themes/custom/reha/js/reha.js +++ b/web/themes/custom/reha/js/reha.js @@ -164,29 +164,29 @@ jQuery(document).ready(function($){ console.log('slick actu'); }); // html.js body.node-type-site.node-id-58 div.dialog-off-canvas-main-canvas div.layout-container.page-node-site main div.layout-content.home-page-layout-content div.region.region-content div#block-reha-contenudelapageprincipale.block.block-system.block-system-main-block article.node-type-site div.entete_site div.image-site div.field.field--name-field-image.field--type-image.field--label-visually_hidden div.field__items - // $(document).ready(function(){ - // $('.page-node-site .node-type-site .entete_site .image-site .field--name-field-image > div:nth-child(2)').slick({ - // slidesToShow: 1, - // slidesToScroll: 1, - // dots: true, - // arrows: false, - // adaptiveHeight: true, - // // centerMode: true, - // // centerPadding: '100px', - // responsive: [ - // { - // breakpoint: 810, - // settings: { - // slidesToShow: 1, - // adaptiveHeight: true, - // arrows: false, - // draggable: true, - // centerMode: true, - // } - // }] - // }); - // console.log('slick site'); - // }); + $(document).ready(function(){ + $('.page-node-site .field--name-field-image .field__items').slick({ + slidesToShow: 1, + // slidesToScroll: 1, + dots: true, + arrows: false, + // adaptiveHeight: true, + centerMode: true, + // centerPadding: '100px', + responsive: [ + { + breakpoint: 810, + settings: { + slidesToShow: 1, + adaptiveHeight: true, + arrows: false, + draggable: true, + centerMode: true, + } + }] + }); + console.log('slick site'); + }); diff --git a/web/themes/custom/reha/scss/pages/node-site.scss b/web/themes/custom/reha/scss/pages/node-site.scss index c2bfc6a..5419250 100644 --- a/web/themes/custom/reha/scss/pages/node-site.scss +++ b/web/themes/custom/reha/scss/pages/node-site.scss @@ -63,36 +63,44 @@ flex-direction: row; margin: auto; .image-site{ + height: 520px; + width: 771px; order: 1; // top: -115px; // position: relative; .field--name-field-image{ width: 100%; margin: auto; - .field__item{ - display: flex; - flex-direction:column; - align-items: flex-end; - img{ - height: 520px; - width: auto; - object-fit: contain; - } - blockquote{ - position: relative; - font-style: italic; - margin: 0; - width: 20vw; - z-index: 900; - left: 20vw; - top: -50px; - - p{ + .slick-dots{z-index: 999;} + .slick-list{ + padding: 0 !important; + .field__item{ + display: flex; + flex-direction:column; + align-items: flex-end; + + img{ + height: 520px; + width: auto; + object-fit: contain; + } + blockquote{ + // position: relative; + font-style: italic; margin: 0; - padding-left: 1rem; + // width: 20vw; + // z-index: 900; + // left: 20vw; + // top: -50px; + + p{ + margin: 0; + padding-left: 1rem; + } } } } + } }