templates/home/index.html.twig line 1

  1. {% extends 'base.html.twig' %}
  2. {% block title %}Formation{% endblock %}
  3. {% block out %}
  4. <style>
  5. /* Class to hide element on both desktop and mobile */
  6. .hide {
  7.   display: none;
  8. }
  9. /* Class to show element on desktop */
  10. .show-desktop {
  11.   display: none;
  12. }
  13. /* Class to show element on mobile */
  14. .show-mobile {
  15.   display: none;
  16. }
  17. /* Media query to override the display property for desktop and mobile devices */
  18. @media (min-width: 768px) {
  19.   .hide {
  20.     display: none !important;
  21.   }
  22.   .show-desktop {
  23.     display: block;
  24.   }
  25. }
  26. /* Media query to override the display property for mobile devices */
  27. @media (max-width: 767px) {
  28.   .hide {
  29.     display: none !important;
  30.   }
  31.   .show-mobile {
  32.     display: block;
  33.   }
  34. }
  35. </style>
  36. <!-- Hero Section avec design flat minimal et animations hexagones -->
  37. <section class="hero-parallax parallax" data-aos="fade-in">
  38.   <div class="hexagon-container" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; pointer-events: none;"></div>
  39.   <div class="hero-content hero-text-bottom" style="position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;">
  40.     <h1 class="hero-title-large">
  41.       LA FORMATION EST LE MEILLEUR INVESTISSEMENT QUE VOUS PUISSIEZ FAIRE POUR VOTRE AVENIR
  42.     </h1>
  43.   </div>
  44.   <!-- Image de fond -->
  45.   <div style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 1; opacity: 0.4;">
  46.     <img src="{{ asset('couverture.jpeg') }}" alt="Background" 
  47.          class="parallax-image" 
  48.          style="width: 100%; height: 100%; object-fit: cover;">
  49.   </div>
  50. </section>
  51. {% endblock %}
  52. {% block body %}
  53. {% if user %}
  54. <div class="callout callout-warning" role="alert" data-aos="zoom-in">
  55.     <h5>Bienvenue {{user.nom}}</h5>
  56.     <p>Félicitations pour votre achat. Vous allez pouvoir profiter des vidéos de votre formation.</p>
  57. </div>
  58. <div class="row cards-row">
  59.     <div class="card-group no-gutters">
  60.         {% for item in user.usersPlayslists %}
  61.         <div class="card col-md-6 col-lg-4 hvr-grow" data-aos="slide-left">
  62.             <div class="text-white card-body bg-img text-center py-80" style="background-image: url({{asset('image/'~item.playlist.imageDeCouverture)}});">
  63.                 <a class="hvr-grow" href="{{path('app_playlist_show',{'id':item.playlist.id})}}">
  64.                     <img class="avatar avatar-xl avatar-bordered" src="{{asset('play.png')}}">
  65.                 </a>
  66.             </div>
  67.             <ul class="flexbox flex-justified text-center">
  68.                 <p>{{item.playlist.titre}}</p>
  69.             </ul>
  70.         </div>
  71.         {% endfor %}
  72.     </div>
  73. </div>
  74. {% endif %}
  75. {% if ads|length > 0 %}
  76. <div style="position: relative; margin-top: 3rem; margin-bottom: 3rem;" data-aos="fade-up">
  77.     <span class="badge" style="position: absolute; top: -15px; left: 20px; z-index: 10; background: var(--primary-yellow); color: var(--primary-blue); padding: 0.5rem 1.5rem; font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;">
  78.         Publicités
  79.     </span>
  80.     
  81.     <div class="swiper ads-carousel" style="border-radius: var(--border-radius); overflow: hidden;">
  82.         <div class="swiper-wrapper">
  83.             {% for ad in ads %}
  84.             <div class="swiper-slide">
  85.                 <div class="ads-slide" style="position: relative; height: 400px; overflow: hidden;">
  86.                     {% if ad.image %}
  87.                     <img src="{{ asset('image/' ~ ad.image) }}" 
  88.                          alt="{{ ad.description }}"
  89.                          style="width: 100%; height: 100%; object-fit: cover;">
  90.                     {% endif %}
  91.                     <div class="ads-overlay" style="position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(24, 89, 129, 0.9), rgba(24, 89, 129, 0.5), transparent); padding: 3rem 2rem 2rem; color: var(--primary-white);">
  92.                         {% if ad.description %}
  93.                         <h3 style="color: var(--primary-white); font-size: 1.8rem; font-weight: 700; margin: 0 0 1rem 0; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);">
  94.                             {{ ad.description }}
  95.                         </h3>
  96.                         {% endif %}
  97.                     </div>
  98.                 </div>
  99.             </div>
  100.             {% endfor %}
  101.         </div>
  102.         <div class="swiper-pagination"></div>
  103.         <div class="swiper-button-next"></div>
  104.         <div class="swiper-button-prev"></div>
  105.     </div>
  106. </div>
  107. {% endif %}
  108. <div class="callout callout-warning" role="alert" data-aos="zoom-in" id="formations">
  109.     <h5>Nos formation</h5>
  110.     <p>Une formation qui pourrait susciter votre intérêt.</p>
  111. </div>
  112. {# Filtres catégories #}
  113. {% if categories is defined and categories|length > 0 %}
  114. <div class="mb-3 d-flex flex-wrap align-items-center gap-2">
  115.     <button class="btn btn-sm btn-pill filter-btn btn-primary text-white" data-category="all">Toutes</button>
  116.     {% for cat in categories %}
  117.       <button class="btn btn-sm btn-pill filter-btn btn-outline-primary" data-category="{{ cat.id }}">
  118.         {{ cat.nom ?? cat.titre ?? ('Catégorie ' ~ cat.id) }}
  119.       </button>
  120.     {% endfor %}
  121. </div>
  122. {% endif %}
  123. <div class="row cards-row" id="playlist-container">
  124.     <div class="card-group no-gutters">
  125.         {% for item in playlist %}
  126.         <div class="card col-md-6 col-lg-4 playlist-card" data-aos="zoom-in" data-category-id="{{ item.category ? item.category.id : 'none' }}">
  127.             {% if item.imageDeCouverture %}
  128.             <img class="card-img-top" style="width:100%" src="{{ asset('image/' ~ item.imageDeCouverture) }}" alt="Card image cap"
  129.               onerror="this.onerror=null;this.outerHTML=`<svg class='card-img-top' style='width:100%;height:auto;' viewBox='0 0 600 350' width='600' height='350' xmlns='http://www.w3.org/2000/svg'><rect width='600' height='350' fill='#cccccc'></rect><text x='50%' y='50%' dominant-baseline='middle' text-anchor='middle' font-family='monospace' font-size='26px' fill='#333333'>600x350</text></svg>`;">
  130.             {% else %}
  131.             <svg class="card-img-top" style="width:100%;height:auto;" viewBox="0 0 600 350" width="600" height="350" xmlns="http://www.w3.org/2000/svg">
  132.               <rect width="600" height="350" fill="#cccccc"></rect>
  133.               <text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-family="monospace" font-size="26px" fill="#333333">600x350</text>
  134.             </svg>
  135.             {% endif %}
  136.           <div class="card-body">
  137.             <H5 class="text-center formation-title">{{item.titre}}</H5>
  138.             <p>{{item.description}}</p>
  139.             <p class="text-right"><small>{{item.prix}} MGA</small></p>
  140.           </div>
  141.           <footer class="card-footer text-right p-0">
  142.             <a href="{{path('app_add_playlist',{'id':item.id})}}" class="btn btn-square btn-primary no-radius"><i class="ti-shopping-cart"></i></a>
  143.           </footer>
  144.         </div>
  145.         {% endfor %}
  146.     </div>
  147. </div>
  148. {% if instructors is defined and instructors|length > 0 %}
  149. <div class="divider mt-6">Nos Instructeurs</div>
  150. <div class="row cards-row">
  151.   {% for instructor in instructors %}
  152.   <div class="col-md-6 col-lg-4 mb-4" data-aos="zoom-in">
  153.     <div class="card h-100">
  154.       {% if instructor.photo %}
  155.       <img class="card-img-top" style="height: 220px; object-fit: cover;" src="{{ asset('image/' ~ instructor.photo) }}" alt="{{ instructor.prenom }} {{ instructor.nom }}">
  156.       {% else %}
  157.       <div class="card-img-top d-flex align-items-center justify-content-center bg-light" style="height: 220px;">
  158.         <i class="fa fa-user fa-3x text-muted"></i>
  159.       </div>
  160.       {% endif %}
  161.       <div class="card-body d-flex flex-column">
  162.         <h5 class="card-title">{{ instructor.prenom }} {{ instructor.nom }}</h5>
  163.         {% set hasCat = false %}
  164.         <div class="mb-2">
  165.           {% for pl in instructor.playlists %}
  166.             {% if pl.category %}
  167.               {% set hasCat = true %}
  168.               {% set catName = pl.category.nom ?? pl.category.titre ?? 'Catégorie' %}
  169.               {% set catColor = pl.category.couleur ?? '#3f4a59' %}
  170.               <span class="badge badge-pill mr-1 mb-1" style="background: {{ catColor }}; color: #fff; display: inline-flex; align-items: center; gap: 6px;">
  171.                 <span style="width:16px;height:16px;display:inline-block;border-radius:50%;background:rgba(255,255,255,0.3);"></span>
  172.                 {{ catName }}
  173.               </span>
  174.             {% endif %}
  175.           {% endfor %}
  176.           {% if not hasCat %}
  177.             <span class="text-muted small">Aucune catégorie</span>
  178.           {% endif %}
  179.         </div>
  180.         <p class="card-text text-muted" style="flex:1;">{{ instructor.bio ? instructor.bio|u.truncate(120, '...') : 'Biographie à venir' }}</p>
  181.         <div class="d-flex justify-content-between align-items-center">
  182.           <small class="text-muted">{{ instructor.playlists|length }} playlists</small>
  183.           <a class="btn btn-sm btn-primary" href="{{ path('app_instructor_profile', {'id': instructor.id}) }}">Voir le profil</a>
  184.         </div>
  185.       </div>
  186.     </div>
  187.   </div>
  188.   {% endfor %}
  189. </div>
  190. {% endif %}
  191. <script>
  192. document.addEventListener('DOMContentLoaded', () => {
  193.   const filterButtons = document.querySelectorAll('.filter-btn');
  194.   const cards = document.querySelectorAll('.playlist-card');
  195.   function applyFilter(catId) {
  196.     cards.forEach(card => {
  197.       const cardCat = card.dataset.categoryId || 'none';
  198.       const show = (catId === 'all') || (cardCat === catId);
  199.       card.style.display = show ? '' : 'none';
  200.     });
  201.   }
  202.   filterButtons.forEach(btn => {
  203.     btn.addEventListener('click', () => {
  204.       filterButtons.forEach(b => {
  205.         b.classList.remove('active', 'btn-primary', 'text-white');
  206.         b.classList.add('btn-outline-primary');
  207.       });
  208.       btn.classList.add('active', 'btn-primary', 'text-white');
  209.       btn.classList.remove('btn-outline-primary');
  210.       applyFilter(btn.dataset.category);
  211.     });
  212.   });
  213.   // état initial
  214.   const initial = document.querySelector('.filter-btn.btn-primary') || document.querySelector('.filter-btn');
  215.   if (initial) {
  216.     applyFilter(initial.dataset.category);
  217.   }
  218. });
  219. </script>
  220. <div class="divider">Témoignage</div>
  221. <div class="row gap-y" data-provide="photoswipe">
  222.   <a class="col-6 col-lg-4" href="#">
  223.     <img src="{{asset('min/img (1).jpg')}}" alt="Voici une description de la photo" data-original-src="{{asset('norm/img (1).jpg')}}">
  224.   </a>
  225.   <a class="col-6 col-lg-4" href="#">
  226.     <img src="{{asset('min/img (2).jpg')}}" alt="Voici une description de la photo" data-original-src="{{asset('norm/img (2).jpg')}}">
  227.   </a>
  228.   <a class="col-6 col-lg-4" href="#">
  229.     <img src="{{asset('min/img (3).jpg')}}" alt="Voici une description de la photo" data-original-src="{{asset('norm/img (3).jpg')}}">
  230.   </a>
  231.   <a class="col-6 col-lg-4" href="#">
  232.     <img src="{{asset('min/img (4).jpg')}}" alt="Voici une description de la photo" data-original-src="{{asset('norm/img (4).jpg')}}">
  233.   </a>
  234.   <a class="col-6 col-lg-4" href="#">
  235.     <img src="{{asset('min/img (5).jpg')}}" alt="Voici une description de la photo" data-original-src="{{asset('norm/img (5).jpg')}}">
  236.   </a>
  237.   <a class="col-6 col-lg-4" href="#">
  238.     <img src="{{asset('min/img (6).jpg')}}" alt="Voici une description de la photo" data-original-src="{{asset('norm/img (6).jpg')}}">
  239.   </a>
  240. </div>
  241. <hr>
  242. <div class="callout callout-warning" role="alert" data-aos="zoom-in">
  243.     <h5>Nous Contactez</h5>
  244. </div>
  245. <div class="row" data-aos="zoom-in">
  246.   <div class="col-lg-12">
  247.     <div class="card">
  248.       <div class="row no-gutters">
  249.         <div class="col-12">
  250.           <div class="card-body">
  251.             <p>N'hésitez pas à nous contacter pour obtenir toutes les informations dont vous avez besoin !</p>
  252.             <i class="fa fa-phone"></i> 
  253.             <a class="hover-primary text-uppercase fs-14 fw-500 ls-1" href="">0380941865 0388103048</a>
  254.             <div class="text-right">
  255.               <a class="btn btn-square btn-facebook" href="https://web.facebook.com/profile.php?id=100070977424516"><i class="fa fa-facebook"></i></a>
  256.             </div>
  257.           </div>
  258.         </div>
  259.       </div>
  260.     </div>
  261.   </div>
  262.   {# <div class="col-lg-6">
  263.     <form class="card form-type-combine">
  264.       <div class="card-body">
  265.         <div class="form-groups-attached">
  266.           <div class="row">
  267.             <div class="form-group col-6">
  268.               <label>Nom</label>
  269.               <input class="form-control" type="text">
  270.             </div>
  271.             <div class="form-group col-6">
  272.               <label>Téléphone</label>
  273.               <input class="form-control" type="text">
  274.             </div>
  275.           </div>
  276.           <div class="form-group">
  277.             <label>Email address</label>
  278.             <input class="form-control" type="text">
  279.           </div>
  280.           <div class="form-group">
  281.             <label>Message</label>
  282.             <input class="form-control" type="text">
  283.           </div>
  284.         </div>
  285.       </div>
  286.       <footer class="card-footer text-right">
  287.         <button class="btn btn-primary" type="submit">Envoyer</button>
  288.       </footer>
  289.     </form>
  290.   </div> #}
  291. </div>
  292. {% endblock %}