fix tamporaire bug actu carroussel

This commit is contained in:
2025-03-03 17:25:43 +01:00
parent 7176f2d82d
commit f745ce2f6c
5 changed files with 128 additions and 51 deletions

View File

@@ -357,33 +357,33 @@
/////////////////// caracteres body actus/////////////////////////
// document.addEventListener('DOMContentLoaded', function() {
// // Nombre maximum de caractères à afficher
// const maxChars = 140; // Ajustez cette valeur selon vos besoins
document.addEventListener('DOMContentLoaded', function() {
// Nombre maximum de caractères à afficher
const maxChars = 140; // Ajustez cette valeur selon vos besoins
// document.querySelectorAll('#actus-caroussel .node-type-actualite').forEach(function(node) {
// let paragraphs = node.querySelectorAll('.field_body p');
// let fullText = "";
document.querySelectorAll('#actus-caroussel .node-type-actualite').forEach(function(node) {
let paragraphs = node.querySelectorAll('.field_body p');
let fullText = "";
// // Concaténer tous les paragraphes
// paragraphs.forEach(p => fullText += p.textContent.trim() + " ");
// fullText = fullText.trim();
// Concaténer tous les paragraphes
paragraphs.forEach(p => fullText += p.textContent.trim() + " ");
fullText = fullText.trim();
// // Vérifier si le texte dépasse la limite
// if (fullText.length > maxChars) {
// let truncatedText = fullText.slice(0, maxChars) + '...';
// Vérifier si le texte dépasse la limite
if (fullText.length > maxChars) {
let truncatedText = fullText.slice(0, maxChars) + '...';
// // Vider tout le contenu et insérer seulement le texte tronqué
// let firstParagraph = paragraphs[0];
// firstParagraph.textContent = truncatedText;
// Vider tout le contenu et insérer seulement le texte tronqué
let firstParagraph = paragraphs[0];
firstParagraph.textContent = truncatedText;
// // Masquer les autres paragraphes
// for (let i = 1; i < paragraphs.length; i++) {
// paragraphs[i].style.display = "none";
// }
// }
// });
// });
// Masquer les autres paragraphes
for (let i = 1; i < paragraphs.length; i++) {
paragraphs[i].style.display = "none";
}
}
});
});

View File

@@ -2,7 +2,7 @@
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 4rem;
// padding-bottom: 4rem;
h2{
width: fit-content;
@@ -18,6 +18,9 @@
top: -2.5rem;
}
.content-actus{
.slick-list{
padding-bottom: 4rem;
}
.view{
display: flex;
flex-direction: row;
@@ -33,8 +36,12 @@
padding-top: 3rem;
}
article.node-type-actualite{
a{
display: flex;
flex-direction: column;
h2{
display: none;
}
.field_field_images{
order: 1;
background-color: black;
@@ -100,6 +107,9 @@
}
.infos-actu{
order: 2;
h2{
font-family: 'gilroy-semibold';
}
}
.field_field_date{
@@ -140,11 +150,42 @@
margin-bottom: 1rem;
font-size: 0.7rem ;
}
a{
color: $blue_QDD;
}
}
.field_field_liens{
order: 5;
width: fit-content;
padding-left: 0.5rem;
// padding-bottom: 0.2rem;
// padding-top: 0.2rem;
background: black;
@media (max-width:810px) {
margin-left: 0;
}
a{
display: inline-flex;
align-items: center;
color: white;
text-transform: uppercase;
font-size: 0.6rem;
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;
}
}
}
}
}
}
.views-row:nth-child(odd){