{% extends '/uniqskills/layout.html.twig' %}
{% block meta %}
{% if course.metaTitle is not empty %}
<meta name="title" content="{{ course.metaTitle }}">
{% endif %}
{% if course.metaDescription is not empty %}
<meta name="description" content="{{ course.metaDescription }}">
{% endif %}
{% endblock %}
{#{% if app.request.locale == 'en' %}#}
{# {% block title %}#}
{# {{ course.name }} - UniqSkills#}
{# {% endblock %}#}
{#{% endif %}#}
{% block customcss %}
<style>
body {
font-size: 16px !important;
}
@media (max-width: 767px) {
.fabs {
bottom: 150px;
}
}
</style>
<link rel="stylesheet" href="/uniqskills/new_landing/stylesheets/main.css?v=1.23">
{% endblock %}
{% block content %}
{# --- Type of price, default NET --- #}
{% set typeParam = app.request.query.get('apivalue') %}
{% if typeParam is not empty and (typeParam == 'netto' or typeParam == 'brutto') %}
{% set initialType = typeParam %}
{% else %}
{% set initialType = 'netto' %}
{% endif %}
{# --- END OF: Type of price, default NET --- #}
{% if preview == true %}
<div class="landing-preview-info">
LANDING PREVIEW
</div>
{% endif %}
{% if app.request.locale == "es" %}
<div style="margin-bottom:0px;" class="single-course__bannerSM" id="smb_3798"></div>
{% endif %}
{% for module in landing.modules %}
{% if module.showModule == true %}
{% if module.type == 'promotionBar' %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/promotionBar.html.twig' %}
{% elseif module.type == 'courseTitle' %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/courseTitle.html.twig' %}
{% elseif module.type == 'basicDescription' and module.descriptionCheckboxes is defined %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/basicDescription.html.twig' %}
{% elseif module.type == 'description' %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/description.html.twig' %}
{% elseif module.type == 'finishCourse' and module.json is defined %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/finishCourse.html.twig' %}
{% elseif module.type == 'courseContent' and module.points is defined %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/courseContent.html.twig' %}
{% elseif module.type == 'courseProgram' %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/courseProgram.html.twig' %}
{% elseif module.type == 'tutors' and module.tutorsList is defined %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/tutors.html.twig' %}
{% elseif module.type == 'teaching' and module.json is defined %}
{#{% include 'uniqskills/catalogue/landing_partials/teaching.html.twig' %}#}
{% elseif module.type == 'payment' %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/payment.html.twig' %}
{% elseif module.type == 'faq' and module.list is defined %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/faq.html.twig' %}
{% elseif module.type == 'contact' %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/contact.html.twig' %}
{% elseif module.type == 'clearHtmlSection' %}
<section class="clearHtml">
<a name="{{ module.type }}-{{ module.id }}"></a>
<div class="container">
<div class="row">
<div class="col">
{{ include(template_from_string(module.text|raw)) }}
</div>
</div>
</div>
</section>
{% endif %}
{% endif %}
{% endfor %}
{% if suggestedCourses|length > 0 %}
{% include 'uniqskills/catalogue/landing_new/landing_partials/forYou.html.twig' %}
{% endif %}
<a href="{{ referer }}"
class="button button--autoWidth button-blueBorder toCategories"
style="margin-left: 0;">
>> {{ 'uniqskills.landing.toCategories'|trans }} <<
</a>
{% endblock %}
{% block customjs %}
{% if app.environment == 'dev' %}
<script src="{{ asset('uniqskills/new_landing/js/faq.js') }}"></script>
<script src="{{ asset('uniqskills/new_landing/js/header.js') }}"></script>
<script src="{{ asset('uniqskills/new_landing/js/courseprogram.js') }}"></script>
<script src="{{ asset('uniqskills/new_landing/js/subscriptions.js') }}"></script>
<script src="{{ asset('uniqskills/new_landing/js/popper.min.js') }}"></script>
<script src="{{ asset('uniqskills/new_landing/js/bootstrap.min.js') }}"></script>
{% elseif app.environment == 'prod' %}
<script src="{{ asset('uniqskills/new_landing/js/dist/all.js?ver=1.1') }}" defer></script>
{% endif %}
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'course': {{ course.id }}
});
/**
* Set icon container height in rowIncludes section on mobile screens
* */
function setRowIconHeight() {
var windowWidth = window.innerWidth;
var iconsBack = document.querySelectorAll('.rowIconBack');
if( windowWidth <= 575 ) {
for( var i = 0; i < iconsBack.length; i++ ) {
var backHeight = iconsBack[i].offsetHeight;
var frontHeight = iconsBack[i].previousElementSibling.offsetHeight;
if( backHeight >= frontHeight ) {
iconsBack[i].parentNode.style.height = backHeight + 'px';
} else {
iconsBack[i].parentNode.style.height = frontHeight + 'px';
}
}
}
}
/**
* Rotate icon container in rowincludes section on icon click on mobile screens
* */
function flipIconCards() {
var windowWidth = window.innerWidth;
var icons = document.querySelectorAll('.bgs--small-xs');
var cardIconContainers = document.querySelectorAll('.rowIncludes__oneRow');
var activeIconContainer;
if( windowWidth <= 575 ) {
for (var icon of icons) {
icon.addEventListener('click', function () {
activeIconContainer = this.closest('.rowIncludes__oneRow');
// Remove class hover-manual from all elements .rowIncludes__oneRow
for (var cardContainer of cardIconContainers) {
cardContainer.classList.remove('hover-manual');
}
// Add class hover-manual to parent element who has class rowIncludes__oneRow
this.closest('.rowIncludes__oneRow').classList.add('hover-manual');
});
}
// Remove class hover-manual when user click outside active icon container
document.addEventListener('click', function(e) {
if( activeIconContainer !== undefined && !activeIconContainer.contains(e.target) && typeof(activeIconContainer) !== 'undefined' ) {
for (var cardContainer of cardIconContainers) {
cardContainer.classList.remove('hover-manual');
}
}
});
}
}
/*
* Hides pulsing Tap icon in rowincludes section after 10 seconds when the section is visible
* */
function hideTapIcon() {
var windowWidth = window.innerWidth;
if( windowWidth <= 575 ) {
// this is the target which is observed
var target = document.querySelector('section.rowIncludes');
// configure the intersection observer instance
var intersectionObserverOptions = {
root: null,
rootMargin: '150px',
threshold: 1.0
};
var observer = new IntersectionObserver(onIntersection, intersectionObserverOptions);
// provide the observer with a target
observer.observe(target);
function onIntersection(entries) {
entries.forEach(function (entry) {
target.classList.toggle('visible', entry.intersectionRatio > 0);
// Are we in viewport?
if (entry.intersectionRatio > 0) {
setTimeout(function () {
document.querySelector('.rowIncludes__tap-icon').classList.add('rowIncludes__tap-icon--none');
}, 10000)
}
});
}
}
}
</script>
<script>
$(document).ready(function () {
const openedModules = sessionStorage.getItem('openedModules');
if (openedModules)
{
openedModules.split(',').forEach(element => $(`#${element}`).show());
sessionStorage.removeItem('openedModules');
}
$('body').on('click', '.sm-download', function (e) {
sendDownloadEvent();
});
$('body').on('click', function(){
if ($('#vimeoVideoModalIframe').length > 0)
{
$('#vimeoVideoModalIframe').attr('src','');
$('.modal').on('hide.bs.modal', function(){
if ($('#vimeoVideoModalIframe').contents().find('.renderSuccessModal').length > 0)
{
const visibleModules = $('.rowCourseProgram__module__elements:not(:hidden)')
.map(function() {return this.id}).toArray().join();
if (visibleModules)
{
sessionStorage.setItem('openedModules', visibleModules);
}
location.reload();
}
});
}
});
$('.showFreeLessonVimeo').on('click', function () {
var urlVimeo = $(this).attr('data-vimeoUrl');
$('#freeVideoModalIframe').attr('src', urlVimeo);
$('#freeVideoModal').modal();
})
if ($(window).width() <= 768)
{
if ($('.iconArrowFreeLession').find('img').length > 0) $('.iconArrowFreeLession').find('img').attr('src', '/icons/arrow-down.svg');
}
$('.titleFreeLessonBox').on('click', function(){
$('.freeLessonInCourse').slideToggle('400', function(){
if ($(this).is(':visible')){
$('.iconArrowFreeLession').find('img').attr('src', '/icons/arrow-up.svg');
} else {
$('.iconArrowFreeLession').find('img').attr('src', '/icons/arrow-down.svg');
}
});
});
$('.freeAccessModalVimeo').click(function () {
if ($(this).hasClass('sm-download'))
{
sendDownloadEvent();
}
var currentUrl = $(this).data('free');
if ($(this).data('temporary') == true)
{
currentUrl = currentUrl.replace('vimeo.', 'player.vimeo.');
currentUrl = currentUrl.replace('.com/', '.com/video/');
$('#vimeoVideoModalIframe').attr('src', currentUrl);
$('#vimeoVideoModal').modal();
}
else
{
var urlLogin = $(this).data('login');
url = window.location.origin,
videoUrl = currentUrl.split('com/'),
videoNumber = videoUrl[1];
$('#vimeoVideoModalIframe').attr('src', url + urlLogin + '?modalVideo=' + videoNumber + '&modalCourse=' + {{ course.id }});
$('#vimeoVideoModal').modal();
}
return false;
});
function sendDownloadEvent() {
console.log('clickowanie');
$.ajax({
type: 'POST',
url: '{{ path('fmUniqskillsSalesManagoDownload', {'course': course.id}) }}',
success: function (data) {
// handle success
},
error: function (error) {
console.error(error);
}
});
}
$('.freeAccessModalPdf').click(function () {
var urlLogin = $(this).data('login'),
url = window.location.origin;
$('#vimeoVideoModalIframe').attr('src', url + urlLogin + '?modalPdf=1');
$('#vimeoVideoModal').modal();
return false;
});
$('.menu-link-scroll').click(function (e) {
var width = $(window).width();
var offsetAdd = 0;
if(width < 768)
{
offsetAdd = -15;
}
e.preventDefault();
var id = $(this).data('link');
$('html,body').animate({
scrollTop: ($('a[name="' + id + '"]').offset().top - 80 - offsetAdd)
}, 1000);
});
// $('#recipeCarousel').carousel({
// interval: 10000
// });
$('.carousel .carousel-item').each(function () {
var minPerSlide = 3;
var next = $(this).next();
if (!next.length) {
next = $(this).siblings(':first');
}
next.children(':first-child').clone().appendTo($(this));
for (var i = 0; i < minPerSlide; i++) {
next = next.next();
if (!next.length) {
next = $(this).siblings(':first');
}
next.children(':first-child').clone().appendTo($(this));
}
});
var courseTitleVer2 = $('.rowHeader');
var courseTitleVer3 = $('.rowHeader-mobile-image');
$(window).on("resize", function (e) {
checkScreenSize(courseTitleVer2);
checkScreenSize(courseTitleVer3);
});
checkScreenSize(courseTitleVer2);
checkScreenSize(courseTitleVer3);
function checkScreenSize(element) {
var newWindowWidth = $(window).width();
element.each(function () {
var courseTitleImage = $(this).data('image');
var courseTitleBackground = $(this).data('background');
var courseTitleBackgroundMobile = $(this).data('background-mobile');
if (courseTitleImage === 'image') {
if (newWindowWidth <= 768) {
$(this).css({
'background': "url('" + courseTitleBackgroundMobile + "')",
'background-size': '100%',
'background-repeat': 'no-repeat'
});
} else {
$(this).css({
'background': "url('" + courseTitleBackground + "')",
'background-position': 'right top',
'background-repeat': 'no-repeat',
'background-size': 'cover',
});
}
}
});
}
// Show less description
function showMore2() {
var windowWidth = $(window).width();
var content = $(".rowDescription__short-desc");
var readMoreButton = $(".rowDescription__read-more");
var readMoreText = readMoreButton.data('read-more');
var readLessText = readMoreButton.data('read-less');
var anchorSection = $('section.rowDescription__normal > a[name]');
if( windowWidth < 768 ) {
readMoreButton.on('click', function(e) {
e.preventDefault();
if(content.hasClass('active')) {
content.removeClass('rowDescription__short-desc--normal');
content.removeClass('active');
setTimeout(function() {
$('html,body').animate({
scrollTop: anchorSection.offset().top - 120
}, 1000);
}, 70);
readMoreButton.text(readMoreText);
} else {
content.addClass('active');
content.addClass('rowDescription__short-desc--normal');
readMoreButton.text(readLessText);
}
});
}
}
showMore2();
// Highlight menu link in 2Menu
function highlightMenuLink() {
var lastId = "";
var helperHeight = 58;
if( $(window).width() <= 768) {
helperHeight = 43;
}
var menuItems = $('.second-menu-slider').find('a');
var topMenuHeight = $('.second-menu-slider').outerHeight() + helperHeight;
var menuOffsetTop = $('.second-menu-slider').offset().top;
// scrollItems - list of links with internal anchors
var scrollItems = menuItems.map( function() {
var idSelector = $(this).attr('href');
idSelector = idSelector.replace(/^#/, '');
var itemAnchor = $('a[name='+idSelector+']');
if(itemAnchor.length) { return itemAnchor; }
});
var fromTop = $(this).scrollTop() + topMenuHeight;
var cur = scrollItems.map(function(){
if ($(this).offset().top < fromTop) {
return this;
}
});
cur = cur[cur.length-1];
var id = cur && cur.length ? cur[0].name : "";
if (fromTop > menuOffsetTop && lastId !== id) {
lastId = id;
menuItems.removeClass('active-menu-link');
var currentItemMenu = menuItems.filter('[href=\\#'+id+']')[0];
currentItemMenu.classList.add('active-menu-link');
}
}
// Sticky menu
var secondMenu = $('.rowHeader__textRow__linkAndPrice');
var secondMenuPosition = secondMenu.offset().top;
$(window).scroll(function() {
var currentPosition = $(window).scrollTop();
if( currentPosition >= secondMenuPosition) {
secondMenu.addClass('rowHeader__textRow__linkAndPrice--fixed')
} else {
secondMenu.removeClass('rowHeader__textRow__linkAndPrice--fixed');
}
hideTapIcon();
highlightMenuLink();
});
// Tutors slider
$('.tutors-slider').slick({
slidesToShow: {% if app.request.locale == 'en' %}2{% else %}3{% endif %},
slidesToScroll: {% if app.request.locale == 'en' %}2{% else %}3{% endif %},
infinite: true,
autoplay: false,
arrows: false,
dots: true,
responsive: [
{
breakpoint: 992,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
}
},
{
breakpoint: 768,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
variableWidth: true,
}
}
]
});
$('.suggestedCurses__slider').slick({
slidesToShow: 3,
slidesToScroll: 3,
infinite: true,
autoplay: false,
arrows: false,
dots: true,
responsive: [
{
breakpoint: 992,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
}
},
{
breakpoint: 768,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
variableWidth: true,
}
}
]
});
$('.second-menu-slider').slick({
slidesToShow: 5,
slidesToScroll: 1,
infinite: false,
autoplay: false,
arrows: true,
prevArrow: '<i class="fa fa-angle-left" aria-hidden="true"></i>',
nextArrow: '<i class="fa fa-angle-right" aria-hidden="true"></i>',
responsive: [
{
breakpoint: 1199,
settings: {
slidesToShow: 5,
slidesToScroll: 1,
}
},
{
breakpoint: 768,
settings: {
slidesToShow: 4,
slidesToScroll: 1,
arrows: true
}
}
]
});
setRowIconHeight();
flipIconCards();
});
$(window).on('resize', function() {
setRowIconHeight();
});
</script>
{% if landing.landing.customScripts is not empty %}
<script>
{{ landing.landing.customScripts|raw }}
</script>
{% endif %}
{% endblock %}