<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* movie/recommendations.html.twig */
class __TwigTemplate_81bd8fe55cc37dc63af6bcce50267dc7 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'recommendation' => [$this, 'block_recommendation'],
];
}
protected function doGetParent(array $context)
{
// line 1
return "layouts/layout.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "movie/recommendations.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "movie/recommendations.html.twig"));
$this->parent = $this->loadTemplate("layouts/layout.html.twig", "movie/recommendations.html.twig", 1);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 2
public function block_recommendation($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "recommendation"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "recommendation"));
// line 3
echo " <style>
body, html {
margin: 0;
padding: 0;
font-family: 'Arial', sans-serif;
background-color: #141414;
color: white;
height: 100%; /* Full height */
overflow: auto; /* Hide overflow */
}
.deluxe-header {
background-color: #000;
padding: 20px;
color: white;
text-align: center;
font-size: 24px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.deluxe-hero {
position: relative;
width: 100%;
height: 66vh; /* Adjusted height */
overflow: hidden; /* Hide overflow */
}
.deluxe-hero iframe {
position: absolute;
top: -160px; /* Adjust top to cut off borders */
left: 0;
width: 120%;
height: calc(100% + 260px); /* Increase height to cut off borders */
border: none; /* Remove any border */
}
.deluxe-overlay {
position: absolute;
bottom: 0%; /* Align with the bottom of the video */
right: 0.0%;
width: 30%; /* Adjust width as needed */
height: 20vh; /* Adjust height to match video bottom */
background: rgba(0, 0, 0, 0.93);
color: white;
padding: 20px;
display: flex;
align-items: right;
justify-content: right;
clip-path: polygon(100% 100%, 0 100%, 100% 0); /* Triangle cut */
animation: slideInRight 3s ease-out forwards; /* Animation */
z-index: 1000; /* High z-index to ensure visibility on top */
}
.deluxe-overlay-link
{
margin-top:100px;
color: white; /* Ensures the link is white */
text-decoration: none; /* Removes underline from the link */
font-size: 22px; /* Adjust size as needed */
font-weight: bold; /* Makes the text bold */
display: block; /* Ensures the link fills the container for better clickability */
text-align: right; /* Centers the text within the link */
}
.deluxe-link {
color: white; /* Ensures the link is white */
text-decoration: none; /* Removes underline from the link */
font-size: 18px; /* Adjust size as needed */
font-weight: bold; /* Makes the text bold */
display: block; /* Ensures the link fills the container for better clickability */
text-align: center; /* Centers the text within the link */
}
.deluxe-overlay-left {
position: absolute;
bottom: 0%; /* Align with the bottom of the video */
left: 0.0%;
width: 25%; /* Adjust width as needed */
height: 100%; /* Adjust height to match video bottom */
color: white;
padding: 20px;
display: flex;
align-items: right;
justify-content: right;
animation: slideIn 3s ease-out forwards; /* Animation */
z-index: 1000; /* High z-index to ensure visibility on top */
background: rgb(0,0,0,1);
color: white; /* Ensures the link is white */
text-decoration: none; /* Removes underline from the link */
font-size: 18px; /* Adjust size as needed */
font-weight: bold; /* Makes the text bold */
display: block; /* Ensures the link fills the container for better clickability */
text-align: center; /* Centers the text within the link */
}
@keyframes slideIn {
from {
transform: translateX(-400%);
}
to {
transform: translateX(0%);
}
}
@keyframes slideInRight {
from {
transform: translateX(400%);
}
to {
transform: translateX(0%);
}
}
.deluxe-content {
padding: 20px;
text-align: center;
}
.deluxe-movie-grid {
width: 100%;
padding: 20px;
background: rgba(0, 0, 0, 0.7);
display: flex;
flex-wrap: wrap;
justify-content: space-around;
margin-bottom: 20px;
}
.deluxe-movie-left {
width: 250px;
margin: 15px 2px;
box-sizing: border-box;
transition: transform 0.3s ease;
cursor: pointer;
z-index: 10000;
}
.deluxe-movie-left img {
margin-left: 40px;
width: 150%;
height: auto;
display: block;
}
.deluxe-movie {
width: 11.0%;
margin: 15px 2px;
box-sizing: border-box;
transition: transform 0.3s ease;
cursor: pointer;
}
.deluxe-movie:hover {
transform: scale(1.1);
}
.deluxe-movie img {
width: 100%;
height: auto;
display: flex;
content-align: center;
}
.deluxe-movie-info {
text-align: center;
background: rgba(0, 0, 0, 0.8);
padding: 10px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.deluxe-link {
text-decoration: none;
color: inherit;
}
.deluxe-link-left {
text-decoration: none;
color: inherit;
}
</style>
<body>
";
// line 177
$context["skippedFirst"] = false;
// line 178
echo " <!-- <div class=\"deluxe-header\">Deluxe Movie Showcase</div> -->
<div class=\"deluxe-hero\" id=\"deluxe-hero\">
";
// line 180
if ((twig_get_attribute($this->env, $this->source, ($context["movies"] ?? null), "current", [], "any", true, true, false, 180) && 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", false, false, false, 180))) {
// line 181
echo " <a class=\"deluxe-overlay-link\" href=\"/movie-detail/";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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.', 181, $this->source); })()), "current", [], "any", false, false, false, 181), "id", [], "any", false, false, false, 181), "html", null, true);
echo "\"> <div class=\"deluxe-overlay\" id=\"deluxe-overlay\"> ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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.', 181, $this->source); })()), "current", [], "any", false, false, false, 181), "title", [], "any", false, false, false, 181), "html", null, true);
echo " <p style=\"font-size: 12px;\">More Details</p></a></div>
<div class=\"deluxe-overlay-left\">
<div class=\"deluxe-movie-left\">
<a class=\"deluxe-link-left\" href=\"/movie-detail/";
// line 184
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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.', 184, $this->source); })()), "current", [], "any", false, false, false, 184), "id", [], "any", false, false, false, 184), "html", null, true);
echo "\">
<img src=\"";
// line 185
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, 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.', 185, $this->source); })()), "current", [], "any", false, false, false, 185), "getImageURL", [], "method", false, false, false, 185), "getUrl", [], "method", false, false, false, 185), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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.', 185, $this->source); })()), "current", [], "any", false, false, false, 185), "title", [], "any", false, false, false, 185), "html", null, true);
echo "\">
</a>
</div></div>
<!-- YouTube video will be loaded here -->
<div id=\"youtube-player\"></div>
</div>
";
}
// line 192
echo " <div class=\"deluxe-content\">
<h1>Recommendations</h1>
<p>Explore our curated collection of films.</p>
</div>
<div class=\"deluxe-movie-grid\">
<!-- Dynamic content will be inserted here via PHP Twig -->
";
// line 198
$context['_parent'] = $context;
$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); })()));
foreach ($context['_seq'] as $context["_key"] => $context["movie"]) {
// line 199
echo " ";
if ((isset($context["skippedFirst"]) || array_key_exists("skippedFirst", $context) ? $context["skippedFirst"] : (function () { throw new RuntimeError('Variable "skippedFirst" does not exist.', 199, $this->source); })())) {
// line 200
echo " <div class=\"deluxe-movie\">
<a class=\"deluxe-link\" href=\"/movie-detail/";
// line 201
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["movie"], "id", [], "any", false, false, false, 201), "html", null, true);
echo "\">
<img src=\"";
// line 202
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["movie"], "getImageURL", [], "method", false, false, false, 202), "getUrl", [], "method", false, false, false, 202), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["movie"], "title", [], "any", false, false, false, 202), "html", null, true);
echo "\">
<div class=\"deluxe-movie-info\">";
// line 203
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["movie"], "title", [], "any", false, false, false, 203), "html", null, true);
echo "</div>
</a>
</div>
";
}
// line 207
echo " ";
$context["skippedFirst"] = true;
// line 208
echo "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['movie'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 210
echo " </div>
<!-- Load the YouTube IFrame Player API -->
<script src=\"https://www.youtube.com/iframe_api\"></script>
<script>
function onDeluxePlayerReady(event) {
console.log(\"Player ready\");
event.target.unMute();
event.target.setVolume(20);
event.target.playVideo();
setTimeout(function() {
var overlay = document.getElementById('deluxe-overlay');
if (overlay) {
overlay.style.display = 'block';
console.log(\"Overlay added\");
} else {
console.error('Overlay element not found');
}
}, 10000); // Show overlay after 10 seconds
}
function onDeluxePlayerStateChange(event) {
if (event.data === YT.PlayerState.ENDED) {
deluxePlayer.playVideo();
}
}
</script>
<script src=\"https://www.youtube.com/iframe_api\"></script>
<script>
var deluxePlayer;
function onYouTubeIframeAPIReady() {
var firstMovieName = document.getElementById('deluxe-overlay').innerHTML; // Replace this with dynamic data if available
console.log(firstMovieName);
searchYouTube(firstMovieName + \" trailer Movie TV Series\", function(videoId) {
deluxePlayer = new YT.Player('youtube-player', {
videoId: videoId,
playerVars: {
autoplay: 1,
controls: 0,
modestbranding: 1,
rel: 0,
showinfo: 0,
},
events:
{
'onReady': onDeluxePlayerReady
}
});
});
}
function searchYouTube(query, callback) {
var apiKey = 'AIzaSyABUXy24BFAgNuEjKHVLE1D7YfEti0pB5Y'; // Replace with your actual YouTube API Key
var url = `https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=1&q=\${encodeURIComponent(query)}&key=\${apiKey}`;
fetch(url)
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => {
if (data.items && data.items.length > 0) {
var videoId = data.items[0].id.videoId;
callback(videoId);
} else {
console.error('No videos found');
}
})
.catch(error => console.error('Error fetching YouTube videos:', error));
}
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
public function getTemplateName()
{
return "movie/recommendations.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
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,);
}
public function getSourceContext()
{
return new Source("{% extends 'layouts/layout.html.twig' %}
{% block recommendation %}
<style>
body, html {
margin: 0;
padding: 0;
font-family: 'Arial', sans-serif;
background-color: #141414;
color: white;
height: 100%; /* Full height */
overflow: auto; /* Hide overflow */
}
.deluxe-header {
background-color: #000;
padding: 20px;
color: white;
text-align: center;
font-size: 24px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.deluxe-hero {
position: relative;
width: 100%;
height: 66vh; /* Adjusted height */
overflow: hidden; /* Hide overflow */
}
.deluxe-hero iframe {
position: absolute;
top: -160px; /* Adjust top to cut off borders */
left: 0;
width: 120%;
height: calc(100% + 260px); /* Increase height to cut off borders */
border: none; /* Remove any border */
}
.deluxe-overlay {
position: absolute;
bottom: 0%; /* Align with the bottom of the video */
right: 0.0%;
width: 30%; /* Adjust width as needed */
height: 20vh; /* Adjust height to match video bottom */
background: rgba(0, 0, 0, 0.93);
color: white;
padding: 20px;
display: flex;
align-items: right;
justify-content: right;
clip-path: polygon(100% 100%, 0 100%, 100% 0); /* Triangle cut */
animation: slideInRight 3s ease-out forwards; /* Animation */
z-index: 1000; /* High z-index to ensure visibility on top */
}
.deluxe-overlay-link
{
margin-top:100px;
color: white; /* Ensures the link is white */
text-decoration: none; /* Removes underline from the link */
font-size: 22px; /* Adjust size as needed */
font-weight: bold; /* Makes the text bold */
display: block; /* Ensures the link fills the container for better clickability */
text-align: right; /* Centers the text within the link */
}
.deluxe-link {
color: white; /* Ensures the link is white */
text-decoration: none; /* Removes underline from the link */
font-size: 18px; /* Adjust size as needed */
font-weight: bold; /* Makes the text bold */
display: block; /* Ensures the link fills the container for better clickability */
text-align: center; /* Centers the text within the link */
}
.deluxe-overlay-left {
position: absolute;
bottom: 0%; /* Align with the bottom of the video */
left: 0.0%;
width: 25%; /* Adjust width as needed */
height: 100%; /* Adjust height to match video bottom */
color: white;
padding: 20px;
display: flex;
align-items: right;
justify-content: right;
animation: slideIn 3s ease-out forwards; /* Animation */
z-index: 1000; /* High z-index to ensure visibility on top */
background: rgb(0,0,0,1);
color: white; /* Ensures the link is white */
text-decoration: none; /* Removes underline from the link */
font-size: 18px; /* Adjust size as needed */
font-weight: bold; /* Makes the text bold */
display: block; /* Ensures the link fills the container for better clickability */
text-align: center; /* Centers the text within the link */
}
@keyframes slideIn {
from {
transform: translateX(-400%);
}
to {
transform: translateX(0%);
}
}
@keyframes slideInRight {
from {
transform: translateX(400%);
}
to {
transform: translateX(0%);
}
}
.deluxe-content {
padding: 20px;
text-align: center;
}
.deluxe-movie-grid {
width: 100%;
padding: 20px;
background: rgba(0, 0, 0, 0.7);
display: flex;
flex-wrap: wrap;
justify-content: space-around;
margin-bottom: 20px;
}
.deluxe-movie-left {
width: 250px;
margin: 15px 2px;
box-sizing: border-box;
transition: transform 0.3s ease;
cursor: pointer;
z-index: 10000;
}
.deluxe-movie-left img {
margin-left: 40px;
width: 150%;
height: auto;
display: block;
}
.deluxe-movie {
width: 11.0%;
margin: 15px 2px;
box-sizing: border-box;
transition: transform 0.3s ease;
cursor: pointer;
}
.deluxe-movie:hover {
transform: scale(1.1);
}
.deluxe-movie img {
width: 100%;
height: auto;
display: flex;
content-align: center;
}
.deluxe-movie-info {
text-align: center;
background: rgba(0, 0, 0, 0.8);
padding: 10px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.deluxe-link {
text-decoration: none;
color: inherit;
}
.deluxe-link-left {
text-decoration: none;
color: inherit;
}
</style>
<body>
{% set skippedFirst = false %}
<!-- <div class=\"deluxe-header\">Deluxe Movie Showcase</div> -->
<div class=\"deluxe-hero\" id=\"deluxe-hero\">
{% if movies.current is defined and movies.current %}
<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>
<div class=\"deluxe-overlay-left\">
<div class=\"deluxe-movie-left\">
<a class=\"deluxe-link-left\" href=\"/movie-detail/{{ movies.current.id }}\">
<img src=\"{{ movies.current.getImageURL().getUrl() }}\" alt=\"{{ movies.current.title }}\">
</a>
</div></div>
<!-- YouTube video will be loaded here -->
<div id=\"youtube-player\"></div>
</div>
{% endif %}
<div class=\"deluxe-content\">
<h1>Recommendations</h1>
<p>Explore our curated collection of films.</p>
</div>
<div class=\"deluxe-movie-grid\">
<!-- Dynamic content will be inserted here via PHP Twig -->
{% for movie in movies %}
{% if (skippedFirst) %}
<div class=\"deluxe-movie\">
<a class=\"deluxe-link\" href=\"/movie-detail/{{ movie.id }}\">
<img src=\"{{ movie.getImageURL().getUrl() }}\" alt=\"{{ movie.title }}\">
<div class=\"deluxe-movie-info\">{{ movie.title }}</div>
</a>
</div>
{% endif %}
{% set skippedFirst = true %}
{% endfor %}
</div>
<!-- Load the YouTube IFrame Player API -->
<script src=\"https://www.youtube.com/iframe_api\"></script>
<script>
function onDeluxePlayerReady(event) {
console.log(\"Player ready\");
event.target.unMute();
event.target.setVolume(20);
event.target.playVideo();
setTimeout(function() {
var overlay = document.getElementById('deluxe-overlay');
if (overlay) {
overlay.style.display = 'block';
console.log(\"Overlay added\");
} else {
console.error('Overlay element not found');
}
}, 10000); // Show overlay after 10 seconds
}
function onDeluxePlayerStateChange(event) {
if (event.data === YT.PlayerState.ENDED) {
deluxePlayer.playVideo();
}
}
</script>
<script src=\"https://www.youtube.com/iframe_api\"></script>
<script>
var deluxePlayer;
function onYouTubeIframeAPIReady() {
var firstMovieName = document.getElementById('deluxe-overlay').innerHTML; // Replace this with dynamic data if available
console.log(firstMovieName);
searchYouTube(firstMovieName + \" trailer Movie TV Series\", function(videoId) {
deluxePlayer = new YT.Player('youtube-player', {
videoId: videoId,
playerVars: {
autoplay: 1,
controls: 0,
modestbranding: 1,
rel: 0,
showinfo: 0,
},
events:
{
'onReady': onDeluxePlayerReady
}
});
});
}
function searchYouTube(query, callback) {
var apiKey = 'AIzaSyABUXy24BFAgNuEjKHVLE1D7YfEti0pB5Y'; // Replace with your actual YouTube API Key
var url = `https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=1&q=\${encodeURIComponent(query)}&key=\${apiKey}`;
fetch(url)
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => {
if (data.items && data.items.length > 0) {
var videoId = data.items[0].id.videoId;
callback(videoId);
} else {
console.error('No videos found');
}
})
.catch(error => console.error('Error fetching YouTube videos:', error));
}
</script>
{% endblock %}", "movie/recommendations.html.twig", "/var/www/pimcore/MovieCollection/templates/movie/recommendations.html.twig");
}
}