425 lines
16 KiB
JavaScript
425 lines
16 KiB
JavaScript
jQuery(function ($) {
|
|
function createCustomLines(options) {
|
|
var $parent = $(options.parent);
|
|
var $startElement = $parent.find(options.startElement);
|
|
var $endElement = $parent.find(options.endElement);
|
|
var $endElementImg = $endElement.find('img');
|
|
|
|
var parentWidth = $parent.parent().width();
|
|
var startElementHeight = $startElement.height();
|
|
var endElementHeight = $endElement.height();
|
|
var endElementImgWidth = $endElementImg.width();
|
|
|
|
// Start line
|
|
$('<div>', {
|
|
class: options.startLineClass
|
|
}).css({
|
|
'width': parentWidth - $parent.width(),
|
|
'height': 2,
|
|
'position': 'absolute',
|
|
'top': startElementHeight / 2,
|
|
'right': 'calc(100% + 10px)',
|
|
'transform': 'translateY(-50%)'
|
|
}).appendTo($startElement);
|
|
|
|
// End line
|
|
$('<div>', {
|
|
class: options.endLineClass
|
|
}).css({
|
|
'width': parentWidth - endElementImgWidth * 1.5,
|
|
'height': 2,
|
|
'position': 'absolute',
|
|
'top': endElementHeight / 2,
|
|
'right': endElementImgWidth * 1.5 + 10,
|
|
'transform': 'translateY(-50%)'
|
|
}).appendTo($endElement);
|
|
|
|
// Vertical line
|
|
var topStart = $startElement.position().top;
|
|
var topEnd = $endElement.position().top;
|
|
var verticalLineHeight = (topEnd - topStart * 2) + endElementHeight / 2;
|
|
|
|
$('<div>', {
|
|
class: options.verticalLineClass
|
|
}).css({
|
|
'width': 2,
|
|
'height': verticalLineHeight,
|
|
'position': 'absolute',
|
|
'top': startElementHeight / 2,
|
|
'right': parentWidth + 8,
|
|
}).appendTo($startElement);
|
|
}
|
|
|
|
if ($(window).width() > 768) {
|
|
if (
|
|
$('body').hasClass('page-id-11') ||
|
|
$('body').hasClass('page-id-4726') ||
|
|
$('body').hasClass('page-id-5090')
|
|
) {
|
|
createCustomLines({
|
|
parent: '.cl-1-box',
|
|
startElement: '.cl-1-box-start',
|
|
endElement: '.cl-1-box-end',
|
|
startLineClass: 'box-custom-line cl-1-start',
|
|
endLineClass: 'box-custom-line cl-1-end cl-1-end-arrow',
|
|
verticalLineClass: 'box-custom-line cl-1-vertical'
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
jQuery(function ($) {
|
|
function createArrow(fromClass, toClass, arrowClass, arrowAngle, position, offsetPercentage) {
|
|
// Tworzymy element strzałki
|
|
var $arrow = $('<span>', {
|
|
class: arrowClass + ' ' + arrowAngle
|
|
}).css({
|
|
'position': 'absolute',
|
|
[position]: offsetPercentage,
|
|
'top': "100%"
|
|
});
|
|
$(fromClass).append($arrow);
|
|
|
|
// Pobieramy potrzebne elementy
|
|
var $from = $(fromClass);
|
|
var $to = $(toClass);
|
|
|
|
// Obliczamy i ustawiamy szerokość strzałki tylko raz
|
|
var temp = $to.parent().children('div:last').offset().left -
|
|
($to.parent().children('div:first').offset().left + $to.parent().children('div:first').innerWidth() - 10);
|
|
var width;
|
|
if (position === 'left') {
|
|
width = $to.offset().left - ($arrow.offset().left + $arrow.outerWidth()) - temp;
|
|
} else {
|
|
width = $arrow.offset().left - ($to.offset().left + $to.outerWidth()) - temp;
|
|
}
|
|
$arrow.css('width', width);
|
|
|
|
// Funkcja aktualizująca tylko wysokość strzałki
|
|
function updateArrow() {
|
|
var height = $to.offset().top - ($from.offset().top + $from.outerHeight());
|
|
$arrow.css('height', height);
|
|
}
|
|
|
|
// Pierwsze przeliczenie wysokości
|
|
updateArrow();
|
|
|
|
// Aktualizacja wysokości podczas scrollowania (jeśli strzałka jest widoczna)
|
|
$(window).on('scroll.' + arrowClass, function () {
|
|
var arrowTop = $arrow.offset().top;
|
|
var scrollTop = $(window).scrollTop();
|
|
var windowHeight = $(window).height();
|
|
if (arrowTop >= scrollTop && arrowTop < scrollTop + windowHeight) {
|
|
updateArrow();
|
|
}
|
|
});
|
|
|
|
// Aktualizacja wysokości podczas zmiany rozmiaru okna
|
|
$(window).on('resize.' + arrowClass, updateArrow);
|
|
}
|
|
|
|
if ($(window).width() > 1024) {
|
|
if (
|
|
$('body').hasClass('page-id-532') ||
|
|
$('body').hasClass('page-id-4761') ||
|
|
$('body').hasClass('page-id-5106')
|
|
) {
|
|
createArrow('.box-arrow-1', '.box-arrow-2', 'box-arrow-1-span', 'box-arrow-left', 'left', "50%");
|
|
createArrow('.box-arrow-2', '.box-arrow-3', 'box-arrow-2-span', 'box-arrow-right', 'right', "30%");
|
|
createArrow('.box-arrow-3', '.box-arrow-4', 'box-arrow-3-span', 'box-arrow-left', 'left', "30%");
|
|
createArrow('.box-arrow-4', '.box-arrow-5', 'box-arrow-4-span', 'box-arrow-right', 'right', "30%");
|
|
createArrow('.box-arrow-5', '.box-arrow-6', 'box-arrow-5-span', 'box-arrow-left', 'left', "30%");
|
|
createArrow('.box-arrow-6', '.box-arrow-7', 'box-arrow-6-span', 'box-arrow-right', 'right', "30%");
|
|
createArrow('.box-arrow-7', '.box-arrow-8', 'box-arrow-7-span', 'box-arrow-left', 'left', "30%");
|
|
createArrow('.box-arrow-8', '.box-arrow-9', 'box-arrow-8-span', 'box-arrow-right', 'right', "30%");
|
|
createArrow('.box-arrow-9', '.box-arrow-10', 'box-arrow-9-span', 'box-arrow-left', 'left', "30%");
|
|
}
|
|
}
|
|
});
|
|
|
|
jQuery(function ($) {
|
|
if ($(window).width() > 1024) {
|
|
if (
|
|
$('body').hasClass('page-id-594') ||
|
|
$('body').hasClass('page-id-4785') ||
|
|
$('body').hasClass('page-id-5183')
|
|
) {
|
|
// BOX 1 - line left
|
|
$('<span>', {
|
|
class: 'box-1-span box-1-span-left'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'left': '0',
|
|
'top': -($('.box-1-data').offset().top - $('.box-1-title').offset().top - ($('.box-1-title').height() / 2)),
|
|
'bottom': -($('.box-1-btn').offset().top - $('.box-1-data').offset().top - $('.box-1-data').height() + $('.box-1-btn').height() / 2),
|
|
'width': '50%'
|
|
}).appendTo($('.box-1 .box-1-data > .e-con-inner'));
|
|
|
|
$('<span>', {
|
|
class: 'box-1-span box-1-span-left-top'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'left': 0,
|
|
'top': 0,
|
|
'height': 1,
|
|
'width': $('.box-1-title').offset().left - $('.box-1-span-left').offset().left
|
|
}).appendTo($('.box-1 .box-1-span-left'));
|
|
|
|
// BOX 1 - line right
|
|
$('<span>', {
|
|
class: 'box-1-span box-1-span-right'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'right': '0',
|
|
'top': -($('.box-1-data').offset().top - $('.box-1-title').offset().top - ($('.box-1-title').height() / 2)),
|
|
'bottom': -($('.box-1-btn').offset().top - $('.box-1-data').offset().top - $('.box-1-data').height() + $('.box-1-btn').height() / 2),
|
|
'width': '50%'
|
|
}).appendTo($('.box-1 .box-1-data > .e-con-inner'));
|
|
|
|
$('<span>', {
|
|
class: 'box-1-span box-1-span-right-top'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'right': 0,
|
|
'top': 0,
|
|
'height': 1,
|
|
'width': $('.box-1-title').offset().left - $('.box-1-span-right').offset().left + $('.box-1-span-right').width()
|
|
}).appendTo($('.box-1 .box-1-span-right'));
|
|
|
|
|
|
// BOX 2
|
|
let temp = $('.box-2 .box-2-start').parent().offset().left - $('.box-2 .box-2-start').parent().parent().children('div:first').offset().left - $('.box-2 .box-2-start').parent().parent().children('div:first').width();
|
|
|
|
$('<span>', {
|
|
class: 'box-2-span box-2-span-start'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'top': $('.box-2-start').height() / 2,
|
|
'right': 'calc(100% + ' + (temp) / 2 + 'px)',
|
|
'width': $('.box-2 .box-2-start').parent().parent().children('div:first').width() + temp,
|
|
'height': 2,
|
|
}).appendTo($('.box-2 .box-2-start'));
|
|
|
|
$('<span>', {
|
|
class: 'box-2-span box-2-span-end'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'top': $('.box-2-end').height() / 2,
|
|
'right': 'calc(100% + 100px)',
|
|
'width': $('.box-2 .box-2-end').offset().left - $('.box-2-span.box-2-span-start').offset().left - 100,
|
|
'height': 2,
|
|
}).appendTo($('.box-2 .box-2-end'));
|
|
|
|
$('<span>', {
|
|
class: 'box-2-span box-2-span-vertical'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'width': 2,
|
|
'height': ($('.box-2-span.box-2-span-end').offset().top - $('.box-2-span.box-2-span-start').offset().top),
|
|
}).appendTo($('.box-2-span.box-2-span-start'));
|
|
|
|
$('<div>', {
|
|
class: 'box-2-end-arrow'
|
|
}).appendTo($('.box-2-span.box-2-span-end'));
|
|
|
|
// BOX 3
|
|
temp = $('.box-3 .box-3-start').parent().parent().children('div:last').offset().left - $('.box-3 .box-3-start').parent().parent().children('div:first').width() - $('.box-3 .box-3-start').parent().parent().children('div:first').offset().left;
|
|
|
|
$('<span>', {
|
|
class: 'box-3-span box-3-span-start'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'top': $('.box-2-start').height() / 2,
|
|
'left': 'calc(100% + 45px)',
|
|
'width': $('.box-3 .box-3-start').parent().parent().children('div:last').width() + $('.box-3 .box-3-start').parent().parent().children('div:first').width() - $('.box-3 .box-3-start').width() + temp,
|
|
'height': 2,
|
|
}).appendTo($('.box-3 .box-3-start'));
|
|
|
|
$('<span>', {
|
|
class: 'box-3-span box-3-span-end'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'top': $('.box-3-end').height() / 2,
|
|
'left': 'calc(100% + 100px)',
|
|
'width': $('.box-3 .box-3-end').parent().parent().children('div:last').width() + $('.box-3 .box-3-end').parent().parent().children('div:first').width() - $('.box-3 .box-3-end').width() + temp - 100 + 45,
|
|
'height': 2,
|
|
}).appendTo($('.box-3 .box-3-end'));
|
|
|
|
$('<span>', {
|
|
class: 'box-3-span box-3-span-vertical'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'width': 2,
|
|
'right': 0,
|
|
'height': ($('.box-3-span.box-3-span-end').offset().top - $('.box-3-span.box-3-span-start').offset().top),
|
|
}).appendTo($('.box-3-span.box-3-span-start'));
|
|
|
|
$('<div>', {
|
|
class: 'box-3-end-arrow'
|
|
}).appendTo($('.box-3-span.box-3-span-end'));
|
|
|
|
|
|
// BOX 4
|
|
temp = $('.box-4 .box-4-start').parent().offset().left - $('.box-4 .box-4-start').parent().parent().children('div:first').offset().left - $('.box-4 .box-4-start').parent().parent().children('div:first').width();
|
|
|
|
$('<span>', {
|
|
class: 'box-4-span box-4-span-start'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'top': $('.box-4-start').height() / 2,
|
|
'right': 'calc(100% + ' + (temp) / 2 + 'px)',
|
|
'width': $('.box-4 .box-4-start').parent().parent().children('div:first').width() + temp,
|
|
'height': 2,
|
|
}).appendTo($('.box-4 .box-4-start'));
|
|
|
|
$('<span>', {
|
|
class: 'box-4-span box-4-span-end'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'top': $('.box-4-end').height() / 2,
|
|
'right': 'calc(100% + 100px)',
|
|
'width': $('.box-4 .box-4-end').offset().left - $('.box-4-span.box-4-span-start').offset().left - 100,
|
|
'height': 2,
|
|
}).appendTo($('.box-4 .box-4-end'));
|
|
|
|
$('<span>', {
|
|
class: 'box-4-span box-4-span-vertical'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'width': 2,
|
|
'height': ($('.box-4-span.box-4-span-end').offset().top - $('.box-4-span.box-4-span-start').offset().top),
|
|
}).appendTo($('.box-4-span.box-4-span-start'));
|
|
|
|
$('<div>', {
|
|
class: 'box-4-end-arrow'
|
|
}).appendTo($('.box-4-span.box-4-span-end'));
|
|
}
|
|
}
|
|
});
|
|
|
|
jQuery(function ($) {
|
|
if ($('body.page-id-936').length || $('body.page-id-971').length) {
|
|
let menuItem = $('nav .elementor-nav-menu .menu-item.menu-item-883')
|
|
menuItem.addClass('current-menu-item current_page_item');
|
|
$('a', menuItem).addClass('elementor-item-active');
|
|
}
|
|
})
|
|
|
|
jQuery(function ($) {
|
|
|
|
if ($(window).width() > 1024) {
|
|
if ($('body.page-id-999').length) {
|
|
// BOX 1
|
|
let temp = $('.box-1 .box-1-start').parent().offset().left - $('.box-1 .box-1-start').parent().parent().children('div:first').offset().left - $('.box-1 .box-1-start').parent().parent().children('div:first').width();
|
|
|
|
$('<span>', {
|
|
class: 'box-1-span box-1-span-start'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'top': $('.box-1-start').height() / 2,
|
|
'right': 'calc(100% + ' + (temp) / 2 + 'px)',
|
|
'width': $('.box-1 .box-1-start').parent().parent().children('div:first').width() + temp,
|
|
'height': 2,
|
|
}).appendTo($('.box-1 .box-1-start'));
|
|
|
|
$('<span>', {
|
|
class: 'box-1-span box-1-span-end'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'top': $('.box-1-end').height() / 2,
|
|
'right': 'calc(100% + 100px)',
|
|
'width': $('.box-1 .box-1-end').offset().left - $('.box-1-span.box-1-span-start').offset().left - 100,
|
|
'height': 2,
|
|
}).appendTo($('.box-1 .box-1-end'));
|
|
|
|
$('<span>', {
|
|
class: 'box-1-span box-1-span-vertical'
|
|
}).css({
|
|
'position': 'absolute',
|
|
'width': 2,
|
|
'height': ($('.box-1-span.box-1-span-end').offset().top - $('.box-1-span.box-1-span-start').offset().top),
|
|
}).appendTo($('.box-1-span.box-1-span-start'));
|
|
|
|
$('<div>', {
|
|
class: 'box-1-end-arrow'
|
|
}).appendTo($('.box-1-span.box-1-span-end'));
|
|
|
|
}
|
|
}
|
|
})
|
|
|
|
jQuery(function ($) {
|
|
if ($(window).width() > 1024) {
|
|
if ($('body.page-id-1182').length) {
|
|
let row_1 = $('#contact-members > .e-con-inner > div').slice(0, 3).sort(function (a, b) {
|
|
return $(b).height() - $(a).height();
|
|
}).first();
|
|
|
|
let row_2 = $('#contact-members > .e-con-inner > div').slice(3, 5).sort(function (a, b) {
|
|
return $(b).height() - $(a).height();
|
|
}).first();
|
|
|
|
let row_3 = $('#contact-members > .e-con-inner > div').slice(5, 8).sort(function (a, b) {
|
|
return $(b).height() - $(a).height();
|
|
}).first();
|
|
|
|
let row_gap = row_2.offset().top - row_1.offset().top - row_1.height();
|
|
let col_gap = $('#contact-members > .e-con-inner > div:nth-child(2)').offset().left - $('#contact-members > .e-con-inner > div:nth-child(1)').offset().left - $('#contact-members > .e-con-inner > div:nth-child(1)').width()
|
|
|
|
$('<span>', {
|
|
class: 'cm-line-1'
|
|
}).css({
|
|
'width': $('#contact-members > .e-con-inner > div:nth-child(1)').width() + $('#contact-members > .e-con-inner > div:nth-child(2)').width() + col_gap,
|
|
'height': '1px',
|
|
'top': (row_2.offset().top - row_1.offset().top) - ((row_2.offset().top - row_1.offset().top - row_1.height()) / 2)
|
|
}).appendTo($('#contact-members > .e-con-inner'));
|
|
|
|
$('<span>', {
|
|
class: 'cm-line-2'
|
|
}).css({
|
|
'width': $('#contact-members > .e-con-inner > div:nth-child(3)').width(),
|
|
'height': '1px',
|
|
'right': 0,
|
|
'top': (row_2.offset().top - row_1.offset().top) - ((row_2.offset().top - row_1.offset().top - row_1.height()) / 2)
|
|
}).appendTo($('#contact-members > .e-con-inner'));
|
|
|
|
$('<span>', {
|
|
class: 'cm-line-3'
|
|
}).css({
|
|
'width': $('#contact-members > .e-con-inner').width(),
|
|
'height': '1px',
|
|
'top': row_1.height() + row_gap + row_2.height() + (row_gap / 2)
|
|
}).appendTo($('#contact-members > .e-con-inner'));
|
|
|
|
$('<span>', {
|
|
class: 'cm-line-4'
|
|
}).css({
|
|
'width': '1px',
|
|
'height': $('#contact-members > .e-con-inner > div:nth-child(3)').height() + $('#contact-members > .e-con-inner > div:nth-child(5)').height() + row_gap,
|
|
'right': $('#contact-members > .e-con-inner > div:nth-child(3)').width() + col_gap / 2,
|
|
'top': 0
|
|
}).appendTo($('#contact-members > .e-con-inner'));
|
|
}
|
|
}
|
|
})
|
|
|
|
jQuery(function ($) {
|
|
if (!$('body.single-post').length) {
|
|
$('header').css({
|
|
'margin-bottom': `-${$('header').height()}px`
|
|
})
|
|
|
|
$(window).scroll(function () {
|
|
if ($(this).scrollTop() > 100) {
|
|
$('header.elementor-location-header').addClass('fixed');
|
|
} else {
|
|
$('header.elementor-location-header').removeClass('fixed');
|
|
}
|
|
});
|
|
|
|
$('body').on('click', '#header-search-switcher', function () {
|
|
$('#header-search-box').slideToggle();
|
|
})
|
|
}
|
|
}) |