Compare commits

...

2 Commits

Author SHA1 Message Date
fb9ffed293 ajustement css carroussel actu 2025-03-03 12:28:20 +01:00
84fece051f ajustement js longueru texte actus 2025-03-03 12:23:37 +01:00
4 changed files with 29 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@ -1627,7 +1627,7 @@ footer {
}
#actus-caroussel .content-actus .views-row article.node-type-actualite .field_body p {
margin: 0;
margin-bottom: 1rem;
margin-bottom: 0.5rem;
font-size: 0.7rem;
}
#actus-caroussel .content-actus .views-row article.node-type-actualite .field_field_liens {

View File

@ -358,17 +358,34 @@
/////////////////// caracteres body actus/////////////////////////
document.addEventListener('DOMContentLoaded', function() {
// Maximum number of characters to display
const maxChars = 140; // Adjust this value as needed
document.querySelectorAll('#actus-caroussel .node-type-actualite .field_body p').forEach(function(paragraph) {
let text = paragraph.textContent.trim();
if (text.length > maxChars) {
let truncatedText = text.slice(0, maxChars) + '...';
paragraph.textContent = truncatedText;
}
// 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 = "";
// 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) + '...';
// 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";
}
}
});
});
//////////// start slideshow home //////////////////////////

View File

@ -137,7 +137,7 @@
font-family: 'gilroy-regular';
p{
margin: 0;
margin-bottom: 1rem;
margin-bottom: 0.5rem;
font-size: 0.7rem ;
}
}