templates/default/index.html.twig line 1
{% extends 'base_front.html.twig' %}
{% block title %}Hello DefaultController!{% endblock %}
{% block body %}
<section id="animated-slider" class="slider-with-animations">
<!-- Fond flou dynamique (optionnel) -->
<div class="slider-background"></div>
<div class="swiper-container">
<div class="swiper-wrapper">
{% for actualite in actualites %}
<div class="swiper-slide">
<div class="slide-content">
<a href="upload/actualites/{{ actualite.imageNom }}" data-lightbox="animated-gallery">
<img src="upload/actualites/{{ actualite.imageNom }}" alt="Image 1" class="slide-image">
<div class="slide-caption animate-on-scroll">
<!-- <h3 class="title-animate">Titre Image 1</h3>-->
<!--<p class="desc-animate">Description de l'image 1</p>-->
</div>
</a>
</div>
</div>
{% endfor %}
<!-- Slide 1 -->
{# <div class="swiper-slide">
<div class="slide-content">
<a href="upload/actualites/actualite_photo_15.jpg" data-lightbox="animated-gallery">
<img src="upload/actualites/actualite_photo_15.jpg" alt="Image 1" class="slide-image">
<div class="slide-caption animate-on-scroll">
<!-- <h3 class="title-animate">Titre Image 1</h3>-->
<!--<p class="desc-animate">Description de l'image 1</p>-->
</div>
</a>
</div>
</div>
<!-- Slide 2 -->
<div class="swiper-slide">
<div class="slide-content">
<a href="upload/actualites/actualite_photo_16.jpg" data-lightbox="animated-gallery">
<img src="upload/actualites/actualite_photo_16.jpg" alt="Image 2" class="slide-image">
<div class="slide-caption animate-on-scroll">
<!-- <h3 class="title-animate">Titre Image 2</h3>-->
<!-- <p class="desc-animate">Description de l'image 2</p>-->
</div>
</a>
</div>
</div>
</div>#}
<!-- Navigation -->
<!-- Pagination with animation -->
<div class="swiper-pagination anim-pag"></div>
</div>
</section>
<!-- Content ============================================= -->
<!--
<section id="content">
<div class="content-wrap" style="padding: 0;">
<div class="container mb-4">
<h2 class="text-center mb-4 ls-1">Nos Projets</h2>
<div class="row justify">
{% if projets is empty %}
<p class="text-center">Aucun projet disponible pour le moment.</p>
{% else %}
{% for projet in projets %}
<div class="col-sm-6 col-lg-3 mb-4">
<a href="{{ path('app_projet_details', {'id': projet.id}) }}">
<div class="feature-box media-box">
<div class="fbox-media">
{% if projet.image is not null %}
<img class="rounded img-fluid" src="/upload/projets/{{ projet.image }}" alt="{{ projet.image }}" style="height:50%;">
{% else %}
<img class="rounded img-fluid" src="/upload/staicImage/logoProjetStatic.png" alt="Default Image" style="height:112px;width: 39%;">
{% endif %}
</div>
<div class="fbox-content px-2">
<h3>{{ projet.nom }}<span class="subtitle">{{ projet.structure.nomLong }}</span></h3>
</div>
</div>
</a>
</div>
{% endfor %}
{% endif %}
</div>
</div>
</div>
</section>
-->
<!-- #content end -->
<!-- Content ============================================= -->
<section id="content" class="research-content">
<div class="content-wrap" style="padding: 0;">
<!-- Projects Section -->
<div class="container py-5">
<div class="section-header text-center mb-5">
<h2 class="section-title">Certains de nos projets les plus appréciés</h2>
</div>
<div class="row g-4 justify-content-center">
{% if projets is empty %}
<p class="text-center">Aucun projet disponible pour le moment.</p>
{% else %}
{% for projet in projets %}
<div class="col-sm-6 col-lg-3">
<div class="project-card">
<div class="project-media">
{% if projet.image is not null %}
<img class="project-image" src="/upload/projets/{{ projet.image }}" alt="{{ projet.nom }}">
{% else %}
<img class="project-image" src="/upload/staicImage/empty-project.jpg" alt="{{ projet.nom }}">
{% endif %}
<div class="project-overlay">
<a href="{{ path('app_projet_details', {'id': projet.id}) }}" class="btn btn-outline-light">Voir le projet</a>
</div>
</div>
<div class="project-content">
<h3 class="project-title">
<a href="{{ path('app_projet_details', {'id': projet.id}) }}">
{{ projet.nom }}
</a>
</h3>
<p class="project-category">{{ projet.structure.nomLong }}</p>
</div>
</div>
</div>
{% endfor %}
{% endif %}
</div>
</div>
<!-- Stats Section -->
<div class="stats-section py-5">
<div class="container">
<div class="row g-4 justify-content-center">
<div class="col-lg-3 col-md-6">
<div class="stat-card">
<div class="stat-icon">
<img src="/front/icons/structure-recherche.png" alt="Structures de recherche">
</div>
{# <div class="stat-content">
<div class="stat-number counter" data-from="0" data-target="{{ nbrStructureRecherche }}">0</div>
<h3 class="stat-title">Structures de recherche</h3>
</div>#}
<div class="stat-content position-relative text-center">
<!-- Badge container with subtle border and shadow -->
<div class="stat-badge position-relative bg-white rounded-4 p-2 shadow-sm mb-3">
<!-- Animated counter number -->
<div class="stat-number counter display-3 fw-bold mb-1" data-target="{{ nbrStructureRecherche }}">0</div>
</div>
<!-- Title with animated underline -->
<h3 class="stat-title fs-5 fw-medium text-uppercase letter-spacing-1 position-relative d-inline-block px-3">
Structures de recherche
<span class="title-underline"></span>
</h3>
<!-- Decorative corner elements -->
{# <span class="position-absolute top-0 start-0 stat-corner stat-corner-tl"></span>
<span class="position-absolute top-0 end-0 stat-corner stat-corner-tr"></span>
<span class="position-absolute bottom-0 start-0 stat-corner stat-corner-bl"></span>
<span class="position-absolute bottom-0 end-0 stat-corner stat-corner-br"></span>#}
</div>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="stat-card">
<div class="stat-icon">
<img src="/front/icons/chercheurs.png" alt="Chercheurs">
</div>
{# <div class="stat-content">
<div class="stat-number counter" data-from="0" data-target="{{ nbrChercheurs }}">0</div>
<h3 class="stat-title">Chercheurs</h3>
</div>#}
<div class="stat-content position-relative text-center">
<!-- Badge container with subtle border and shadow -->
<div class="stat-badge position-relative bg-white rounded-4 p-2 shadow-sm mb-3">
<!-- Animated counter number -->
<div class="stat-number counter display-3 fw-bold mb-1" data-target="{{ nbrChercheurs }}">0</div>
</div>
<!-- Title with animated underline -->
<h3 class="stat-title fs-5 fw-medium text-uppercase letter-spacing-1 position-relative d-inline-block px-3">
Chercheurs
<span class="title-underline"></span>
</h3>
<!-- Decorative corner elements -->
{# <span class="position-absolute top-0 start-0 stat-corner stat-corner-tl"></span>
<span class="position-absolute top-0 end-0 stat-corner stat-corner-tr"></span>
<span class="position-absolute bottom-0 start-0 stat-corner stat-corner-bl"></span>
<span class="position-absolute bottom-0 end-0 stat-corner stat-corner-br"></span>#}
</div>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="stat-card">
<div class="stat-icon">
<img src="/front/icons/projet.png" alt="Projets">
</div>
{#<div class="stat-content">
<div class="stat-number counter" data-from="0" data-target="{{ nbrProjet }}">0</div>
<h3 class="stat-title">Projets</h3>
</div>#}
<div class="stat-content position-relative text-center">
<!-- Badge container with subtle border and shadow -->
<div class="stat-badge position-relative bg-white rounded-4 p-2 shadow-sm mb-3">
<!-- Animated counter number -->
<div class="stat-number counter display-3 fw-bold mb-1" data-target="{{ nbrProjet }}">0</div>
</div>
<!-- Title with animated underline -->
<h3 class="stat-title fs-5 fw-medium text-uppercase letter-spacing-1 position-relative d-inline-block px-3">
Projets
<span class="title-underline"></span>
</h3>
<!-- Decorative corner elements -->
{# <span class="position-absolute top-0 start-0 stat-corner stat-corner-tl"></span>
<span class="position-absolute top-0 end-0 stat-corner stat-corner-tr"></span>
<span class="position-absolute bottom-0 start-0 stat-corner stat-corner-bl"></span>
<span class="position-absolute bottom-0 end-0 stat-corner stat-corner-br"></span>#}
</div>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="stat-card">
<div class="stat-icon">
<img src="/front/icons/journal.png" alt="Publications">
</div>
{#<div class="stat-content">
<div class="stat-number counter" data-from="0" data-target="{{ nbrPublications }}">0</div>
<h3 class="stat-title">Publications</h3>
</div>#}
<div class="stat-content position-relative text-center">
<!-- Badge container with subtle border and shadow -->
<div class="stat-badge position-relative bg-white rounded-4 p-2 shadow-sm mb-3">
<!-- Animated counter number -->
<div class="stat-number counter display-3 fw-bold mb-1" data-target="{{ nbrPublications }}">0</div>
</div>
<!-- Title with animated underline -->
<h3 class="stat-title fs-5 fw-medium text-uppercase letter-spacing-1 position-relative d-inline-block px-3">
Publications
<span class="title-underline"></span>
</h3>
<!-- Decorative corner elements -->
{# <span class="position-absolute top-0 start-0 stat-corner stat-corner-tl"></span>
<span class="position-absolute top-0 end-0 stat-corner stat-corner-tr"></span>
<span class="position-absolute bottom-0 start-0 stat-corner stat-corner-bl"></span>
<span class="position-absolute bottom-0 end-0 stat-corner stat-corner-br"></span>#}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- #content end -->
<script>
document.addEventListener('DOMContentLoaded', function() {
const originalImages = Array.from(document.querySelectorAll('.swiper-slide img')).map(img => img.src);
let lastBackgroundIndex = null;
const slider = new Swiper('.swiper-container', {
loop: true,
autoplay: {
delay: 6000,
disableOnInteraction: false,
},
pagination: {
el: '.swiper-pagination',
clickable: true,
},
on: {
init: function() {
updateBackground(this.realIndex);
},
slideChangeTransitionEnd: function() {
// On utilise slideChangeTransitionEnd au lieu de slideChange
updateBackground(this.realIndex);
}
}
});
function updateBackground(realIndex) {
// Calculer l'index correct (0 ou 1) pour nos 2 slides
const backgroundIndex = realIndex % originalImages.length;
// Ne rien faire si l'arrière-plan est déjà à jour
if (backgroundIndex === lastBackgroundIndex) return;
const bg = document.querySelector('.slider-background');
const imgSrc = originalImages[backgroundIndex];
// Préchargement de l'image
const tempImg = new Image();
tempImg.onload = function() {
bg.style.backgroundImage = `url(${imgSrc})`;
bg.style.opacity = '0.7';
lastBackgroundIndex = backgroundIndex;
};
tempImg.onerror = function() {
console.error("Erreur de chargement de l'image de fond");
};
tempImg.src = imgSrc;
}
// Stocker les URLs des images originales (sans les slides dupliquées)
/* const originalImages = [
document.querySelector('.swiper-slide:nth-child(1) img').src,
document.querySelector('.swiper-slide:nth-child(2) img').src
];
let lastBackgroundIndex = null;
const slider = new Swiper('.swiper-container', {
loop: true,
autoplay: {
delay: 6000,
disableOnInteraction: false,
},
pagination: {
el: '.swiper-pagination',
clickable: true,
},
on: {
init: function() {
updateBackground(this.realIndex);
},
slideChangeTransitionEnd: function() {
// On utilise slideChangeTransitionEnd au lieu de slideChange
updateBackground(this.realIndex);
}
}
});
function updateBackground(realIndex) {
// Calculer l'index correct (0 ou 1) pour nos 2 slides
const backgroundIndex = realIndex % 2;
// Ne rien faire si l'arrière-plan est déjà à jour
if (backgroundIndex === lastBackgroundIndex) return;
const bg = document.querySelector('.slider-background');
const imgSrc = originalImages[backgroundIndex];
// Préchargement de l'image
const tempImg = new Image();
tempImg.onload = function() {
bg.style.backgroundImage = `url(${imgSrc})`;
bg.style.opacity = '0.7';
lastBackgroundIndex = backgroundIndex;
};
tempImg.onerror = function() {
console.error("Erreur de chargement de l'image de fond");
};
tempImg.src = imgSrc;
}*/
const counters = document.querySelectorAll('.counter');
const speed = 200;
counters.forEach(counter => {
const target = +counter.getAttribute('data-target');
const count = +counter.innerText;
const increment = target / speed;
if (count < target) {
counter.innerText = Math.ceil(count + increment);
setTimeout(updateCounter, 1);
} else {
counter.innerText = target;
}
function updateCounter() {
const count = +counter.innerText;
if (count < target) {
counter.innerText = Math.ceil(count + increment);
setTimeout(updateCounter, 1);
} else {
counter.innerText = target;
}
}
});
});
</script>
{% endblock %}