des trucs
This commit is contained in:
144
templates/main/home.html.twig
Normal file
144
templates/main/home.html.twig
Normal file
@@ -0,0 +1,144 @@
|
||||
{% extends 'main/base.html.twig' %}
|
||||
|
||||
{% block head %}
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{% block title %}📣 Sortie.com {{ profile.pseudo }} 🔊{% endblock %}
|
||||
{% block stylesheets %}
|
||||
{{ encore_entry_link_tags('app') }}
|
||||
<link rel="stylesheet" href="https://unpkg.com/swiper/swiper-bundle.min.css">
|
||||
<style>
|
||||
.swiper-container {
|
||||
width: 100%;
|
||||
height: 500px; /* Ajustez selon vos besoins */
|
||||
}
|
||||
|
||||
.swiper-slide {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.swiper-slide img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
.swiper-slide .text-overlay {
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
left: 20px;
|
||||
right: 20px;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
color: white;
|
||||
padding: 20px;
|
||||
border-radius: 0.5rem;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.swiper-slide .text-overlay h3 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.swiper-slide .text-overlay p {
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.swiper-button-next,
|
||||
.swiper-button-prev {
|
||||
color: white;
|
||||
}
|
||||
.swiper-pagination-bullet {
|
||||
background: #22c55e; /* Vert Tailwind (green-500) */
|
||||
}
|
||||
|
||||
.swiper-pagination-bullet-active {
|
||||
background: #16a34a; /* Vert plus foncé pour le point actif */
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
</head>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto py-10">
|
||||
<!-- Section carrousel -->
|
||||
<h2 class="text-4xl font-bold text-center mb-8">Dernières sorties</h2>
|
||||
<div class="w-full relative">
|
||||
<div class="swiper default-carousel swiper-container">
|
||||
<div class="swiper-wrapper">
|
||||
{% if lastSorties is not empty %}
|
||||
{% for sortie in lastSorties %}
|
||||
<div class="swiper-slide">
|
||||
{% if sortie.image %}
|
||||
<img src="{{ asset('img/sortie/' ~ sortie.image) }}" alt="{{ sortie.nom }}">
|
||||
{% else %}
|
||||
<img src="{{ asset('img/default-placeholder.png') }}" alt="Image par défaut">
|
||||
{% endif %}
|
||||
<div class="text-overlay">
|
||||
<a href="{{ path('sortie_view', {'id': sortie.idSortie}) }}"
|
||||
class="text-2xl font-bold text-green-600 hover:text-green-700 transition-colors">
|
||||
{{ sortie.nom }}
|
||||
</a>
|
||||
<p>Date : {{ sortie.dateHeureDebut|date('d/m/Y H:i') }}</p>
|
||||
<p>{{ sortie.infosSortie|slice(0, 150) ~ '...' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p class="text-center text-gray-500">Aucune sortie récente disponible.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="swiper-button-next"></div>
|
||||
<div class="swiper-button-prev"></div>
|
||||
<div class="swiper-pagination"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Section des événements terminés -->
|
||||
<div class="mt-12">
|
||||
<h2 class="text-3xl font-bold text-center mb-6">Événements terminés</h2>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{% if pastEvents is not empty %}
|
||||
{% for event in pastEvents %}
|
||||
<a href="{{ path('sortie_view', {'id': event.idSortie}) }}"
|
||||
class="bg-gray-100 p-6 rounded-lg shadow-md hover:shadow-xl hover:scale-105 transition-transform duration-300 ease-in-out">
|
||||
{% if event.image %}
|
||||
<img src="{{ asset('img/sortie/' ~ event.image) }}" alt="{{ event.nom }}" class="w-full h-40 object-cover rounded-md mb-4">
|
||||
{% else %}
|
||||
<img src="{{ asset('img/default-placeholder.png') }}" alt="Image par défaut" class="w-full h-40 object-cover rounded-md mb-4">
|
||||
{% endif %}
|
||||
<h3 class="text-xl font-bold text-green-600">{{ event.nom }}</h3>
|
||||
<p class="text-gray-600 text-sm">Terminé le : {{ event.dateHeureDebut|date('d/m/Y H:i') }}</p>
|
||||
<p class="text-gray-500 mt-2 text-sm">{{ event.infosSortie|slice(0, 100) ~ '...' }}</p>
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p class="text-center text-gray-500">Aucun événement terminé disponible.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Inclure les fichiers JavaScript Swiper -->
|
||||
{% block javascripts %}
|
||||
<script src="https://unpkg.com/swiper/swiper-bundle.min.js"></script>
|
||||
<script>
|
||||
var swiper = new Swiper(".default-carousel", {
|
||||
loop: true,
|
||||
pagination: {
|
||||
el: ".swiper-pagination",
|
||||
clickable: true,
|
||||
},
|
||||
navigation: {
|
||||
nextEl: ".swiper-button-next",
|
||||
prevEl: ".swiper-button-prev",
|
||||
},
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user