templates/vitrine/loader/index-page.html.twig line 1

  1. <script type="text/javascript">
  2.     const UBMovies = function(){
  3.         const container = "#content-movies", title_movie = (k, d, i)=>{
  4.             // const active = k==0?'show active':'';
  5.             return `<div class="swiper-slide swiper-bg">
  6.                 <div class="block-images position-relative ">
  7.                     <div class="img-box">
  8.                         <img src="`+("{{asset('_1_', 'covers')}}").replace("_1_", d.cover)+`" class="img-fluid" alt="`+d.title+`" loading="lazy">                      
  9.                         <div class="block-description ps-3">
  10.                             <h6 class="iq-title fw-500 mb-0">`+d.title+`</h6>
  11.                             <span class="fs-12">`+minutesToHours(d.duration)+`</span>
  12.                         </div>
  13.                     </div>
  14.                 </div>
  15.             </div>`;
  16.         }, genres_movies = (k, d, i)=>{
  17.             return `<li class="position-relative text-capitalize font-size-14 letter-spacing-1">
  18.                 <a href="`+("{{path('web_view_all_movie', {'g':'_1_'})}}").replace('_1_',d.id)+`" class="text-decoration-none">`+d.text+`</a>
  19.             </li>`;
  20.         }, body_movie = (k, d)=>{
  21.             var gens = "";
  22.             $.each(d.genre, function(key, val){
  23.                 gens += genres_movies(key, val, d.id);
  24.             });
  25.             return `<div class="swiper-slide p-0">
  26.                 <div class="slider--image block-images">
  27.                     <img src="`+("{{asset('_1_', 'covers')}}").replace("_1_", d.cover)+`" loading="lazy" alt="`+d.title+`" />
  28.                 </div>
  29.                 <div class="description">
  30.                     <div class="row align-items-center h-100">
  31.                     <div class="col-lg-6 col-md-12">
  32.                         <div class="slider-content">
  33.                         <div class="d-flex align-items-center RightAnimate mb-3">
  34.                             <ul class="p-0 mb-0 list-inline d-flex flex-wrap align-items-center movie-tag">
  35.                             `+gens+`
  36.                             </ul>
  37.                         </div>
  38.                         <h1 class="texture-text big-font letter-spacing-1 line-count-1 text-capitalize RightAnimate-two"> `+d.title+` </h1>
  39.                         <p class="line-count-3 RightAnimate-two">`+d.description+`</p>
  40.                         <div class="d-flex flex-wrap align-items-center gap-3 RightAnimate-three">
  41.                             <div class="slider-ratting d-flex align-items-center">
  42.                             <ul class="ratting-start p-0 m-0 list-inline text-warning d-flex align-items-center justify-content-left">
  43.                                 <li>
  44.                                 <i class="fa fa-star" aria-hidden="true"></i>
  45.                                 </li>
  46.                             </ul>
  47.                             <span class="text-white ms-2 font-size-14 fw-500">`+d.rating+`</span>
  48.                             </div>
  49.                             <span class="font-size-14 fw-500">`+minutesToHours(d.duration)+`</span>
  50.                         </div>
  51.                         </div>
  52.                         <div class="RightAnimate-four">
  53.                         <div class="iq-button">
  54.                             <a href="`+("{{path('web_movie_detail', {'m':'_1_'})}}").replace("_1_",d.id)+`" class="btn text-uppercase position-relative">
  55.                                 <span class="button-text">{{"Regarder"|trans}}</span>
  56.                                 <i class="fa-solid fa-play"></i>
  57.                             </a>
  58.                         </div>
  59.                         </div>
  60.                     </div>
  61.                     </div>
  62.                 </div>
  63.             </div>`;
  64.         }, movies = (d)=>{
  65.             if(d.length == 0){
  66.                 $.urban.load.clearContent(container);
  67.                 return "";
  68.             }
  69.             var titles = "", tabs = "";
  70.             $.each(d, function(key, val){
  71.                 titles += title_movie(key, val, d.id);
  72.                 tabs += body_movie(key, val, d.id);
  73.             });
  74.             return `<div class="position-relative slider-bg d-flex justify-content-end">
  75.                 <div class="position-relative my-auto">
  76.                 <div class="horizontal_thumb_slider" data-swiper="slider-thumbs-ott">
  77.                     <div class="banner-thumb-slider-nav">
  78.                     <div class="swiper-container " data-swiper="slider-thumbs-inner-ott">
  79.                         <div class="swiper-wrapper">
  80.                         `+titles+`
  81.                         </div>
  82.                     </div>
  83.                     <div class="slider-prev swiper-button">
  84.                         <i class="iconly-Arrow-Left-2 icli"></i>
  85.                     </div>
  86.                     <div class="slider-next swiper-button">
  87.                         <i class="iconly-Arrow-Right-2 icli"></i>
  88.                     </div>
  89.                     </div>
  90.                 </div>
  91.                 </div>
  92.                 <div class="slider-images" data-swiper="slider-images-ott">
  93.                 <div class="swiper-container" data-swiper="slider-images-inner-ott">
  94.                     <div class="swiper-wrapper m-0">
  95.                     `+tabs+`
  96.                     </div>
  97.                 </div>
  98.                 </div>
  99.             </div>`;
  100.         };     
  101.         return {
  102.             init: ()=>{
  103.                 $.urban.load.ajax(container, "{{path('app_get_list_movie')}}", (r)=>{
  104.                     return movies(r.aaData);
  105.                 }, {start:0, length:5, order:[{column:'rating',dir:'-1'}]});
  106.             }
  107.         }
  108.     }(),
  109.     UBTopTen = function(){
  110.         const container = "#content-topten", body_topten = (k, d)=>{
  111.             const url = d.type ? ("{{path('web_movie_detail', {'m':'_1_'})}}").replace("_1_",d.id) : ("{{path('web_series_detail', {'s':'_1_'})}}").replace("_1_",d.id);
  112.             
  113.             return `<li class="swiper-slide" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="`+d.title+`" title="`+d.title+`">
  114.                 <div class="iq-top-ten-block">
  115.                     <div class="block-image position-relative">
  116.                         <div class="img-box">
  117.                             <a class="overly-images" href="`+url+`">
  118.                                 <img src="`+("{{asset('_1_', 'covers')}}").replace("_1_",d.cover)+`" alt="`+d.title+`" class="img-fluid object-cover topimg">
  119.                             </a>
  120.                             <span class="top-ten-numbers texture-text">`+(k+1)+`</span>
  121.                         </div>
  122.                     </div>
  123.                 </div>
  124.             </li>`;
  125.         }, topten = (d)=>{
  126.             if(d.length == 0){
  127.                 $.urban.load.clearContent(container);
  128.                 return "";
  129.             }
  130.             var tabs = "";
  131.             $.each(d, function(key, val){
  132.                 tabs += body_topten(key, val, d.id);
  133.             });
  134.             return `<div class="container-fluid  pt-4">
  135.                 <section class="overflow-hidden">
  136.                     <div class="d-flex align-items-center justify-content-between px-md-3 px-1 mb-4">
  137.                         <h5 class="main-title text-capitalize mb-0">{{'Les dix meilleurs films à voir'|trans}}</h5>
  138.                         {# <a href="?order=rate" class="text-primary iq-view-all text-decoration-none flex-none"></a> #}
  139.                     </div>
  140.                     <div class="position-relative swiper swiper-card iq-top-ten-block-slider" data-slide="6" data-laptop="6" data-tab="3" data-mobile="2" data-mobile-sm="2" data-autoplay="false" data-loop="false" data-navigation="true" data-pagination="true">
  141.                         <ul class="p-0 swiper-wrapper mb-5 list-inline">
  142.                         `+tabs+`
  143.                         </ul>
  144.                         <div class="swiper-button swiper-button-next"></div>
  145.                         <div class="swiper-button swiper-button-prev"></div>
  146.                     </div>
  147.                 </section>
  148.             </div>`;
  149.         };
  150.        return {
  151.             init: ()=>{
  152.                 $.urban.load.ajax(container, "{{path('app_get_list_movie')}}", (r)=>{
  153.                     return topten(r.aaData);
  154.                 }, {notype:true, start:0, length:10, order:[{column:'rating',dir:'-1'}]});
  155.             }
  156.         } 
  157.     }(),
  158.     UBSeries = function(){
  159.         const container = "#content-series", title_season = (k, d, i)=>{
  160.             const active = k==0?'show active':'';
  161.             return `<li class="nav-item" role="presentation">
  162.             <button class="nav-link `+active+`" data-bs-toggle="pill" data-bs-target="#pills-`+i+`-`+d.id+`" type="button" role="tab" aria-selected="false">`+("{{'Saison _1_'|trans}}").replace("_1_", d.number)+`</button>
  163.             </li>`;
  164.         }, episode_season = (k, d)=>{
  165.             return `<li class="d-flex align-items-center gap-3">
  166.             <div class="image-box flex-shrink-0">
  167.             <img src="`+("{{asset('_1_', 'covers')}}").replace("_1_",d.cover)+`" alt="image-icon" class="img-fluid rounded">
  168.             </div>
  169.             <div class="image-details">
  170.                 <a href="`+("{{path('web_movie_detail', {'e':'_1_'})}}").replace('_1_', d.id)+`">
  171.                     <h6 class="mb-1 text-capitalize"><span class="text-primary">E`+d.number+`</span> - `+d.name+`</h6>
  172.                 </a>
  173.             <small>`+d.duration+` minutes</small>
  174.             </div>
  175.         </li>`;
  176.         }, episodes_season = (d)=>{
  177.             var episodes = "";
  178.             $.each(d, function(key, val){
  179.                 episodes += episode_season(key, val);
  180.             });
  181.             return episodes;
  182.         }, panel_season = (k, d, i)=>{
  183.             const active = k==0?'show active':'';
  184.             return `<div class="tab-pane fade `+active+`" id="pills-`+i+`-`+d.id+`" role="tabpanel" tabindex="0">
  185.             <ul class="list-inline m-0 p-0">
  186.             `+episodes_season(d.episodes)+`
  187.             </ul>
  188.         </div>`;
  189.         }, seasons_serie = (d)=>{
  190.             var titles = "", tabs = "";
  191.             $.each(d, function(key, val){
  192.                 titles += title_season(key, val, d.id);
  193.                 tabs += panel_season(key, val, d.id);
  194.             });
  195.             return `<div class="tab-bottom-bordered border-0">
  196.                     <ul class="nav nav-tabs nav-pills mb-3 overflow-x-scroll"  role="tablist">
  197.                     `+titles+`
  198.                 </ul>
  199.             </div>
  200.             <div class="tab-content iq-tab-fade-up">
  201.             `+tabs+`
  202.             </div>`;
  203.         }, one = (k, d)=>{
  204.             return `<li class="swiper-slide tab-slider-banner p-0">
  205.                 <div class="tab-slider-banner-images">
  206.                     <img src="`+("{{asset('_1_', 'covers')}}").replace("_1_", d.cover)+`" alt="tab-slider-background">
  207.                 </div>
  208.                 <div class="block-images position-relative w-100">
  209.                     <div class="container-fluid">
  210.                     <div class="row align-items-center min-vh-100 h-100 my-4">
  211.                         <div class="col-md-5 col-lg-5 col-xxl-5">
  212.                             <div class="tab-left-details">
  213.                                 <div class="d-flex align-items-center gap-3 mb-4">
  214.                                 
  215.                                 </div>
  216.                                 <h1 class="mb-2 fw-500 text-capitalize texture-text">`+d.name+`</h1>
  217.                                 <p class="mb-0 font-size-14 line-count-2">`+d.description+`</p>
  218.                                 <ul class="d-flex align-items-center list-inline gap-2 movie-tag p-0 mt-3 mb-40">
  219.                                     <li class="font-size-18">`+d.release+`</li>
  220.                                     <li class="font-size-18">`+("{{'_1_ saison(s)'|trans}}").replace("_1_", d.seasons.length)+`</li>
  221.                                 </ul>
  222.                                 <div class="iq-button">
  223.                                     <a href="`+("{{path('web_series_detail', {'s':'_1_'})}}").replace('_1_', d.id)+`" class="btn text-uppercase position-relative">
  224.                                         <span class="button-text">{{"Voir plus"|trans}}</span>
  225.                                         <i class="fa-solid fa-play"></i>
  226.                                     </a>
  227.                                 </div>
  228.                             </div>
  229.                         </div>
  230.                         <div class="col-md-1 col-lg-2 col-xxl-3">
  231.                         </div>
  232.                         <div class="col-md-6 col-lg-5 col-xxl-4 mt-5 mt-md-0">
  233.                             <div class="tab-block">
  234.                                 `+seasons_serie(d.seasons)+`
  235.                             </div>
  236.                         </div>
  237.                     </div>
  238.                     </div>
  239.                 </div>
  240.             </li>`;
  241.         }, list = (d)=>{
  242.             var series = ``;
  243.             $.each(d, function(key, val){
  244.                 series += one(key, val);
  245.             });
  246.             return series;
  247.         }, series = (d)=>{
  248.             if(d.length == 0){
  249.                 $.urban.load.clearContent(container);
  250.                 return "";
  251.             }
  252.             return `<div class="position-relative swiper swiper-card" data-slide="1" data-laptop="1" data-tab="1" data-mobile="1" data-mobile-sm="1" data-autoplay="true" data-loop="false" data-navigation="true" data-pagination="true" data-effect="fade">
  253.                 <ul class="p-0 swiper-wrapper m-0 list-inline">
  254.                     `+list(d)+`
  255.                 </ul>
  256.                 <div class="joint-arrows">
  257.                     <div class="swiper-button swiper-button-next"></div>
  258.                     <div class="swiper-button swiper-button-prev"></div>
  259.                 </div>
  260.             </div>`;
  261.         };
  262.         return {
  263.             init: ()=>{
  264.                 $.urban.load.ajax(container, "{{path('app_series_index')}}", (r)=>{
  265.                     return series(r.data);
  266.                 }, {start:0, length:5, order:[{column:'rating',dir:'-1'}]});
  267.             }
  268.         }
  269.     }();
  270.     UBMovies.init();
  271.     UBTopTen.init();
  272.     UBSeries.init();
  273. </script>