var/cache/dev/twig/24/24c09048b7deffa5006d405c0f93434e.php line 38

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* movie/recommendations.html.twig */
  14. class __TwigTemplate_81bd8fe55cc37dc63af6bcce50267dc7 extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->blocks = [
  23.             'recommendation' => [$this'block_recommendation'],
  24.         ];
  25.     }
  26.     protected function doGetParent(array $context)
  27.     {
  28.         // line 1
  29.         return "layouts/layout.html.twig";
  30.     }
  31.     protected function doDisplay(array $context, array $blocks = [])
  32.     {
  33.         $macros $this->macros;
  34.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  35.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""movie/recommendations.html.twig"));
  36.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  37.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""movie/recommendations.html.twig"));
  38.         $this->parent $this->loadTemplate("layouts/layout.html.twig""movie/recommendations.html.twig"1);
  39.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  40.         
  41.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  42.         
  43.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  44.     }
  45.     // line 2
  46.     public function block_recommendation($context, array $blocks = [])
  47.     {
  48.         $macros $this->macros;
  49.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  50.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""recommendation"));
  51.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  52.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""recommendation"));
  53.         // line 3
  54.         echo "    <style>
  55.         body, html {
  56.             margin: 0;
  57.             padding: 0;
  58.             font-family: 'Arial', sans-serif;
  59.             background-color: #141414;
  60.             color: white;
  61.             height: 100%; /* Full height */
  62.             overflow: auto; /* Hide overflow */
  63.         }
  64.         .deluxe-header {
  65.             background-color: #000;
  66.             padding: 20px;
  67.             color: white;
  68.             text-align: center;
  69.             font-size: 24px;
  70.             box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  71.         }
  72.         .deluxe-hero {
  73.             position: relative;
  74.             width: 100%;
  75.             height: 66vh; /* Adjusted height */
  76.             overflow: hidden; /* Hide overflow */
  77.         }
  78.         .deluxe-hero iframe {
  79.             position: absolute;
  80.             top: -160px; /* Adjust top to cut off borders */
  81.             left: 0;
  82.             width: 120%;
  83.             height: calc(100% + 260px); /* Increase height to cut off borders */
  84.             border: none; /* Remove any border */
  85.         }
  86.         .deluxe-overlay {
  87.             position: absolute;
  88.             bottom: 0%; /* Align with the bottom of the video */
  89.             right: 0.0%;
  90.             width: 30%; /* Adjust width as needed */
  91.             height: 20vh; /* Adjust height to match video bottom */
  92.             background: rgba(0, 0, 0, 0.93);
  93.             color: white;
  94.             padding: 20px;
  95.             display: flex;
  96.             align-items: right;
  97.             justify-content: right;
  98.             clip-path: polygon(100% 100%, 0 100%, 100% 0); /* Triangle cut */
  99.             animation: slideInRight 3s ease-out forwards; /* Animation */
  100.             z-index: 1000; /* High z-index to ensure visibility on top */
  101.         }
  102.         .deluxe-overlay-link
  103.         {
  104.             margin-top:100px;
  105.             color: white; /* Ensures the link is white */
  106.             text-decoration: none; /* Removes underline from the link */
  107.             font-size: 22px; /* Adjust size as needed */
  108.             font-weight: bold; /* Makes the text bold */
  109.             display: block; /* Ensures the link fills the container for better clickability */
  110.             text-align: right; /* Centers the text within the link */
  111.         }
  112.         .deluxe-link {
  113.             color: white; /* Ensures the link is white */
  114.             text-decoration: none; /* Removes underline from the link */
  115.             font-size: 18px; /* Adjust size as needed */
  116.             font-weight: bold; /* Makes the text bold */
  117.             display: block; /* Ensures the link fills the container for better clickability */
  118.             text-align: center; /* Centers the text within the link */
  119.         }
  120.         .deluxe-overlay-left {
  121.             position: absolute;
  122.             bottom: 0%; /* Align with the bottom of the video */
  123.             left: 0.0%;
  124.             width: 25%; /* Adjust width as needed */
  125.             height: 100%; /* Adjust height to match video bottom */
  126.             color: white;
  127.             padding: 20px;
  128.             display: flex;
  129.             align-items: right;
  130.             justify-content: right;
  131.             animation: slideIn 3s ease-out forwards; /* Animation */
  132.             z-index: 1000; /* High z-index to ensure visibility on top */
  133.             background: rgb(0,0,0,1);
  134.             color: white; /* Ensures the link is white */
  135.             text-decoration: none; /* Removes underline from the link */
  136.             font-size: 18px; /* Adjust size as needed */
  137.             font-weight: bold; /* Makes the text bold */
  138.             display: block; /* Ensures the link fills the container for better clickability */
  139.             text-align: center; /* Centers the text within the link */
  140.         }
  141.         @keyframes slideIn {
  142.             from {
  143.                 transform: translateX(-400%);
  144.             }
  145.             to {
  146.                 transform: translateX(0%);
  147.             }
  148.         }
  149.          @keyframes slideInRight {
  150.             from {
  151.                 transform: translateX(400%);
  152.             }
  153.             to {
  154.                 transform: translateX(0%);
  155.             }
  156.         }
  157.         .deluxe-content {
  158.             padding: 20px;
  159.             text-align: center;
  160.         }
  161.         .deluxe-movie-grid {
  162.             width: 100%;
  163.             padding: 20px;
  164.             background: rgba(0, 0, 0, 0.7);
  165.             display: flex;
  166.             flex-wrap: wrap;
  167.             justify-content: space-around;
  168.             margin-bottom: 20px;
  169.         }
  170.         .deluxe-movie-left {
  171.             width: 250px;
  172.             margin: 15px 2px;
  173.             box-sizing: border-box;
  174.             transition: transform 0.3s ease;
  175.             cursor: pointer;
  176.             z-index: 10000;
  177.         }
  178.         .deluxe-movie-left img {
  179.             margin-left: 40px;
  180.             width: 150%;
  181.             height: auto;
  182.             display: block;
  183.         }
  184.         .deluxe-movie {
  185.             width: 11.0%;
  186.             margin: 15px 2px;
  187.             box-sizing: border-box;
  188.             transition: transform 0.3s ease;
  189.             cursor: pointer;
  190.         }
  191.         .deluxe-movie:hover {
  192.             transform: scale(1.1);
  193.         }
  194.         .deluxe-movie img {
  195.             width: 100%;
  196.             height: auto;
  197.             display: flex;
  198.             content-align: center;
  199.         }
  200.         .deluxe-movie-info {
  201.             text-align: center;
  202.             background: rgba(0, 0, 0, 0.8);
  203.             padding: 10px;
  204.             text-overflow: ellipsis;
  205.             overflow: hidden;
  206.             white-space: nowrap;
  207.         }
  208.         .deluxe-link {
  209.             text-decoration: none;
  210.             color: inherit;
  211.         }
  212.         .deluxe-link-left {
  213.             text-decoration: none;
  214.             color: inherit;
  215.         }
  216.     </style>
  217. <body>
  218. ";
  219.         // line 177
  220.         $context["skippedFirst"] = false;
  221.         // line 178
  222.         echo "    <!-- <div class=\"deluxe-header\">Deluxe Movie Showcase</div> -->
  223.    <div class=\"deluxe-hero\" id=\"deluxe-hero\">
  224.    ";
  225.         // line 180
  226.         if ((twig_get_attribute($this->env$this->source, ($context["movies"] ?? null), "current", [], "any"truetruefalse180) && twig_get_attribute($this->env$this->source, (isset($context["movies"]) || array_key_exists("movies"$context) ? $context["movies"] : (function () { throw new RuntimeError('Variable "movies" does not exist.'180$this->source); })()), "current", [], "any"falsefalsefalse180))) {
  227.             // line 181
  228.             echo "     <a class=\"deluxe-overlay-link\" href=\"/movie-detail/";
  229.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["movies"]) || array_key_exists("movies"$context) ? $context["movies"] : (function () { throw new RuntimeError('Variable "movies" does not exist.'181$this->source); })()), "current", [], "any"falsefalsefalse181), "id", [], "any"falsefalsefalse181), "html"nulltrue);
  230.             echo "\"> <div class=\"deluxe-overlay\" id=\"deluxe-overlay\">  ";
  231.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["movies"]) || array_key_exists("movies"$context) ? $context["movies"] : (function () { throw new RuntimeError('Variable "movies" does not exist.'181$this->source); })()), "current", [], "any"falsefalsefalse181), "title", [], "any"falsefalsefalse181), "html"nulltrue);
  232.             echo " <p style=\"font-size: 12px;\">More Details</p></a></div>
  233.          <div class=\"deluxe-overlay-left\"> 
  234.          <div class=\"deluxe-movie-left\">
  235.                 <a class=\"deluxe-link-left\" href=\"/movie-detail/";
  236.             // line 184
  237.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["movies"]) || array_key_exists("movies"$context) ? $context["movies"] : (function () { throw new RuntimeError('Variable "movies" does not exist.'184$this->source); })()), "current", [], "any"falsefalsefalse184), "id", [], "any"falsefalsefalse184), "html"nulltrue);
  238.             echo "\">
  239.                     <img src=\"";
  240.             // line 185
  241.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["movies"]) || array_key_exists("movies"$context) ? $context["movies"] : (function () { throw new RuntimeError('Variable "movies" does not exist.'185$this->source); })()), "current", [], "any"falsefalsefalse185), "getImageURL", [], "method"falsefalsefalse185), "getUrl", [], "method"falsefalsefalse185), "html"nulltrue);
  242.             echo "\" alt=\"";
  243.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["movies"]) || array_key_exists("movies"$context) ? $context["movies"] : (function () { throw new RuntimeError('Variable "movies" does not exist.'185$this->source); })()), "current", [], "any"falsefalsefalse185), "title", [], "any"falsefalsefalse185), "html"nulltrue);
  244.             echo "\">
  245.                 </a>
  246.             </div></div>
  247.     <!-- YouTube video will be loaded here -->
  248.     <div id=\"youtube-player\"></div>
  249. </div>
  250.      ";
  251.         }
  252.         // line 192
  253.         echo "    <div class=\"deluxe-content\">
  254.         <h1>Recommendations</h1>
  255.         <p>Explore our curated collection of films.</p>
  256.     </div>
  257.     <div class=\"deluxe-movie-grid\">
  258.         <!-- Dynamic content will be inserted here via PHP Twig -->
  259.         ";
  260.         // line 198
  261.         $context['_parent'] = $context;
  262.         $context['_seq'] = twig_ensure_traversable((isset($context["movies"]) || array_key_exists("movies"$context) ? $context["movies"] : (function () { throw new RuntimeError('Variable "movies" does not exist.'198$this->source); })()));
  263.         foreach ($context['_seq'] as $context["_key"] => $context["movie"]) {
  264.             // line 199
  265.             echo "            ";
  266.             if ((isset($context["skippedFirst"]) || array_key_exists("skippedFirst"$context) ? $context["skippedFirst"] : (function () { throw new RuntimeError('Variable "skippedFirst" does not exist.'199$this->source); })())) {
  267.                 // line 200
  268.                 echo "            <div class=\"deluxe-movie\">
  269.                 <a class=\"deluxe-link\" href=\"/movie-detail/";
  270.                 // line 201
  271.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["movie"], "id", [], "any"falsefalsefalse201), "html"nulltrue);
  272.                 echo "\">
  273.                     <img src=\"";
  274.                 // line 202
  275.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["movie"], "getImageURL", [], "method"falsefalsefalse202), "getUrl", [], "method"falsefalsefalse202), "html"nulltrue);
  276.                 echo "\" alt=\"";
  277.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["movie"], "title", [], "any"falsefalsefalse202), "html"nulltrue);
  278.                 echo "\">
  279.                     <div class=\"deluxe-movie-info\">";
  280.                 // line 203
  281.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["movie"], "title", [], "any"falsefalsefalse203), "html"nulltrue);
  282.                 echo "</div>
  283.                 </a>
  284.             </div>
  285.             ";
  286.             }
  287.             // line 207
  288.             echo "            ";
  289.             $context["skippedFirst"] = true;
  290.             // line 208
  291.             echo "            
  292.         ";
  293.         }
  294.         $_parent $context['_parent'];
  295.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['movie'], $context['_parent'], $context['loop']);
  296.         $context array_intersect_key($context$_parent) + $_parent;
  297.         // line 210
  298.         echo "    </div>
  299.     <!-- Load the YouTube IFrame Player API -->
  300.     <script src=\"https://www.youtube.com/iframe_api\"></script>
  301.     <script>
  302.         function onDeluxePlayerReady(event) {
  303.             console.log(\"Player ready\");
  304.             event.target.unMute();
  305.             event.target.setVolume(20);
  306.             event.target.playVideo();
  307.             setTimeout(function() {
  308.                 var overlay = document.getElementById('deluxe-overlay');
  309.                 if (overlay) {
  310.                     overlay.style.display = 'block';
  311.                     console.log(\"Overlay added\");
  312.                 } else {
  313.                     console.error('Overlay element not found');
  314.                 }
  315.             }, 10000); // Show overlay after 10 seconds
  316.         }
  317.         function onDeluxePlayerStateChange(event) {
  318.             if (event.data === YT.PlayerState.ENDED) {
  319.                 deluxePlayer.playVideo();
  320.             }
  321.         }
  322.     </script>
  323.     <script src=\"https://www.youtube.com/iframe_api\"></script>
  324. <script>
  325.     var deluxePlayer;
  326.     function onYouTubeIframeAPIReady() {
  327.         var firstMovieName = document.getElementById('deluxe-overlay').innerHTML; // Replace this with dynamic data if available
  328.         console.log(firstMovieName);
  329.         searchYouTube(firstMovieName + \" trailer Movie TV Series\", function(videoId) {
  330.             deluxePlayer = new YT.Player('youtube-player', {
  331.                 videoId: videoId,
  332.                 playerVars: {
  333.                     autoplay: 1,
  334.                     controls: 0,
  335.                     modestbranding: 1,
  336.                     rel: 0,
  337.                     showinfo: 0,
  338.                 },
  339.                 events:
  340.                 {
  341.                     'onReady': onDeluxePlayerReady
  342.                 }
  343.             });
  344.         });
  345.     }
  346.    function searchYouTube(query, callback) {
  347.     var apiKey = 'AIzaSyABUXy24BFAgNuEjKHVLE1D7YfEti0pB5Y'; // Replace with your actual YouTube API Key
  348.     var url = `https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=1&q=\${encodeURIComponent(query)}&key=\${apiKey}`;
  349.     fetch(url)
  350.         .then(response => {
  351.             if (!response.ok) {
  352.                 throw new Error('Network response was not ok');
  353.             }
  354.             return response.json();
  355.         })
  356.         .then(data => {
  357.             if (data.items && data.items.length > 0) {
  358.                 var videoId = data.items[0].id.videoId;
  359.                 callback(videoId);
  360.             } else {
  361.                 console.error('No videos found');
  362.             }
  363.         })
  364.         .catch(error => console.error('Error fetching YouTube videos:', error));
  365. }
  366. </script>
  367. ";
  368.         
  369.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  370.         
  371.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  372.     }
  373.     public function getTemplateName()
  374.     {
  375.         return "movie/recommendations.html.twig";
  376.     }
  377.     public function isTraitable()
  378.     {
  379.         return false;
  380.     }
  381.     public function getDebugInfo()
  382.     {
  383.         return array (  322 => 210,  315 => 208,  312 => 207,  305 => 203,  299 => 202,  295 => 201,  292 => 200,  289 => 199,  285 => 198,  277 => 192,  265 => 185,  261 => 184,  252 => 181,  250 => 180,  246 => 178,  244 => 177,  68 => 3,  58 => 2,  35 => 1,);
  384.     }
  385.     public function getSourceContext()
  386.     {
  387.         return new Source("{% extends 'layouts/layout.html.twig' %}
  388. {% block recommendation %}
  389.     <style>
  390.         body, html {
  391.             margin: 0;
  392.             padding: 0;
  393.             font-family: 'Arial', sans-serif;
  394.             background-color: #141414;
  395.             color: white;
  396.             height: 100%; /* Full height */
  397.             overflow: auto; /* Hide overflow */
  398.         }
  399.         .deluxe-header {
  400.             background-color: #000;
  401.             padding: 20px;
  402.             color: white;
  403.             text-align: center;
  404.             font-size: 24px;
  405.             box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  406.         }
  407.         .deluxe-hero {
  408.             position: relative;
  409.             width: 100%;
  410.             height: 66vh; /* Adjusted height */
  411.             overflow: hidden; /* Hide overflow */
  412.         }
  413.         .deluxe-hero iframe {
  414.             position: absolute;
  415.             top: -160px; /* Adjust top to cut off borders */
  416.             left: 0;
  417.             width: 120%;
  418.             height: calc(100% + 260px); /* Increase height to cut off borders */
  419.             border: none; /* Remove any border */
  420.         }
  421.         .deluxe-overlay {
  422.             position: absolute;
  423.             bottom: 0%; /* Align with the bottom of the video */
  424.             right: 0.0%;
  425.             width: 30%; /* Adjust width as needed */
  426.             height: 20vh; /* Adjust height to match video bottom */
  427.             background: rgba(0, 0, 0, 0.93);
  428.             color: white;
  429.             padding: 20px;
  430.             display: flex;
  431.             align-items: right;
  432.             justify-content: right;
  433.             clip-path: polygon(100% 100%, 0 100%, 100% 0); /* Triangle cut */
  434.             animation: slideInRight 3s ease-out forwards; /* Animation */
  435.             z-index: 1000; /* High z-index to ensure visibility on top */
  436.         }
  437.         .deluxe-overlay-link
  438.         {
  439.             margin-top:100px;
  440.             color: white; /* Ensures the link is white */
  441.             text-decoration: none; /* Removes underline from the link */
  442.             font-size: 22px; /* Adjust size as needed */
  443.             font-weight: bold; /* Makes the text bold */
  444.             display: block; /* Ensures the link fills the container for better clickability */
  445.             text-align: right; /* Centers the text within the link */
  446.         }
  447.         .deluxe-link {
  448.             color: white; /* Ensures the link is white */
  449.             text-decoration: none; /* Removes underline from the link */
  450.             font-size: 18px; /* Adjust size as needed */
  451.             font-weight: bold; /* Makes the text bold */
  452.             display: block; /* Ensures the link fills the container for better clickability */
  453.             text-align: center; /* Centers the text within the link */
  454.         }
  455.         .deluxe-overlay-left {
  456.             position: absolute;
  457.             bottom: 0%; /* Align with the bottom of the video */
  458.             left: 0.0%;
  459.             width: 25%; /* Adjust width as needed */
  460.             height: 100%; /* Adjust height to match video bottom */
  461.             color: white;
  462.             padding: 20px;
  463.             display: flex;
  464.             align-items: right;
  465.             justify-content: right;
  466.             animation: slideIn 3s ease-out forwards; /* Animation */
  467.             z-index: 1000; /* High z-index to ensure visibility on top */
  468.             background: rgb(0,0,0,1);
  469.             color: white; /* Ensures the link is white */
  470.             text-decoration: none; /* Removes underline from the link */
  471.             font-size: 18px; /* Adjust size as needed */
  472.             font-weight: bold; /* Makes the text bold */
  473.             display: block; /* Ensures the link fills the container for better clickability */
  474.             text-align: center; /* Centers the text within the link */
  475.         }
  476.         @keyframes slideIn {
  477.             from {
  478.                 transform: translateX(-400%);
  479.             }
  480.             to {
  481.                 transform: translateX(0%);
  482.             }
  483.         }
  484.          @keyframes slideInRight {
  485.             from {
  486.                 transform: translateX(400%);
  487.             }
  488.             to {
  489.                 transform: translateX(0%);
  490.             }
  491.         }
  492.         .deluxe-content {
  493.             padding: 20px;
  494.             text-align: center;
  495.         }
  496.         .deluxe-movie-grid {
  497.             width: 100%;
  498.             padding: 20px;
  499.             background: rgba(0, 0, 0, 0.7);
  500.             display: flex;
  501.             flex-wrap: wrap;
  502.             justify-content: space-around;
  503.             margin-bottom: 20px;
  504.         }
  505.         .deluxe-movie-left {
  506.             width: 250px;
  507.             margin: 15px 2px;
  508.             box-sizing: border-box;
  509.             transition: transform 0.3s ease;
  510.             cursor: pointer;
  511.             z-index: 10000;
  512.         }
  513.         .deluxe-movie-left img {
  514.             margin-left: 40px;
  515.             width: 150%;
  516.             height: auto;
  517.             display: block;
  518.         }
  519.         .deluxe-movie {
  520.             width: 11.0%;
  521.             margin: 15px 2px;
  522.             box-sizing: border-box;
  523.             transition: transform 0.3s ease;
  524.             cursor: pointer;
  525.         }
  526.         .deluxe-movie:hover {
  527.             transform: scale(1.1);
  528.         }
  529.         .deluxe-movie img {
  530.             width: 100%;
  531.             height: auto;
  532.             display: flex;
  533.             content-align: center;
  534.         }
  535.         .deluxe-movie-info {
  536.             text-align: center;
  537.             background: rgba(0, 0, 0, 0.8);
  538.             padding: 10px;
  539.             text-overflow: ellipsis;
  540.             overflow: hidden;
  541.             white-space: nowrap;
  542.         }
  543.         .deluxe-link {
  544.             text-decoration: none;
  545.             color: inherit;
  546.         }
  547.         .deluxe-link-left {
  548.             text-decoration: none;
  549.             color: inherit;
  550.         }
  551.     </style>
  552. <body>
  553. {% set skippedFirst = false %}
  554.     <!-- <div class=\"deluxe-header\">Deluxe Movie Showcase</div> -->
  555.    <div class=\"deluxe-hero\" id=\"deluxe-hero\">
  556.    {% if movies.current is defined and movies.current %}
  557.      <a class=\"deluxe-overlay-link\" href=\"/movie-detail/{{ movies.current.id }}\"> <div class=\"deluxe-overlay\" id=\"deluxe-overlay\">  {{ movies.current.title }} <p style=\"font-size: 12px;\">More Details</p></a></div>
  558.          <div class=\"deluxe-overlay-left\"> 
  559.          <div class=\"deluxe-movie-left\">
  560.                 <a class=\"deluxe-link-left\" href=\"/movie-detail/{{ movies.current.id }}\">
  561.                     <img src=\"{{ movies.current.getImageURL().getUrl() }}\" alt=\"{{ movies.current.title }}\">
  562.                 </a>
  563.             </div></div>
  564.     <!-- YouTube video will be loaded here -->
  565.     <div id=\"youtube-player\"></div>
  566. </div>
  567.      {% endif %}
  568.     <div class=\"deluxe-content\">
  569.         <h1>Recommendations</h1>
  570.         <p>Explore our curated collection of films.</p>
  571.     </div>
  572.     <div class=\"deluxe-movie-grid\">
  573.         <!-- Dynamic content will be inserted here via PHP Twig -->
  574.         {% for movie in movies %}
  575.             {% if (skippedFirst) %}
  576.             <div class=\"deluxe-movie\">
  577.                 <a class=\"deluxe-link\" href=\"/movie-detail/{{ movie.id }}\">
  578.                     <img src=\"{{ movie.getImageURL().getUrl() }}\" alt=\"{{ movie.title }}\">
  579.                     <div class=\"deluxe-movie-info\">{{ movie.title }}</div>
  580.                 </a>
  581.             </div>
  582.             {% endif %}
  583.             {% set skippedFirst = true %}
  584.             
  585.         {% endfor %}
  586.     </div>
  587.     <!-- Load the YouTube IFrame Player API -->
  588.     <script src=\"https://www.youtube.com/iframe_api\"></script>
  589.     <script>
  590.         function onDeluxePlayerReady(event) {
  591.             console.log(\"Player ready\");
  592.             event.target.unMute();
  593.             event.target.setVolume(20);
  594.             event.target.playVideo();
  595.             setTimeout(function() {
  596.                 var overlay = document.getElementById('deluxe-overlay');
  597.                 if (overlay) {
  598.                     overlay.style.display = 'block';
  599.                     console.log(\"Overlay added\");
  600.                 } else {
  601.                     console.error('Overlay element not found');
  602.                 }
  603.             }, 10000); // Show overlay after 10 seconds
  604.         }
  605.         function onDeluxePlayerStateChange(event) {
  606.             if (event.data === YT.PlayerState.ENDED) {
  607.                 deluxePlayer.playVideo();
  608.             }
  609.         }
  610.     </script>
  611.     <script src=\"https://www.youtube.com/iframe_api\"></script>
  612. <script>
  613.     var deluxePlayer;
  614.     function onYouTubeIframeAPIReady() {
  615.         var firstMovieName = document.getElementById('deluxe-overlay').innerHTML; // Replace this with dynamic data if available
  616.         console.log(firstMovieName);
  617.         searchYouTube(firstMovieName + \" trailer Movie TV Series\", function(videoId) {
  618.             deluxePlayer = new YT.Player('youtube-player', {
  619.                 videoId: videoId,
  620.                 playerVars: {
  621.                     autoplay: 1,
  622.                     controls: 0,
  623.                     modestbranding: 1,
  624.                     rel: 0,
  625.                     showinfo: 0,
  626.                 },
  627.                 events:
  628.                 {
  629.                     'onReady': onDeluxePlayerReady
  630.                 }
  631.             });
  632.         });
  633.     }
  634.    function searchYouTube(query, callback) {
  635.     var apiKey = 'AIzaSyABUXy24BFAgNuEjKHVLE1D7YfEti0pB5Y'; // Replace with your actual YouTube API Key
  636.     var url = `https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=1&q=\${encodeURIComponent(query)}&key=\${apiKey}`;
  637.     fetch(url)
  638.         .then(response => {
  639.             if (!response.ok) {
  640.                 throw new Error('Network response was not ok');
  641.             }
  642.             return response.json();
  643.         })
  644.         .then(data => {
  645.             if (data.items && data.items.length > 0) {
  646.                 var videoId = data.items[0].id.videoId;
  647.                 callback(videoId);
  648.             } else {
  649.                 console.error('No videos found');
  650.             }
  651.         })
  652.         .catch(error => console.error('Error fetching YouTube videos:', error));
  653. }
  654. </script>
  655. {%  endblock %}""movie/recommendations.html.twig""/var/www/pimcore/MovieCollection/templates/movie/recommendations.html.twig");
  656.     }
  657. }