templates/vitrine/loader/streamit-swiper.html.twig line 1

  1. <style>
  2. .iq-card:hover .block-social-info {
  3.     opacity: 1;
  4.   }
  5.   .iq-card .block-social-info{
  6.     left: auto;
  7.   }
  8. </style>
  9. <script type="text/javascript">
  10.     const UBStreamitSwiper = function(){
  11.         var program;
  12.         const container = "#content-streamit", content = (d)=>{
  13.             if(d.length == 0){
  14.                 $.urban.load.clearContent(container);
  15.                 return "";
  16.             }
  17.             var streamits = "";
  18.             const startTitle = `{{"Commence"|trans }}`, endTitle = `{{"Jusqu'au"|trans }}`;
  19.             
  20.             d.forEach(el => {
  21.                 const type = el.type ? 'm' : 'e';
  22.                 const web_movie_detail = ("{{path('web_movie_detail', {'_1_':'_2_'})}}").replace('_1_',type).replace('_2_',el.media.id);
  23.                 streamits += `<li class="swiper-slide">
  24.                     <div class="iq-card card-hover">
  25.                         <div class="block-images position-relative w-100">
  26.                             <div class="img-box w-100">
  27.                             <a href="javascript:void(0);" class="position-absolute top-0 bottom-0 start-0 end-0 row px-2 pb-5">
  28.                                 <span class="col-12 mt-2"><small class="badge bg-`+el.status.label+`">`+el.status.name+`</small></span>
  29.                             </a>
  30.                             <img src="{{asset('`+el.media.cover+`', 'covers')}}" alt="movie-card" class="img-fluid object-cover w-100 d-block border-0">
  31.                             </div>
  32.                             <div class="card-description with-transition">
  33.                                 <div class="cart-content">
  34.                                     <div class="content-left w-100">
  35.                                         <h5 class="iq-title text-capitalize mb-0">
  36.                                             <a href="`+web_movie_detail+`">`+el.media.serie+`</a>
  37.                                         </h5>
  38.                                         <small>`+composeEpisodeName(el.media.nseason, el.media.nepisode)+` `+el.media.episode+`</small>
  39.                                         <!--div class="movie-time d-flex align-items-center my-2">
  40.                                             <span class="movie-time-text font-normal">`+minutesToHours(el.duration)+`</span>
  41.                                         </div-->
  42.                                         <div class="small text-end w-100">`+(el.status.code == program.code ? startTitle : endTitle)+`</div>
  43.                                         <div class="small text-end text-primary fw-bold w-100">`+(el.status.code == program.code ? viewTime(el.startAt) : viewTime(el.endAt))+`</div>
  44.                                     </div>
  45.                                     {# <div class="watchlist">
  46.                                     <a class="watch-list-not" href="playlist.html">
  47.                                         <svg width="10" height="10" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="icon-10">
  48.                                         <path d="M12 4V20M20 12H4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
  49.                                         </svg>
  50.                                         <span class="watchlist-label"> Watchlist </span>
  51.                                     </a>
  52.                                     </div> #}
  53.                                 </div>
  54.                             </div>
  55.                             <div class="block-social-info align-items-center">
  56.                                 <!--ul class="p-0 m-0 d-flex gap-2 music-play-lists">
  57.                                     <li class="share position-relative d-flex align-items-center text-center mb-0">
  58.                                     <span class="w-100 h-100 d-inline-block bg-transparent">
  59.                                         <i class="fas fa-share-alt"></i>
  60.                                     </span>
  61.                                     <div class="share-wrapper">
  62.                                         <div class="share-boxs d-inline-block">
  63.                                         <svg width="15" height="40" class="share-shape" viewBox="0 0 15 40" fill="none" xmlns="http://www.w3.org/2000/svg">
  64.                                             <path fill-rule="evenodd" clip-rule="evenodd" d="M14.8842 40C6.82983 37.2868 1 29.3582 1 20C1 10.6418 6.82983 2.71323 14.8842 0H0V40H14.8842Z" fill="#191919"></path>
  65.                                         </svg>
  66.                                         <div class=" overflow-hidden">
  67.                                             <a href="" target="_blank">
  68.                                             <i class="fab fa-facebook-f"></i>
  69.                                             </a>
  70.                                             <a href="" target="_blank">
  71.                                             <i class="fab fa-twitter"></i>
  72.                                             </a>
  73.                                             <a href="#">
  74.                                             <i class="fas fa-link"></i>
  75.                                             </a>
  76.                                         </div>
  77.                                         </div>
  78.                                     </div>
  79.                                     </li>
  80.                                     <li class="share position-relative d-flex align-items-center text-center mb-0">
  81.                                     <span class="w-100 h-100 d-inline-block bg-transparent">
  82.                                         <i class="fa-regular fa-heart"></i>
  83.                                     </span>
  84.                                     <div class="share-wrapper">
  85.                                         <div class="share-boxs d-inline-block">
  86.                                         <svg width="15" height="40" class="share-shape" viewBox="0 0 15 40" fill="none" xmlns="http://www.w3.org/2000/svg">
  87.                                             <path fill-rule="evenodd" clip-rule="evenodd" d="M14.8842 40C6.82983 37.2868 1 29.3582 1 20C1 10.6418 6.82983 2.71323 14.8842 0H0V40H14.8842Z" fill="#191919"></path>
  88.                                         </svg>
  89.                                         <div class=" overflow-hidden">
  90.                                             <span>+51</span>
  91.                                         </div>
  92.                                         </div>
  93.                                     </div>
  94.                                     </li>
  95.                                 </ul-->
  96.                                 <div class="iq-button">
  97.                                     <a href="`+web_movie_detail+`" class="btn text-uppercase position-relative rounded-circle">
  98.                                     <i class="fa-solid fa-play ms-0"></i>
  99.                                     </a>
  100.                                 </div>
  101.                             </div>
  102.                         </div>
  103.                     </div>
  104.                 </li>`;
  105.             });
  106.             return `<div class="container-fluid">
  107.                 <div class="overflow-hidden">
  108.                 <div class="d-flex align-items-center justify-content-between px-md-3 px-1 my-4">
  109.                 <h5 class="main-title text-capitalize mb-0">{{"Films et séries en diffusion"|trans}}</h5>
  110.                 <a href="{{path('web_live')}}" class="text-primary iq-view-all text-decoration-none flex-none">{{"Voir plus"|trans}}</a>
  111.                 </div>
  112.                 <div class="card-style-slider">
  113.                     <div class="position-relative swiper swiper-card" data-slide="5" data-laptop="5" data-tab="4" data-mobile="2" data-mobile-sm="1" data-autoplay="false" data-loop="true" data-navigation="true" data-pagination="true">
  114.                     <ul class="p-0 swiper-wrapper m-0  list-inline">
  115.                     `+streamits+`
  116.                     </ul>
  117.                     <div class="swiper-button swiper-button-next"></div>
  118.                     <div class="swiper-button swiper-button-prev"></div>
  119.                     </div>
  120.                 </div>
  121.                 </div>
  122.             </div>`;
  123.         }
  124.         return {
  125.             init: ()=>{
  126.                 $.urban.load.ajax(container, "{{path('app_broadcast_index')}}", (r)=>{
  127.                     program = r.program;
  128.                     
  129.                     return content(r.data);
  130.                 }, {start:0, length:10, order:[{column:'startAt',dir:'1'}]});
  131.             }
  132.         }
  133.     }();
  134.     UBStreamitSwiper.init();
  135. </script>