css node-type-ressource

This commit is contained in:
2025-11-05 01:09:18 +01:00
parent 77b82ce054
commit 35bedc622b
7 changed files with 552 additions and 3 deletions

View File

@@ -562,7 +562,7 @@ $(document).ready(function(){
//////////////// start lightbox galerie image page site//////////////////////// //////////////// start lightbox galerie image page site////////////////////////
// Sélection des images à ouvrir dans la lightbox // Sélection des images à ouvrir dans la lightbox
let images = document.querySelectorAll('.paragraph--type--site-diapo .lightbox-trigger, .paragraph--type--projet-diapo .lightbox-trigger'); let images = document.querySelectorAll('.paragraph--type--site-diapo .lightbox-trigger, .paragraph--type--projet-diapo .lightbox-trigger, .imgages');
let currentIndex; let currentIndex;
// Création de la lightbox // Création de la lightbox

File diff suppressed because one or more lines are too long

View File

@@ -4431,6 +4431,228 @@ body {
text-transform: uppercase; text-transform: uppercase;
} }
.node-type-ressource .layout-content {
margin-top: 2rem;
max-width: 100vw;
}
.node-type-ressource .layout-content .content_container {
width: 90% !important;
}
.node-type-ressource .layout--threecol-25-50-25 {
flex-wrap: nowrap;
justify-content: end;
}
@media (max-width: 810px) {
.node-type-ressource .layout--threecol-25-50-25 {
display: flex;
flex-direction: column;
width: 100%;
}
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second {
margin: auto;
flex: 0 1 70% !important;
margin-top: 1rem;
margin-right: 2rem;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second {
display: flex;
flex-direction: column;
flex-wrap: wrap;
margin-left: 2rem;
margin-right: 3rem;
}
@media (max-width: 500px) {
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second {
margin-left: 0.5rem;
margin-top: 1rem;
}
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second .field_title,
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second .field_field_sous_titre {
font-family: "gilroy-semibold";
font-size: 1.3rem;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_title) {
align-content: end;
order: 1;
color: rgb(7, 50, 194);
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_title) h2 {
margin: 0;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second .field_field_sous_titre {
font-size: 0.9rem;
padding-left: 1.5rem;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_sous_titre) {
flex: 0 0 100%;
order: 2;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_author) {
order: 3;
font-family: "gilroy-light";
font-size: 1.3rem;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_mots_clefs) {
order: 5;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_mots_clefs) .field_field_mots_clefs {
display: flex;
flex-direction: row;
margin-top: 1rem;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_mots_clefs) .field_field_mots_clefs div {
border: solid 1px rgb(7, 50, 194);
margin-right: 0.2rem;
padding: 0.1rem 0.2rem;
font-size: 0.6rem;
font-family: "gilroy-semibold";
color: rgb(7, 50, 194);
}
@media (max-width: 810px) {
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_mots_clefs) .field_field_mots_clefs div {
font-size: 0.8rem;
}
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_site) {
order: 6;
margin-top: 0.5rem;
padding-bottom: 1rem;
margin-bottom: 1rem;
border-bottom: solid 1px black;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_site) .field_field_site {
position: relative;
padding-left: 20px;
color: rgb(247, 0, 43);
font-family: "gilroy-semibold";
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_site) .field_field_site:before {
content: "";
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 1em;
height: 1em;
background-image: url("../img/map_pointer.svg");
background-size: contain;
background-repeat: no-repeat;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_body) {
order: 7;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_body) .field_body {
font-family: "gilroy-light";
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_body) .field_body p {
margin-top: 0;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_documents) {
order: 8 !important;
margin-bottom: 0.5rem;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_documents) .field_field_documents {
display: inline-flex;
align-items: center;
color: white;
background: black;
padding-left: 0.5rem;
text-transform: uppercase;
font-size: 0.5rem;
margin-bottom: 0.3rem;
padding: 0.3rem;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_documents) .field_field_documents a {
color: white;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_documents) .field_field_documents svg {
display: none;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_liens) {
order: 9;
margin-bottom: 1.5rem;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_liens) .field_field_liens {
display: inline-flex;
align-items: center;
color: white;
background: black;
padding-left: 0.5rem;
text-transform: uppercase;
font-size: 0.5rem;
margin-bottom: 0.3rem;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_liens) .field_field_liens svg {
display: none;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_liens) .field_field_liens::after {
display: inline-flex;
content: url("../img/noun-arrow-to-right.svg");
padding-right: 0.2rem;
padding-left: 0.2rem;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_liens) .field_field_liens a {
color: white;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_images) {
order: 10;
width: 100%;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_images) .diaporama {
display: flex !important;
flex-direction: row !important;
gap: 20px;
flex-wrap: wrap;
margin-bottom: 2rem;
}
@media (max-width: 500px) {
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_images) .diaporama {
flex-direction: column !important;
}
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_images) .diaporama .images img {
object-fit: cover;
width: 220px !important;
height: 145px;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_images) .diaporama .image-field-caption {
margin: 0;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field_field_images) .diaporama .image-field-caption p {
margin-top: 0;
font-size: 0.5rem;
font-family: "gilroy-light";
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field--name-field-documents) {
order: 5;
margin-top: 0.5rem;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field--name-field-documents) .field--name-field-documents a {
display: inline-flex;
align-items: center;
color: white;
background: black;
padding-left: 0.5rem;
text-transform: uppercase;
font-size: 0.5rem;
margin-bottom: 0.3rem;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field--name-field-documents) .field--name-field-documents a svg {
display: none;
}
.node-type-ressource .layout--threecol-25-50-25 .layout__region--second .block-region-second div:has(.field--name-field-documents) .field--name-field-documents a::after {
display: inline-flex;
content: url("../img/noun-arrow-to-right.svg");
padding-right: 0.2rem;
padding-left: 0.2rem;
}
.field_field_liens_site > div:nth-child(2) > div:nth-child(1) {
display: flex;
flex-direction: column;
}
main { main {
background-color: #f6f7f3; background-color: #f6f7f3;
} }

View File

@@ -504,7 +504,7 @@ $(document).ready(function(){
//////////////// start lightbox galerie image page site//////////////////////// //////////////// start lightbox galerie image page site////////////////////////
// Sélection des images à ouvrir dans la lightbox // Sélection des images à ouvrir dans la lightbox
let images = document.querySelectorAll('.paragraph--type--site-diapo .lightbox-trigger, .paragraph--type--projet-diapo .lightbox-trigger'); let images = document.querySelectorAll('.paragraph--type--site-diapo .lightbox-trigger, .paragraph--type--projet-diapo .lightbox-trigger, .imgages');
let currentIndex; let currentIndex;
// Création de la lightbox // Création de la lightbox

View File

@@ -0,0 +1,242 @@
.node-type-ressource{
.layout-content{
margin-top: 2rem;
max-width: 100vw;
.content_container{
width: 90% !important;
}
}
.layout--threecol-25-50-25{
flex-wrap: nowrap;
justify-content: end;
@media(max-width: 810px){
display: flex;
flex-direction: column;
width: 100%;
}
.layout__region--second{
margin: auto;
flex: 0 1 70% !important;
margin-top: 1rem;
margin-right: 2rem;
// width: 60%;
.block-region-second{
display: flex;
flex-direction: column;
flex-wrap: wrap;
margin-left: 2rem;
margin-right: 3rem;
@media(max-width: 500px){
margin-left: 0.5rem;
margin-top: 1rem;
}
.field_title,
.field_field_sous_titre{
font-family: "gilroy-semibold";
font-size: 1.3rem;
}
div:has(.field_title){
align-content: end;
order: 1;
color: $blue_QDD;
h2{
margin: 0;
}
}
.field_field_sous_titre{
font-size: 0.9rem;
padding-left: 1.5rem;
}
div:has(.field_field_sous_titre){
flex: 0 0 100%;
order: 2;
}
div:has(.field_field_author){
order: 3;
font-family: "gilroy-light";
font-size: 1.3rem;
}
div:has(.field_field_mots_clefs){
order: 5;
.field_field_mots_clefs{
display: flex;
flex-direction: row;
margin-top: 1rem;
div{
border: solid 1px $blue_QDD;
margin-right: 0.2rem;
padding: 0.1rem 0.2rem;
font-size: 0.6rem;
font-family: "gilroy-semibold";
color: $blue_QDD;
@media(max-width: 810px){
font-size: 0.8rem;
}
}
}
}
div:has(.field_field_site){
order: 6;
margin-top: 0.5rem ;
padding-bottom: 1rem ;
margin-bottom: 1rem;
border-bottom: solid 1px black;
.field_field_site{
position: relative;
padding-left: 20px; // Ajuster selon la taille de l'icône
&:before {
content: "";
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 1em;
height: 1em;
background-image: url("../img/map_pointer.svg");
background-size: contain;
background-repeat: no-repeat;
}
color: $red_QDD;
font-family: "gilroy-semibold";
}
}
div:has(.field_body){
order: 7;
.field_body{
font-family: "gilroy-light";
p{
margin-top: 0;
}
}
}
div:has(.field_field_documents){
order: 8 !important;
margin-bottom: 0.5rem;
.field_field_documents{
display: inline-flex;
a{color: white;}
align-items: center;
color: white;
background: black;
padding-left: 0.5rem;
text-transform: uppercase;
font-size: 0.5rem;
margin-bottom: 0.3rem;
padding: 0.3rem;
svg{
display: none;
}
}
}
div:has(.field_field_liens){
order: 9;
margin-bottom: 1.5rem;
.field_field_liens{
display: inline-flex;
align-items: center;
color: white;
background: black;
padding-left: 0.5rem;
text-transform: uppercase;
font-size: 0.5rem;
margin-bottom: 0.3rem;
svg{
display: none;
}
&::after{
display: inline-flex;
content: url("../img/noun-arrow-to-right.svg");
padding-right: 0.2rem;
padding-left: 0.2rem;
}
a{
color: white;
}
}
}
div:has(.field_field_images){
order: 10;
width: 100%;
.diaporama{
display: flex !important;
flex-direction: row !important;
// justify-content: space-between;
gap: 20px;
flex-wrap: wrap;
margin-bottom: 2rem;
@media(max-width: 500px){
flex-direction: column !important;
}
.images{
// margin: auto;
img{
object-fit: cover;
width: 220px !important;
height: 145px;
}
}
.image-field-caption{
margin: 0;
// max-width: 200px;
p{
margin-top: 0;
font-size: 0.5rem;
font-family: 'gilroy-light';
}
}
}
}
div:has(.field--name-field-documents){
order: 5;
margin-top: 0.5rem;
.field--name-field-documents{
a{
display: inline-flex;
align-items: center;
color: white;
background: black;
padding-left: 0.5rem;
text-transform: uppercase;
font-size: 0.5rem;
margin-bottom: 0.3rem;
svg{
display: none;
}
&::after{
display: inline-flex;
content: url("../img/noun-arrow-to-right.svg");
padding-right: 0.2rem;
padding-left: 0.2rem;
// padding-bottom: 0.2rem;
}
}
}
}
div:has(.field_field_liens){
}
}
}
}
}
.field_field_liens_site > div:nth-child(2) > div:nth-child(1){
display: flex;
flex-direction: column;
}

View File

@@ -49,6 +49,7 @@
@import "pages/node-type-actualite"; @import "pages/node-type-actualite";
@import "pages/node-type-site"; @import "pages/node-type-site";
@import "pages/node-type-projet"; @import "pages/node-type-projet";
@import "pages/node-type-ressource";
@import "pages/lessites.scss"; @import "pages/lessites.scss";
@import "pages/lesprojets.scss"; @import "pages/lesprojets.scss";
@import "pages/ressources"; @import "pages/ressources";

View File

@@ -0,0 +1,84 @@
{#
/**
* @file
* Default theme implementation for a field.
*
* To override output, copy the "field.html.twig" from the templates directory
* to your theme's directory and customize it, just like customizing other
* Drupal templates such as page.html.twig or node.html.twig.
*
* Instead of overriding the theming for all fields, you can also just override
* theming for a subset of fields using
* @link themeable Theme hook suggestions. @endlink For example,
* here are some theme hook suggestions that can be used for a field_foo field
* on an article node type:
* - field--node--field-foo--article.html.twig
* - field--node--field-foo.html.twig
* - field--node--article.html.twig
* - field--field-foo.html.twig
* - field--text-with-summary.html.twig
* - field.html.twig
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - label_hidden: Whether to show the field label or not.
* - title_attributes: HTML attributes for the title.
* - label: The label for the field.
* - multiple: TRUE if a field can contain multiple items.
* - items: List of all the field items. Each item contains:
* - attributes: List of HTML attributes for each item.
* - content: The field item's content.
* - entity_type: The entity type to which the field belongs.
* - field_name: The name of the field.
* - field_type: The type of the field.
* - label_display: The display settings for the label.
*
* @see template_preprocess_field()
*
* @ingroup themeable
*/
#}
{%
set title_classes = [
'field',
'field--name-' ~ field_name|clean_class,
'field--type-' ~ field_type|clean_class,
'field--label-' ~ label_display,
label_display == 'visually_hidden' ? 'visually-hidden',
]
%}
{%
set ancre_href = '#paragraph-id--' ~ paragraph.id()
%}
{% if label_hidden %}
{% if multiple %}
<div{{ attributes }}>
{% for item in items %}
<div{{ item.attributes }}>{{ item.content }}</div>
{% endfor %}
</div>
{% else %}
{% for item in items %}
<div{{ attributes }}>{{ item.content }}</div>
{% endfor %}
{% endif %}
{% else %}
<div{{ attributes }}>
<div{{ title_attributes.addClass(title_classes) }}>{{ label }}</div>
{% if multiple %}
<div class='diaporama'>
{% endif %}
{% for item in items %}
<div class='images' {{ item.attributes }}>{{ item.content }}</div>
{% endfor %}
{% if multiple %}
</div>
{% endif %}
<div id="lightbox" class="lightbox">
<span class="close">&times;</span>
<img class="lightbox-content" id="lightbox-img">
<a class="prev" id="prev"><img src="/themes/custom/quartiers_de_demain/dist/assets/img/prev.svg" alt="Précédent"></a>
<a class="next" id="next"><img src="/themes/custom/quartiers_de_demain/dist/assets/img/next.svg" alt="Suivant"></a>
</div>
</div>
{% endif %}