diff --git a/composer.json b/composer.json index 7dfdf9f..df1b95f 100644 --- a/composer.json +++ b/composer.json @@ -35,6 +35,7 @@ "drupal/quick_node_clone": "^1.18", "drupal/simple_sitemap": "^4.1", "drupal/social_media_links": "^2.9", + "drupal/viewsreference": "^2.0@beta", "drupal/yaml_editor": "^1.2", "drush/drush": "^12.4", "wikimedia/composer-merge-plugin": "^2.1" diff --git a/composer.lock b/composer.lock index cfaa3f3..52dddad 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e636d8065f593dcf1268ea5aa1ecdd2d", + "content-hash": "410874c298658217f9eccd480c10c4e6", "packages": [ { "name": "asm89/stack-cors", @@ -7572,6 +7572,72 @@ "docs": "https://www.drupal.org/docs/8/modules/views-bulk-operations-vbo" } }, + { + "name": "drupal/viewsreference", + "version": "2.0.0-beta10", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/viewsreference.git", + "reference": "8.x-2.0-beta10" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/viewsreference-8.x-2.0-beta10.zip", + "reference": "8.x-2.0-beta10", + "shasum": "699c3f790d3dbe6ebcd890916409c66562a04eb4" + }, + "require": { + "drupal/core": "^10 || ^11" + }, + "conflict": { + "drupal/viewsreferennce": "*" + }, + "require-dev": { + "drupal/views_ajax_history": "1.x-dev" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "8.x-2.0-beta10", + "datestamp": "1725510905", + "security-coverage": { + "status": "not-covered", + "message": "Beta releases are not covered by Drupal security advisories." + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "joekers", + "homepage": "https://www.drupal.org/user/2229066" + }, + { + "name": "NewZeal", + "homepage": "https://www.drupal.org/user/93571" + }, + { + "name": "scott_euser", + "homepage": "https://www.drupal.org/user/3267594" + }, + { + "name": "seanB", + "homepage": "https://www.drupal.org/user/545912" + } + ], + "description": "Views reference", + "homepage": "http://drupal.org/project/viewsreference", + "keywords": [ + "Drupal" + ], + "support": { + "source": "https://git.drupalcode.org/project/viewsreference", + "issues": "https://www.drupal.org/project/issues/viewsreference" + } + }, { "name": "drupal/yaml_editor", "version": "1.2.0", @@ -12708,6 +12774,7 @@ "minimum-stability": "stable", "stability-flags": { "drupal/page_manager": 5, + "drupal/viewsreference": 10, "drupal/advanced_text_formatter": 5, "drupal/bulkdelete": 20, "drupal/config_ignore": 5, diff --git a/config/sync/core.entity_form_display.node.static.default.yml b/config/sync/core.entity_form_display.node.static.default.yml index 7e3ff64..b8aa4b4 100644 --- a/config/sync/core.entity_form_display.node.static.default.yml +++ b/config/sync/core.entity_form_display.node.static.default.yml @@ -4,6 +4,7 @@ status: true dependencies: config: - field.field.node.static.body + - field.field.node.static.field_map - field.field.node.static.field_pieces_jointes - field.field.node.static.field_textes - node.type.static @@ -13,6 +14,7 @@ dependencies: - paragraphs - path - text + - viewsreference third_party_settings: field_group: group_details: @@ -23,7 +25,7 @@ third_party_settings: label: Details region: content parent_name: '' - weight: 9 + weight: 10 format_type: details_sidebar format_settings: classes: '' @@ -51,10 +53,20 @@ content: third_party_settings: { } created: type: datetime_timestamp - weight: 4 + weight: 5 region: content settings: { } third_party_settings: { } + field_map: + type: viewsreference_autocomplete + weight: 2 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } field_pieces_jointes: type: file_generic weight: 4 @@ -64,7 +76,7 @@ content: third_party_settings: { } field_textes: type: paragraphs - weight: 2 + weight: 3 region: content settings: title: Paragraphe @@ -89,27 +101,37 @@ content: third_party_settings: { } path: type: path - weight: 7 + weight: 8 region: content settings: { } third_party_settings: { } promote: type: boolean_checkbox - weight: 5 + weight: 6 region: content settings: display_label: true third_party_settings: { } + simple_sitemap: + weight: 11 + region: content + settings: { } + third_party_settings: { } + simple_sitemap_index_now: + weight: 12 + region: content + settings: { } + third_party_settings: { } status: type: boolean_checkbox - weight: 8 + weight: 9 region: content settings: display_label: true third_party_settings: { } sticky: type: boolean_checkbox - weight: 6 + weight: 7 region: content settings: display_label: true @@ -129,7 +151,7 @@ content: third_party_settings: { } uid: type: entity_reference_autocomplete - weight: 3 + weight: 4 region: content settings: match_operator: CONTAINS diff --git a/config/sync/core.entity_view_display.node.actualite.full.yml b/config/sync/core.entity_view_display.node.actualite.full.yml new file mode 100644 index 0000000..0d8918d --- /dev/null +++ b/config/sync/core.entity_view_display.node.actualite.full.yml @@ -0,0 +1,101 @@ +uuid: 0ca5aa5d-c7a9-4dba-b6d2-aca25c3bd831 +langcode: fr +status: true +dependencies: + config: + - core.entity_view_mode.node.full + - field.field.node.actualite.body + - field.field.node.actualite.field_date + - field.field.node.actualite.field_fichiers + - field.field.node.actualite.field_images + - field.field.node.actualite.field_liens + - field.field.node.actualite.field_type_d_actualite + - image.style.wide + - node.type.actualite + module: + - datetime_range + - file + - image_field_caption + - link + - manage_display + - text +id: node.actualite.full +targetEntityType: node +bundle: actualite +mode: full +content: + body: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 3 + region: content + field_date: + type: daterange_default + label: visually_hidden + settings: + timezone_override: '' + format_type: jj + separator: '-' + third_party_settings: { } + weight: 5 + region: content + field_fichiers: + type: file_default + label: visually_hidden + settings: + use_description_as_link_text: true + third_party_settings: { } + weight: 6 + region: content + field_images: + type: image_caption + label: visually_hidden + settings: + image_style: wide + image_link: '' + image_loading: + attribute: lazy + third_party_settings: { } + weight: 0 + region: content + field_liens: + type: link + label: visually_hidden + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + weight: 7 + region: content + field_type_d_actualite: + type: entity_reference_label + label: visually_hidden + settings: + link: true + third_party_settings: { } + weight: 4 + region: content + links: + settings: { } + third_party_settings: { } + weight: 2 + region: content + title: + type: title + label: hidden + settings: + link_to_entity: true + tag: h2 + third_party_settings: { } + weight: 1 + region: content +hidden: + created: true + langcode: true + search_api_excerpt: true + uid: true diff --git a/config/sync/core.entity_view_display.node.static.default.yml b/config/sync/core.entity_view_display.node.static.default.yml index c96a9f2..b5876d1 100644 --- a/config/sync/core.entity_view_display.node.static.default.yml +++ b/config/sync/core.entity_view_display.node.static.default.yml @@ -4,6 +4,7 @@ status: true dependencies: config: - field.field.node.static.body + - field.field.node.static.field_map - field.field.node.static.field_pieces_jointes - field.field.node.static.field_textes - node.type.static @@ -11,6 +12,7 @@ dependencies: - entity_reference_revisions - manage_display - text + - viewsreference _core: default_config_hash: 9mgezio6-8HiMYhQHSfouZjKyY4BFKR71Yh4kbSmAYU id: node.static.default @@ -25,6 +27,15 @@ content: third_party_settings: { } weight: 1 region: content + field_map: + type: viewsreference_formatter + label: visually_hidden + settings: + plugin_types: + - block + third_party_settings: { } + weight: 2 + region: content field_textes: type: entity_reference_revisions_entity_view label: visually_hidden @@ -32,12 +43,12 @@ content: view_mode: default link: '' third_party_settings: { } - weight: 2 + weight: 3 region: content links: settings: { } third_party_settings: { } - weight: 3 + weight: 4 region: content title: type: title diff --git a/config/sync/core.entity_view_display.node.static.full.yml b/config/sync/core.entity_view_display.node.static.full.yml index 76b8984..000f18f 100644 --- a/config/sync/core.entity_view_display.node.static.full.yml +++ b/config/sync/core.entity_view_display.node.static.full.yml @@ -5,6 +5,7 @@ dependencies: config: - core.entity_view_mode.node.full - field.field.node.static.body + - field.field.node.static.field_map - field.field.node.static.field_pieces_jointes - field.field.node.static.field_textes - node.type.static @@ -12,6 +13,7 @@ dependencies: - entity_reference_revisions - manage_display - text + - viewsreference _core: default_config_hash: 9mgezio6-8HiMYhQHSfouZjKyY4BFKR71Yh4kbSmAYU id: node.static.full @@ -26,6 +28,18 @@ content: third_party_settings: { } weight: 1 region: content + field_map: + type: viewsreference_formatter + label: hidden + settings: + plugin_types: + block: block + default: '0' + page: '0' + feed: '0' + third_party_settings: { } + weight: 2 + region: content field_textes: type: entity_reference_revisions_entity_view label: visually_hidden @@ -33,12 +47,12 @@ content: view_mode: default link: '' third_party_settings: { } - weight: 2 + weight: 3 region: content links: settings: { } third_party_settings: { } - weight: 3 + weight: 4 region: content title: type: title diff --git a/config/sync/core.entity_view_display.node.static.teaser.yml b/config/sync/core.entity_view_display.node.static.teaser.yml index 053fb48..4c5023e 100644 --- a/config/sync/core.entity_view_display.node.static.teaser.yml +++ b/config/sync/core.entity_view_display.node.static.teaser.yml @@ -5,6 +5,7 @@ dependencies: config: - core.entity_view_mode.node.teaser - field.field.node.static.body + - field.field.node.static.field_map - field.field.node.static.field_pieces_jointes - field.field.node.static.field_textes - node.type.static @@ -33,6 +34,7 @@ content: region: content hidden: created: true + field_map: true field_pieces_jointes: true field_textes: true langcode: true diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index e40a035..c1d0a82 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -119,6 +119,7 @@ module: views_bulk_edit: 0 views_bulk_operations: 0 views_ui: 0 + viewsreference: 0 yaml_editor: 0 extlink: 1 menu_admin_per_menu: 1 diff --git a/config/sync/field.field.node.static.field_map.yml b/config/sync/field.field.node.static.field_map.yml new file mode 100644 index 0000000..90587e0 --- /dev/null +++ b/config/sync/field.field.node.static.field_map.yml @@ -0,0 +1,36 @@ +uuid: b8723518-542b-4df0-97c5-04b632ac65bb +langcode: fr +status: true +dependencies: + config: + - field.storage.node.field_map + - node.type.static + - views.view.site + module: + - viewsreference +id: node.static.field_map +field_name: field_map +entity_type: node +bundle: static +label: map +description: '' +required: false +translatable: false +default_value: + - + target_uuid: 9e172612-e65e-4292-bb32-706c81ee98e3 + display_id: block_3 + data: 'a:6:{s:5:"pager";N;s:5:"title";N;s:5:"limit";N;s:6:"header";N;s:8:"argument";N;s:6:"offset";N;}' +default_value_callback: '' +settings: + handler: 'default:view' + handler_settings: + target_bundles: null + auto_create: false + plugin_types: + block: block + preselect_views: + site: site + enabled_settings: + title: title +field_type: viewsreference diff --git a/config/sync/field.storage.node.field_map.yml b/config/sync/field.storage.node.field_map.yml new file mode 100644 index 0000000..d8968ed --- /dev/null +++ b/config/sync/field.storage.node.field_map.yml @@ -0,0 +1,21 @@ +uuid: cd2ff55f-d680-4d0d-98a0-f95b36cef2d7 +langcode: fr +status: true +dependencies: + module: + - node + - views + - viewsreference +id: node.field_map +field_name: field_map +entity_type: node +type: viewsreference +settings: + target_type: view +module: viewsreference +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/sync/page_manager.page_variant.home-panels_variant-0.yml b/config/sync/page_manager.page_variant.home-panels_variant-0.yml index d2c37e4..ddce128 100644 --- a/config/sync/page_manager.page_variant.home-panels_variant-0.yml +++ b/config/sync/page_manager.page_variant.home-panels_variant-0.yml @@ -45,7 +45,7 @@ variant_settings: config_page_type: diaporama_home config_page_view_mode: full region: content - weight: -1 + weight: -2 uuid: 40cf53e9-ed23-4eeb-8f75-3dc26453edae css_classes: - '' diff --git a/config/sync/views.view.site.yml b/config/sync/views.view.site.yml index 5ea6f49..afbda36 100644 --- a/config/sync/views.view.site.yml +++ b/config/sync/views.view.site.yml @@ -644,6 +644,7 @@ display: display_plugin: block position: 2 display_options: + title: 'sites map' fields: field_geofield: id: field_geofield @@ -853,7 +854,7 @@ display: value: field_sous_titre options: '{"maxWidth":"300","minWidth":"50","autoPan":true}' view_mode: full - leaflet_map: esri-world_physical_map + leaflet_map: stamen-toner-lite height: '400' height_unit: px hide_empty_map: false @@ -871,10 +872,10 @@ display: options: '{"position":"topright","setView":"untilPanOrZoom","returnToPrevBounds":true,"keepCurrentZoomLevel":true,"strings":{"title":"Locate my position"}}' automatic: false map_position: - force: false + force: true center: - lat: 0.0 - lon: 0.0 + lat: 46.5819227 + lon: 2.4514603 zoomControlPosition: topleft zoom: 5 minZoom: 1 @@ -916,6 +917,7 @@ display: type: fields options: { } defaults: + title: false style: false row: false fields: false @@ -944,3 +946,312 @@ display: tags: - 'config:field.storage.node.field_geofield' - 'config:field.storage.node.field_sous_titre' + block_3: + id: block_3 + display_title: 'Sites Map Home Bloc' + display_plugin: block + position: 2 + display_options: + title: 'site home map' + fields: + field_geofield: + id: field_geofield + table: node__field_geofield + field: field_geofield + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: '' + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: geofield_default + settings: + output_format: wkt + output_escape: true + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_sous_titre: + id: field_sous_titre + table: node__field_sous_titre + field: field_sous_titre + relationship: none + group_type: group + admin_label: '' + plugin_id: field + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: true + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + title: + id: title + table: node_field_data + field: title + relationship: none + group_type: group + admin_label: '' + entity_type: node + entity_field: title + plugin_id: field + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: true + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + arguments: { } + style: + type: leaflet_map + options: + grouping: { } + data_source: + field_geofield: field_geofield + entity_source: __base_table + name_field: '' + leaflet_tooltip: + value: title + options: '{"permanent":false,"direction":"center"}' + leaflet_popup: + value: field_sous_titre + options: '{"maxWidth":"300","minWidth":"50","autoPan":true}' + view_mode: full + leaflet_map: stamen-toner-lite + height: '400' + height_unit: px + hide_empty_map: false + disable_wheel: true + gesture_handling: false + fitbounds_options: '{"padding":[0,0]}' + reset_map: + control: false + options: '{"position":"topleft","title":"Reset View"}' + map_scale: + control: false + options: '{"position":"bottomright","maxWidth":100,"metric":true,"imperial":false,"updateWhenIdle":false}' + locate: + control: false + options: '{"position":"topright","setView":"untilPanOrZoom","returnToPrevBounds":true,"keepCurrentZoomLevel":true,"strings":{"title":"Locate my position"}}' + automatic: false + map_position: + force: true + center: + lat: 46.5819227 + lon: 2.4514603 + zoomControlPosition: topleft + zoom: 5 + minZoom: 1 + maxZoom: 18 + zoomFiner: 0 + weight: '' + icon: + iconType: marker + iconUrl: '' + shadowUrl: '' + className: '' + iconSize: + x: '' + 'y': '' + iconAnchor: + x: '' + 'y': '' + shadowSize: + x: '' + 'y': '' + shadowAnchor: + x: '' + 'y': '' + popupAnchor: + x: '' + 'y': '' + html: '
' + html_class: leaflet-map-divicon + circle_marker_options: '{"radius":100,"color":"red","fillColor":"#f03","fillOpacity":0.5}' + fullscreen: + control: false + options: '{"position":"topleft","pseudoFullscreen":false}' + path: '{"color":"#3388ff","opacity":"1.0","stroke":true,"weight":3,"fill":"depends","fillColor":"*","fillOpacity":"0.2","radius":"6"}' + map_lazy_load: + lazy_load: false + feature_properties: + values: '' + row: + type: fields + options: { } + defaults: + title: false + style: false + row: false + fields: false + arguments: false + display_description: '' + display_extenders: + matomo: + enabled: false + keyword_gets: '' + keyword_behavior: first + keyword_concat_separator: ' ' + category_behavior: none + category_gets: '' + category_concat_separator: ' ' + category_fallback: '' + category_facets: { } + category_facets_concat_separator: ', ' + simple_sitemap_display_extender: { } + block_hide_empty: true + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - 'user.node_grants:view' + - user.permissions + tags: + - 'config:field.storage.node.field_geofield' + - 'config:field.storage.node.field_sous_titre' diff --git a/web/themes/custom/quartiers_de_demain/dist/assets/bundle.js b/web/themes/custom/quartiers_de_demain/dist/assets/bundle.js index f0efdc8..f4cbd31 100644 --- a/web/themes/custom/quartiers_de_demain/dist/assets/bundle.js +++ b/web/themes/custom/quartiers_de_demain/dist/assets/bundle.js @@ -26,7 +26,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ \******************************************/ /***/ (function() { -eval("document.addEventListener('scroll', function() {\n const scrolled = window.pageYOffset;\n const background = document.getElementById('background-animated');\n \n // Adjust this value to control the speed of the parallax effect\n const parallaxSpeed = 0.2;\n background.style.transform = 'translateY(' + (scrolled * parallaxSpeed) + 'px)';\n});\n\n\n\n\n //ANimation Pilliers \n// const svg = document.querySelector('#paragraph-id--7 .colone-picto');\n\n// // Configuration de l'observateur d'intersection\n// const observer = new IntersectionObserver(entries => {\n// entries.forEach(entry => {\n// if (entry.isIntersecting) {\n// // Ajoute une classe lorsque l'élément est visible\n// svg.classList.add('visible');\n// } else {\n// // Optionnel : Retirez la classe si nécessaire\n// svg.classList.remove('visible');\n// }\n// });\n// });\n\n// // Observer l'élément SVG\n// observer.observe(svg);\n\n//////////////////////////////////////////////////\n\n//ANimation Pilliers \nconst svg = document.querySelector('#paragraph-id--7 .colone-picto');\n\n// Configuration de l'observateur d'intersection\nconst observer = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n // Ajoute une classe lorsque l'élément est visible\n // svg.classList.remove('invisible');\n svg.classList.add('visible');\n } \n // else {\n // // Optionnel : Retirez la classe si nécessaire\n // svg.classList.remove('visible');\n\n // }\n });\n});\n\n// Observer l'élément SVG\nobserver.observe(svg);\n\n\n//# sourceURL=webpack://quartiers_de_demain/./src/assets/js/animated_formes.js?"); +eval("document.addEventListener('scroll', function() {\n const scrolled = window.pageYOffset;\n const background = document.getElementById('background-animated');\n if (background) {\n // Adjust this value to control the speed of the parallax effect\n const parallaxSpeed = 0.2;\n background.style.transform = 'translateY(' + (scrolled * parallaxSpeed) + 'px)';\n }\n});\n\n\n\n\n //ANimation Pilliers \n// const svg = document.querySelector('#paragraph-id--7 .colone-picto');\n\n// // Configuration de l'observateur d'intersection\n// const observer = new IntersectionObserver(entries => {\n// entries.forEach(entry => {\n// if (entry.isIntersecting) {\n// // Ajoute une classe lorsque l'élément est visible\n// svg.classList.add('visible');\n// } else {\n// // Optionnel : Retirez la classe si nécessaire\n// svg.classList.remove('visible');\n// }\n// });\n// });\n\n// // Observer l'élément SVG\n// observer.observe(svg);\n\n//////////////////////////////////////////////////\n\n//ANimation Pilliers \nconst svg = document.querySelector('#paragraph-id--7 .colone-picto');\n\nif (svg) {\n // Configuration de l'observateur d'intersection\n const observer = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n // Ajoute une classe lorsque l'élément est visible\n // svg.classList.remove('invisible');\n svg.classList.add('visible');\n } \n // else {\n // // Optionnel : Retirez la classe si nécessaire\n // svg.classList.remove('visible');\n \n // }\n });\n });\n \n // Observer l'élément SVG\n observer.observe(svg);\n \n}\n\n\n//# sourceURL=webpack://quartiers_de_demain/./src/assets/js/animated_formes.js?"); /***/ }), @@ -36,7 +36,7 @@ eval("document.addEventListener('scroll', function() {\n const scrolled = win \**********************************************/ /***/ (function() { -eval("/**\n * @file\n * quartiers_de_demain behaviors.\n */\n (function (Drupal) {\n\n 'use strict';\n \n Drupal.behaviors.quartiers_de_demain = {\n attach: function (context, settings) {\n console.log('It works!');\n }\n };\n } (Drupal));\n\n \n // jQuery(document).ready(function($){\n\n // $('.open-block').click(function(){\n // $(this).toggleClass('opened');\n\n // $('.header_nav_container').toggleClass('display-nav-opened');\n \n // if(mobile == true){\n // $(\"body\").css(\"overflow\",\"hidden\");\n // }\n\n // });\n \n // // Hide the header_nav_container when a link inside it is clicked\n // $('.header_nav_container li').click(function() {\n // $('.header_nav_container').fadeOut();\n // });\n\n\n\n\n // });\n\n //////// start header ////////////\n document.addEventListener('DOMContentLoaded', function() {\n\n const header = document.querySelector('header');\n const logo = document.querySelector('#block-quartiers-de-demain-logoquartiersdedemain > div:nth-child(1) > div:nth-child(1) > a:nth-child(1) > svg:nth-child(1)');\n const headerNavContainer = document.querySelector('.header_nav_container');\n const isFirstLoad = !performance.getEntriesByType(\"navigation\")[0].type.includes('back_forward');\n const isTargetPath = window.location.pathname === '/';\n\n // Fonction pour démarrer l'animation du logo SVG\n function startLogoAnimation() {\n logo.classList.add('animated');\n }\n \n // Fonction pour arrêter l'animation du logo SVG\n function stopLogoAnimation() {\n logo.classList.remove('animated');\n }\n \n // Vérifier si le header a la classe header--collapse\n function checkHeaderCollapse() {\n if (header.classList.contains('header--collapsed')) {\n stopLogoAnimation();\n } else if (header.classList.contains('header--collapsed-already')) {\n stopLogoAnimation();\n } else {\n startLogoAnimation();\n }\n\n }\n \n // Appeler la fonction au chargement initial\n checkHeaderCollapse();\n \n // Observer les changements de classe sur le header\n const observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n if (mutation.attributeName === 'class') {\n checkHeaderCollapse();\n }\n });\n });\n observer.observe(header, { attributes: true });\n \n\n // Si ce n'est pas la première charge ou si le chemin n'est pas le chemin cible, ajouter la classe immédiatement\n if (!isFirstLoad || !isTargetPath) {\n header.classList.add('header--collapsed-already');\n // logo.classList.remove('animated');\n stopLogoAnimation();\n } else {\n // Sinon, appliquer la transition après un délai\n setTimeout(() => {\n header.classList.add('header--collapsed');\n }, 5000);\n }\n\n //////////////////////////////////////\n\n let lastScrollTop = 0;\n let threshold = 100; // Change this value as needed\n let isHidden = false;\n \n function slideOut() {\n headerNavContainer.animate([\n { transform: 'translateX(0)' },\n { transform: 'translateX(-100%)' }\n ], {\n duration: 300,\n fill: 'forwards'\n });\n isHidden = true;\n }\n \n function slideIn() {\n headerNavContainer.animate([\n { transform: 'translateX(-100%)' },\n { transform: 'translateX(0)' }\n ], {\n duration: 300,\n fill: 'forwards'\n });\n isHidden = false;\n }\n \n function slideDown() {\n // headerNavContainer.style.display = 'block';\n headerNavContainer.animate([\n { transform: 'translateY(0%)' },\n { transform: 'translateY(+100%)' }\n ], {\n duration: 300,\n fill: 'forwards'\n });\n isHidden = false;\n }\n \n function slideUp() {\n headerNavContainer.animate([\n { transform: 'translateY(100%)' },\n { transform: 'translateY(0%)' }\n ], {\n duration: 300,\n fill: 'forwards'\n }).onfinish = function() {\n // headerNavContainer.style.display = 'none';\n };\n isHidden = true;\n }\n // Fonction pour ajuster la hauteur du header lors du défilement\n function adjustHeaderHeight() {\n if (window.scrollY > 0) {\n header.classList.add('shrink');\n } else {\n header.classList.remove('shrink');\n }\n }\n\n function handleScroll() {\n let scrollTop = window.pageYOffset || document.documentElement.scrollTop;\n const isMobile = window.innerWidth < 811;\n\n if (scrollTop > threshold && !isHidden) {\n if (isMobile) {\n slideUp();\n } else {\n slideOut();\n }\n } else if (scrollTop <= threshold && isHidden) {\n if (isMobile) {\n slideDown();\n } else {\n slideIn();\n }\n }\n \n \n lastScrollTop = scrollTop <= 0 ? 0 : scrollTop; // For Mobile or negative scrolling\n }\n \n function handleTouchAndMouseEnter() {\n if (isHidden) {\n if (window.innerWidth < 811) {\n slideDown();\n } else {\n slideIn();\n }\n }\n }\n \n function handleTouchAndMouseLeave() {\n if (lastScrollTop > threshold && !isHidden) {\n if (window.innerWidth < 811) {\n slideUp();\n } else {\n slideOut();\n }\n }\n }\n \n window.addEventListener('scroll', handleScroll);\n window.addEventListener('scroll', adjustHeaderHeight);\n \n // Mouse events for desktop\n header.addEventListener('mouseenter', handleTouchAndMouseEnter);\n header.addEventListener('mouseleave', handleTouchAndMouseLeave);\n \n // Touch events for tablets and mobile devices\n header.addEventListener('touchstart', handleTouchAndMouseEnter);\n header.addEventListener('touchend', handleTouchAndMouseLeave);\n \n // Initial check to see if we're at the top of the page\n if (window.pageYOffset <= threshold) {\n if (window.innerWidth < 811) {\n slideDown();\n } else { \n slideIn();\n } \n } else {\n if (window.innerWidth < 811) {\n slideUp();\n } else {\n slideIn();\n }\n }\n \n });\n\n //////// end header ////////////\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 = $('.sidebar_first_container'),\n fixedElementHeight = 500;\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\n //////////////////////// start script smooth apparition des textes /////////////////\n\n function scrollReaveal(){\n\n const nodes = {\n logo : document.querySelectorAll('#logo-animated-container'),\n chapeau : document.querySelectorAll('.field_body'),\n paragraph: document.querySelectorAll('.field_field_textes .paragraph--type--static-parts'),\n enjeux : document.querySelectorAll('.field_field_textes .paragraph--type--static-parts .enjeux'),\n }\n\n const showUp = {\n origin: 'bottom',\n delay: 100,\n duration: 1000,\n distance: '50px',\n easing: 'cubic-bezier(0.5, 0, 0, 1)'\n }\n\n const Show = {\n delay: 100,\n duration: 600,\n easing: 'cubic-bezier(0.5, 0, 0, 1)'\n }\n\n console.log(nodes);\n\n ScrollReveal().reveal(nodes.logo, Show);\n ScrollReveal().reveal(nodes.chapeau, showUp);\n ScrollReveal().reveal(nodes.paragraph, showUp);\n ScrollReveal().reveal(nodes.enjeux, showUp);\n }\n\n\n $( document ).ready(function() {\n scrollReaveal();\n });\n\n //////////////////////// end script smooth apparition des textes /////////////////\n\n //////////////////// start Timeline script ///////////////////////\n\n document.addEventListener('DOMContentLoaded', function() {\n let currentSlide = 0;\n \n //// responsive ///\n function getVisibleSlides() {\n if (window.innerWidth <= 600) {\n return 1; // Show 1 slide on small screens\n } else if (window.innerWidth <= 900) {\n return 4; // Show 4 slides on medium screens\n } else {\n return 4; // Show 4 slides on large screens\n }\n }\n \n function showSlides(index) {\n const slides = document.querySelectorAll('.__paragraphs');\n const totalSlides = slides.length;\n const visibleSlides = getVisibleSlides();\n const maxSlide = totalSlides - visibleSlides;\n \n // Adjust the index to ensure it loops\n if (index > maxSlide) {\n currentSlide = 0; // Go back to the first slide\n } else if (index < 0) {\n currentSlide = maxSlide; // Go to the last slide\n } else {\n currentSlide = index;\n }\n \n // Calculate the offset for the transform\n const offset = currentSlide * -50 / visibleSlides;\n const offsetmobile = currentSlide * -10 / visibleSlides;\n if (window.innerWidth <= 600){\n document.querySelector('.__timeline-content').style.transform = `translateX(${offsetmobile}%)`;\n } else {\n document.querySelector('.__timeline-content').style.transform = `translateX(${offset}%)`;\n }\n \n // Enable/disable arrows based on the current slide\n // document.getElementById('arrowPrev').disabled = false; // Always enabled now\n // document.getElementById('arrowNext').disabled = false; // Always enabled now\n }\n \n // function prevSlide() {\n // showSlides(currentSlide - 1);\n // }\n \n // function nextSlide() {\n // showSlides(currentSlide + 1);\n // }\n \n // // Attach event listeners\n // document.getElementById('arrowPrev').addEventListener('click', prevSlide);\n // document.getElementById('arrowNext').addEventListener('click', nextSlide);\n \n // Update month field to only show the first 3 letters\n document.querySelectorAll('.paragraph--type--phase-deroulement').forEach(function(paragraph) {\n const monthField = paragraph.querySelector('.field_field_date_de_moi div:nth-of-type(2)');\n if (monthField) {\n const monthText = monthField.textContent.trim();\n if (monthText === \"juillet\") {\n monthField.textContent = monthText.slice(0, 4);\n monthField.classList.add('after');\n } else if (monthText === \"juin\") {\n monthField.textContent = monthText.slice(0, 4);\n } else if (monthText.length > 3) {\n monthField.textContent = monthText.slice(0, 3);\n monthField.classList.add('after');\n }\n }\n });\n \n // Fonction pour ajouter ou retirer la classe .only\n function updateDateClasses() {\n document.querySelectorAll('.paragraph--type--phase-deroulement .date').forEach(function(dateElement) {\n const date2Element = dateElement.querySelector('.date2');\n const yearElement = dateElement.querySelector('.field_field_date_de_annee');\n \n if (date2Element && !date2Element.textContent.trim()) {\n if (yearElement) {\n yearElement.classList.add('only');\n }\n } else {\n if (yearElement) {\n yearElement.classList.remove('only');\n }\n }\n });\n }\n \n // Exécuter la fonction une première fois pour le contenu déjà présent\n updateDateClasses();\n \n // MutationObserver pour surveiller les changements dans le DOM\n const observer = new MutationObserver(function(mutationsList, observer) {\n for(let mutation of mutationsList) {\n if (mutation.type === 'childList') {\n updateDateClasses();\n }\n }\n });\n \n // Configuration de l'observateur\n const config = { childList: true, subtree: true };\n \n // Démarrer l'observateur sur le document entier ou sur un conteneur spécifique\n observer.observe(document.body, config);\n \n // Handle window resize\n window.addEventListener('resize', function() {\n showSlides(currentSlide); // Recalculate the slides on resize\n });\n \n // Initialize\n showSlides(currentSlide);\n });\n \n\n //////////////////////// end Timeline script /////////////////////////////////////////////\n\n /////////////////// caracteres body actus/////////////////////////\n\n document.addEventListener('DOMContentLoaded', function() {\n // Maximum number of characters to display\n const maxChars = 140; // Adjust this value as needed\n \n document.querySelectorAll('#actus-caroussel .node-type-actualite .field_body p').forEach(function(paragraph) {\n let text = paragraph.textContent.trim();\n if (text.length > maxChars) {\n let truncatedText = text.slice(0, maxChars) + '...';\n paragraph.textContent = truncatedText;\n }\n });\n });\n \n\n //////////// slideshow home ////////////////////////// \n\n $(document).ready(function(){\n $('.content-actus .view').slick({\n slidesToShow: 3,\n // slidesToScroll: 1,\n dots: false,\n arrows: true,\n centerMode: true,\n adaptiveHeight: true,\n autoplay: false,\n // autoplaySpeed: 1500,\n // infinite: true,\n // centerPadding: '100px',\n responsive: [\n {\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n adaptiveHeight: false,\n arrows: true,\n draggable: true,\n centerMode: true,\n autoplay: false,\n // autoplaySpeed: 2000,\n }\n }]\n });\n console.log('salut slick home');\n\n });\n\n ////////////////////// start diaporama home swiper /////////////////////////////////\n \n $(document).ready(function () {\n //initialize swiper when document ready\n var mySwiper = new Swiper ('.swiper-container', {\n \n speed: 400,\n spaceBetween: 100,\n // Optional parameters\n autoplay: {\n delay: 3000,\n disableOnInteraction: false,\n },\n direction: 'horizontal',\n loop: true,\n })\n });\n \n ////////////////////// end diaporama home swiper /////////////////////////////////\n \n\n ////////////////////// start calendrier home swiper /////////////////////////////////\n $(document).ready(function(){\n $('.paragraph--type--phase-deroulement').slick({\n slidesToShow: 3,\n // slidesToScroll: 1,\n dots: false,\n arrows: true,\n centerMode: true,\n adaptiveHeight: true,\n autoplay: false,\n draggable: true,\n // autoplaySpeed: 1500,\n // infinite: true,\n // centerPadding: '100px',\n responsive: [\n {\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n adaptiveHeight: false,\n arrows: true,\n draggable: true,\n centerMode: true,\n autoplay: false,\n // autoplaySpeed: 2000,\n }\n }]\n });\n console.log('salut slick home');\n \n });\n \n ////////////////////// end diaporama home swiper /////////////////////////////////\n\n \n\n})(jQuery, window);\n\n\n\n\n//# sourceURL=webpack://quartiers_de_demain/./src/assets/js/quartiers_de_demain.js?"); +eval("throw new Error(\"Module parse failed: Unexpected token (333:0)\\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders\\n| \\n| // Enable/disable arrows based on the current slide\\n> <<<<<<< HEAD\\n| // document.getElementById('arrowPrev').disabled = false; // Always enabled now\\n| // document.getElementById('arrowNext').disabled = false; // Always enabled now\");\n\n//# sourceURL=webpack://quartiers_de_demain/./src/assets/js/quartiers_de_demain.js?"); /***/ }) @@ -96,7 +96,7 @@ eval("/**\n * @file\n * quartiers_de_demain behaviors.\n */\n (function (Drupal) /******/ /******/ // startup /******/ // Load entry module and return exports -/******/ // This entry module can't be inlined because the eval devtool is used. +/******/ // This entry module doesn't tell about it's top-level declarations so it can't be inlined /******/ __webpack_modules__["./src/assets/js/quartiers_de_demain.js"](0, {}, __webpack_require__); /******/ __webpack_modules__["./src/assets/js/animated_formes.js"](0, {}, __webpack_require__); /******/ var __webpack_exports__ = {}; diff --git a/web/themes/custom/quartiers_de_demain/quartiers_de_demain.libraries.yml b/web/themes/custom/quartiers_de_demain/quartiers_de_demain.libraries.yml index 476496a..0ab95ee 100644 --- a/web/themes/custom/quartiers_de_demain/quartiers_de_demain.libraries.yml +++ b/web/themes/custom/quartiers_de_demain/quartiers_de_demain.libraries.yml @@ -1,5 +1,6 @@ # Main theme library. global: + version: 0.1 js: dist/assets/bundle.js: {} librairies/slick-1.8.1/slick/slick.min.js: {} diff --git a/web/themes/custom/quartiers_de_demain/src/assets/js/animated_formes.js b/web/themes/custom/quartiers_de_demain/src/assets/js/animated_formes.js index 5de3e3d..25c51d4 100644 --- a/web/themes/custom/quartiers_de_demain/src/assets/js/animated_formes.js +++ b/web/themes/custom/quartiers_de_demain/src/assets/js/animated_formes.js @@ -1,10 +1,11 @@ document.addEventListener('scroll', function() { const scrolled = window.pageYOffset; const background = document.getElementById('background-animated'); - - // Adjust this value to control the speed of the parallax effect - const parallaxSpeed = 0.2; - background.style.transform = 'translateY(' + (scrolled * parallaxSpeed) + 'px)'; + if (background) { + // Adjust this value to control the speed of the parallax effect + const parallaxSpeed = 0.2; + background.style.transform = 'translateY(' + (scrolled * parallaxSpeed) + 'px)'; + } }); @@ -34,21 +35,24 @@ document.addEventListener('scroll', function() { //ANimation Pilliers const svg = document.querySelector('#paragraph-id--7 .colone-picto'); -// Configuration de l'observateur d'intersection -const observer = new IntersectionObserver(entries => { - entries.forEach(entry => { - if (entry.isIntersecting) { - // Ajoute une classe lorsque l'élément est visible - // svg.classList.remove('invisible'); - svg.classList.add('visible'); - } - // else { - // // Optionnel : Retirez la classe si nécessaire - // svg.classList.remove('visible'); - - // } +if (svg) { + // Configuration de l'observateur d'intersection + const observer = new IntersectionObserver(entries => { + entries.forEach(entry => { + if (entry.isIntersecting) { + // Ajoute une classe lorsque l'élément est visible + // svg.classList.remove('invisible'); + svg.classList.add('visible'); + } + // else { + // // Optionnel : Retirez la classe si nécessaire + // svg.classList.remove('visible'); + + // } + }); }); -}); - -// Observer l'élément SVG -observer.observe(svg); + + // Observer l'élément SVG + observer.observe(svg); + +} diff --git a/web/themes/custom/quartiers_de_demain/src/assets/js/quartiers_de_demain.js b/web/themes/custom/quartiers_de_demain/src/assets/js/quartiers_de_demain.js index eb4870a..b9966df 100644 --- a/web/themes/custom/quartiers_de_demain/src/assets/js/quartiers_de_demain.js +++ b/web/themes/custom/quartiers_de_demain/src/assets/js/quartiers_de_demain.js @@ -320,15 +320,30 @@ // Calculate the offset for the transform const offset = currentSlide * -50 / visibleSlides; const offsetmobile = currentSlide * -10 / visibleSlides; - if (window.innerWidth <= 600){ - document.querySelector('.__timeline-content').style.transform = `translateX(${offsetmobile}%)`; - } else { - document.querySelector('.__timeline-content').style.transform = `translateX(${offset}%)`; + let timeline = document.querySelector('.__timeline-content'); + if (timeline) { + if (window.innerWidth <= 600){ + timeline.style.transform = `translateX(${offsetmobile}%)`; + } else { + timeline.style.transform = `translateX(${offset}%)`; + } } // Enable/disable arrows based on the current slide +<<<<<<< HEAD // document.getElementById('arrowPrev').disabled = false; // Always enabled now // document.getElementById('arrowNext').disabled = false; // Always enabled now +======= + // Attach event listeners + let arrowprev = document.getElementById('arrowPrev'); + if (arrowprev) { + arrowprev.disabled = false; // Always enabled now + } + let arrownext = document.getElementById('arrowNext') + if (arrownext) { + arrownext.disabled = false; // Always enabled now + } +>>>>>>> 6c2457bb060757b2098347e082eaa1c8e2b2d6a3 } // function prevSlide() { @@ -339,10 +354,24 @@ // showSlides(currentSlide + 1); // } +<<<<<<< HEAD // // Attach event listeners // document.getElementById('arrowPrev').addEventListener('click', prevSlide); // document.getElementById('arrowNext').addEventListener('click', nextSlide); +======= + // Attach event listeners + let arrowprev = document.getElementById('arrowPrev'); + if (arrowprev) { + arrowprev.addEventListener('click', prevSlide); + } + let arrownext = document.getElementById('arrowNext') + if (arrownext) { + arrownext.addEventListener('click', nextSlide); + } + + +>>>>>>> 6c2457bb060757b2098347e082eaa1c8e2b2d6a3 // Update month field to only show the first 3 letters document.querySelectorAll('.paragraph--type--phase-deroulement').forEach(function(paragraph) { const monthField = paragraph.querySelector('.field_field_date_de_moi div:nth-of-type(2)'); @@ -427,52 +456,58 @@ //////////// slideshow home ////////////////////////// $(document).ready(function(){ - $('.content-actus .view').slick({ - slidesToShow: 3, - // slidesToScroll: 1, - dots: false, - arrows: true, - centerMode: true, - adaptiveHeight: true, - autoplay: false, - // autoplaySpeed: 1500, - // infinite: true, - // centerPadding: '100px', - responsive: [ - { - breakpoint: 810, - settings: { - slidesToShow: 1, - adaptiveHeight: false, - arrows: true, - draggable: true, - centerMode: true, - autoplay: false, - // autoplaySpeed: 2000, - } - }] - }); - console.log('salut slick home'); + let actuview = $('.content-actus .view') + if (actuview) { + actuview.slick({ + slidesToShow: 3, + // slidesToScroll: 1, + dots: false, + arrows: true, + centerMode: true, + adaptiveHeight: true, + autoplay: false, + // autoplaySpeed: 1500, + // infinite: true, + // centerPadding: '100px', + responsive: [ + { + breakpoint: 810, + settings: { + slidesToShow: 1, + adaptiveHeight: false, + arrows: true, + draggable: true, + centerMode: true, + autoplay: false, + // autoplaySpeed: 2000, + } + }] + }); + console.log('salut slick home'); + + } }); ////////////////////// start diaporama home swiper ///////////////////////////////// - - $(document).ready(function () { - //initialize swiper when document ready - var mySwiper = new Swiper ('.swiper-container', { + + // PAS DE SWIPER CHARGÉ DANS L'ENV JS ... + + // $(document).ready(function () { + // //initialize swiper when document ready + // let mySwiper = new Swiper ('.swiper-container', { - speed: 400, - spaceBetween: 100, - // Optional parameters - autoplay: { - delay: 3000, - disableOnInteraction: false, - }, - direction: 'horizontal', - loop: true, - }) - }); + // speed: 400, + // spaceBetween: 100, + // // Optional parameters + // autoplay: { + // delay: 3000, + // disableOnInteraction: false, + // }, + // direction: 'horizontal', + // loop: true, + // }) + // }); ////////////////////// end diaporama home swiper /////////////////////////////////