templates/site/home.html.twig line 1

Open in your IDE?
  1. {% extends "site/base.html.twig" %}
  2. {% block content %}
  3.     {% include 'site/includes/_swiper_hero.html.twig' %}
  4.     <section id="abcm" class="relative flex-col flex bg-white flex justify-center pb-24 px-8 lg:px-4 xl:px-44">
  5.         <div id="presentation" class="z-10 bg-white sm:-mt-20 w-full pt-12 sm:px-20">
  6.             <h2 class="text-primary mb-4 text-2.5xl font-heading break-all">{{ 'LG_ABCM_ZWEISPRACHIGKEIT'|trans({'fr':'ABCM ZWEISPRACHIGKEIT'}) }}</h2>
  7.             <div id="presentation_txt" class="leading-7 text-justify font-semibold tracking-wide">
  8.                 {{ 'LG_ACCUEIL_TEXTE_ABCM'|trans() |raw }}
  9.             </div>
  10.         </div>
  11.         <a class="mt-8 w-max sm:mx-20 z-20 bg-secondary text-white px-10 py-1 rounded-2xl transitioning hover:bg-transparent hover:text-secondary border-transparent border-2 hover:border-secondary" href="{{ path('actualites') }}">{{ 'LG_ACTUALITES_ABCM'|trans({'fr':'Actualités ABCM'}) }}</a>
  12.     </section>
  13.     <section id="ecole" class="relative z-10 text-black px-8 sm:px-28 lg:px-24 xl:px-64 py-20">
  14.         <h2 class="flex flex-col uppercase text-center text-3xl sm:text-4.5xl font-heading">{{ 'LG_ECOLES_ABCM'|trans({'fr':'Écoles ABCM'}) }}</h2>
  15.         <div class="flex flex-col lg:flex-row justify-between items-center my-12 md:my-24 gap-8">
  16.             <div class="lg:w-45p leading-7 font-semibold tracking-wide">
  17.                 {{ 'LG_ACCUEIL_TEXTE_ECOLES'|trans() |raw }}
  18.                 <a class="mt-8 bg-secondary text-white font-normal px-10 py-1 rounded-2xl transitioning hover:bg-transparent hover:text-secondary border-transparent border-2 hover:border-secondary" href="{{ path('trouver-ecole') }}">{{ 'LG_TROUVER_ECOLE'|trans({'fr':'Trouver une école'}) }}</a>
  19.             </div>
  20.             <div class="w-full lg:w-1/2 h-96">
  21.                 <div id="map" class="w-full h-full font-semibold"></div>
  22.             </div>
  23.         </div>
  24.         <ul class="flex -mb-28 flex-col md:flex-row gap-12 md:gap-0 items-center md:items-stretch justify-center">
  25.             <li class="flex flex-col justify-between items-center text-center md:w-1/3">
  26.                 <p class="font-bold text-xl leading-7 md:mb-12">{{ 'LG_ACCUEIL_VALEUR_1'|trans({'fr':'De la maternelle au CM2'}) }}</p>
  27.                 <img class="w-24 lg:w-28" src="{{ asset('img/icones/cartable.png') }}">
  28.             </li>
  29.             <li class="flex flex-col justify-between items-center text-center md:w-1/3">
  30.                 <p class="font-bold text-xl leading-7 md:mb-12">{{ 'LG_ACCUEIL_VALEUR_2'|trans({'fr':'Plus de 120 salariés'}) }}</p>
  31.                 <img class="w-24 lg:w-28" src="{{ asset('img/icones/salaries.png') }}">
  32.             </li>
  33.             <li class="flex flex-col justify-between items-center text-center md:w-1/3">
  34.                 <p class="font-bold text-xl leading-7 md:mb-12">{{ 'LG_ACCUEIL_VALEUR_3'|trans({'fr':'Depuis 1991'}) }}</p>
  35.                 <img class="w-24 lg:w-28" src="{{ asset('img/icones/grimoire.png') }}">
  36.             </li>
  37.         </ul>
  38.     </section>
  39.     <section id="immersion" class="relative bg-white text-black px-8 sm:px-28 lg:px-24 xl:px-64 pt-36 pb-12">
  40.         <h2 class="uppercase text-tertiary-300 leading-none text-center text-3xl sm:text-4.5xl font-heading h-40 xs:h-28 relative mb-4 xs:mb-12">{{ 'LG_IMMERSION_TITRE'|trans({'fr':'L\'immersion :'}) }}
  41.             <span class="normal-case"> {{ 'LG_IMMERSION_TITRE_2'|trans({'fr':'Wàs esch dès ?', 'de':'Wàs esch dès ?'}) }}</span></h2>
  42.         <div class="relative w-full h-96 lg:h-132 mb-12">
  43.             <div id="load" class="cursor-pointer absolute z-10 rounded-full bg-white hover:bg-secondary transitioning w-32 h-20 flex justify-center items-center abs-center">
  44.                 <div id="arrow"></div>
  45.             </div>
  46.             <iframe id="video" class="hidden w-full h-full" src="{{ 'LG_VIDEO_YOUTUBE_ACCUEIL'|trans({'fr':'https://www.youtube.com/embed/iiJWJbbstNk'}) }}" title="YouTube video player"
  47.                 frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
  48.                 allowfullscreen></iframe>
  49.             <img class="opacity-75 w-full h-full object-cover " src="{{ asset('img/tmp/AdobeStock_309458557_Preview.jpeg') }}">
  50.         </div>
  51.     </section>
  52.     <section id="actu" class="relative bg-tertiary px-8 sm:px-28 lg:px-24 xl:px-64 xl:pr-40 py-12">
  53.         <h2 class="uppercase text-black text-3xl sm:text-4.5xl font-heading">{{ 'LG_ACTUALITES'|trans() }}</h2>
  54.         <div class="flex flex-col sm:flex-row sm:flex-wrap justify-center sm:justify-start items-center gap-8 mt-16 mb-8">
  55.             {% for actualite in actualites %}
  56.                 {% set hasPhoto = (actualite.photo is not empty) %}
  57.                 <a href="{{ path('actualites_detail', {slug:actualite.titreUrl, actualite:actualite.id}) }}" class="cursor-pointer w-full sm:w-2/5 md:w-1/4 xl:w-1/5 h-48 relative">
  58.                     <img alt="{{ actualite.titre }}" class="w-full h-full object-cover" src="{{ hasPhoto ? ('actualites/'~actualite.photo)|imagine_filter('tm'): asset('/img/tmp/actu-haguenau.jpg') }}">
  59.                     <p class="absolute -right-2 top-2 w-min bg-white text-tertiary-300 rounded-2xl text-center px-4">{{ actualite.date|date('d/m') }}</p>
  60.                     <div class="absolute x-center bottom-2 text-white bg-primary rounded-full text-center text-xs w-9/12 py-3 px-4">
  61.                         <p class="mb-0">{{ actualite.titre }}</p>
  62.                     </div>
  63.                 </a>
  64.             {% endfor %}
  65.             <a class="w-8 h-8 rounded-full flex items-center justify-center text-3xl bg-secondary text-white
  66.                 hover:bg-transparent transitioning hover:text-secondary border-transparent border-2 hover:border-secondary" href="{{ path('actualites') }}">
  67.                 <span class="-mt-1">+</span>
  68.             </a>
  69.         </div>
  70.     </section>
  71.     <section id="partenaire" class="relative bg-white px-8 sm:px-28 lg:px-24 xl:px-64 py-12">
  72.         <h2 class="uppercase text-tertiary text-3xl sm:text-4.5xl font-heading">{{ 'LG_NOS_PARTENAIRES'|trans({'fr':'Nos partenaires'}) }}</h2>
  73.         <div id="slider-partenaire" class="z-20 mt-16 mb-8 z-0 swiper-container relative w-full sm:pr-12 lg:pr-0">
  74.             <div class="swiper-wrapper">
  75.                 {% for partenaire in partenaires %}
  76.                     <div class="swiper-slide h-auto flex items-center justify-center p-4 xl:p-12 bg-white">
  77.                         {% if partenaire.getMedias() is not empty %}
  78.                             {% set fichier = partenaire.getMedias()[0].fichier %}
  79.                             <img class="w-full h-full object-contain" src="{{ asset('/medias/fournisseurs/'~ partenaire.id ~ '/'~ fichier) }}" alt="{{ partenaire.societe }}">
  80.                         {% else %}
  81.                             <p>{{ partenaire.societe }}</p>
  82.                         {% endif %}
  83.                     </div>
  84.                 {% endfor %}
  85.             </div>
  86.         </div>
  87.         <div class="hidden sm:block swiper-part_next absolute y-center mt-8 right-24 lg:right-12 xl:right-52 z-50 cursor-pointer">
  88.             <i class="fas fa-chevron-right text-6xl md:text-4xl text-primary"></i>
  89.         </div>
  90.     </section>
  91. {% endblock %}
  92. {% block javascripts %}
  93.     {{ parent() }}
  94.     <script type="text/javascript">
  95.         function initMap() {
  96.             const center = {lat: 48.39878707042242, lng: 7.309071389609192};
  97.             const places = [
  98.                 {% for ecole in ecoles %}
  99.                 {% set nom = (app.request.locale == "de")?ecole.nomDe:ecole.nom %}
  100.                 {% set hasPhoto = (ecole.photo is not empty) %}
  101.                 ["<span class='title-map'>A.B.C.M. Zweisprachigkeit</span><br>" +
  102.                 "<strong class='ecole-map'>{{ nom }}</strong><br><br>" +
  103.                 {% if hasPhoto %}
  104.                 "<div class='w-full h-32'><img class='w-full object-cover h-full' src='{{ asset(ecole.getPhotoUrl()) | imagine_filter('tl') }}'></div><br>" +
  105.                 {% endif %}
  106.                 "<div class='sub-container-map w-full'><span class='flex items-center leading-5'><img class='w-4 mr-2' src='/img/icones/pin.svg'>{{ ecole.adresse }},<br> {{ ecole.codePostal }} {{ ecole.ville }}</span>" +
  107.                 "<a href='tel:+33{{ ecole.tel1 |slice(8) }}'><img class='w-4 mr-2' src='/img/icones/telephone.svg'>{{ ecole.tel1 }}</a><br>" +
  108.                 {% if ecole.siteUrl is not empty %}"<a href='{{ ecole.siteUrl }}' target='_blank'><img class='w-4 mr-2' src='/img/icones/web.svg'>{{ ecole.siteTitre }}</a><br>" +  {% endif %}
  109.                 "<a href='{{ ecole.facebook }}' target='_blank'><img class='w-4 mr-2' src='/img/icones/facebook.svg'>Facebook</a></div>"
  110.                     , {{ ecole.latitude }}, {{ ecole.longitude }}, '{{ ecole.couleur }}'],
  111.                 {% endfor %}
  112.             ]
  113.             const infowindow = new google.maps.InfoWindow();
  114.             const map = new google.maps.Map(document.getElementById("map"), {
  115.                 zoom: 7,
  116.                 center: center,
  117.             });
  118.             setMarkers(map);
  119.             function setMarkers(map) {
  120.                 var markers = [];
  121.                 for (let i = 0; i < places.length; i++) {
  122.                     const place = places[i];
  123.                     let url = "/img/icones/";
  124.                     url += place[3] + "-pin.png";
  125.                     var icon = {
  126.                         url: url, // url
  127.                         scaledSize: new google.maps.Size(40, 40), // scaled size
  128.                     };
  129.                     let marker = new google.maps.Marker({
  130.                         position: { lat: place[1], lng: place[2] },
  131.                         map,
  132.                         icon: icon,
  133.                         title: place[0],
  134.                     });
  135.                     markers.push(marker);
  136.                     google.maps.event.addListener(marker, 'click', function(){
  137.                         infowindow.close(); // Close previously opened infowindow
  138.                         infowindow.setContent(place[0]);
  139.                         infowindow.open(map, marker);
  140.                         restoreColors()
  141.                         this.setIcon(pinSymbol('red'));
  142.                     });
  143.                     google.maps.event.addListener(infowindow, "closeclick", function() {
  144.                         restoreColors()
  145.                     });
  146.                     function pinSymbol(color) {
  147.                         return {
  148.                             url: '/img/icones/'+ color +'-pin.png',
  149.                             scaledSize: new google.maps.Size(40, 40), // scaled size
  150.                         };
  151.                     }
  152.                     function restoreColors() {
  153.                         for (var i = 0; i < markers.length; i++) {
  154.                             markers[i].setIcon(pinSymbol(place[3]));
  155.                         }
  156.                     }
  157.                 }
  158.             }
  159.         }
  160.     </script>
  161.     <script async defer
  162.             src="https://maps.googleapis.com/maps/api/js?key={{ constant('WWW_PARAM_GAPI_KEY') }}&callback=initMap&libraries=&v=weekly"></script>
  163. {% endblock %}