document.addEventListener('DOMContentLoaded', () => {
const dropdownEl = '.js__dropdown';
const dropdownActive = 'dropdown-active';
function dropdownEach() {
document.querySelectorAll(dropdownEl).forEach((el) => {
if (el.classList.contains(dropdownActive)) {
el.classList.remove(dropdownActive)
}
})
}
document.addEventListener('click', (event) => {
const target = event.target
if (target.classList.contains('js__dropdown-toggle')) {
dropdownEach()
target.closest(dropdownEl).classList.add(dropdownActive);
} else if (target.closest('.js__dropdown-close')) {
dropdownEach()
} else if (!target.classList.contains('js__dropdown-toggle') && !target.closest(dropdownEl)) {
dropdownEach()
}
})
});
$(document).ready(function () {
// Находим плавающий блок и делаем его плавающим
$('.aside-fly').stick_in_parent({
// Чтобы сразу прокручивался обратно
inner_scrolling: true,
// Отступ сверху
offset_top: 90
});
});
var uiField = $(".form-control, .ui-field"),
fieldFilled = "field-filled";
uiField.change(function () {
if ($(this).val().trim().length) {
$(this).parent().addClass(fieldFilled);
} else {
$(this).parent().removeClass(fieldFilled);
}
});
uiField.each(function () {
if (this.value !== "") {
$(this).parent().addClass(fieldFilled);
}
});
@mixin stitches-sprite($x: 0, $y: 0, $width: 0, $height: 0) {
background-position: $x $y;
width: $width;
height: $height;
}
.sprite {
background-image: url('spritesheet.png');
background-repeat: no-repeat;
display: block;
&.sprite-courier {
@include stitches-sprite(-5px, -5px, 79px, 43px);
}
&.sprite-dhl {
@include stitches-sprite(-94px, -5px, 84px, 21px);
}
&.sprite-icon {
@include stitches-sprite(-94px, -36px, 51px, 51px);
}
&.sprite-icon-2 {
@include stitches-sprite(-155px, -36px, 51px, 51px);
}
&.sprite-icon-3 {
@include stitches-sprite(-5px, -97px, 51px, 51px);
}
&.sprite-icon-4 {
@include stitches-sprite(-66px, -97px, 51px, 51px);
}
&.sprite-icon-5 {
@include stitches-sprite(-127px, -97px, 51px, 51px);
}
&.sprite-icon-6 {
@include stitches-sprite(-5px, -158px, 53px, 15px);
}
&.sprite-item-big {
@include stitches-sprite(-68px, -158px, 90px, 35px);
}
&.sprite-item-header {
@include stitches-sprite(-188px, -5px, 32px, 13px);
}
&.sprite-jcb {
@include stitches-sprite(-188px, -97px, 43px, 41px);
}
&.sprite-mastercard {
@include stitches-sprite(-230px, -5px, 74px, 51px);
}
&.sprite-mastercard-securecode {
@include stitches-sprite(-188px, -148px, 80px, 42px);
}
&.sprite-post-russia {
@include stitches-sprite(-241px, -66px, 76px, 38px);
}
&.sprite-visa {
@include stitches-sprite(-168px, -200px, 56px, 39px);
}
&.sprite-visa-verified {
@include stitches-sprite(-234px, -200px, 74px, 47px);
}
}
var selector = '.work-1, .work-2, .work-3';
$(selector).find('> img').click(function () {
$(selector).removeClass('active');
$(this).parent().addClass('active');
});
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery('.btn-primary').click(function() {
jQuery.cookie('back_call', '1', {
expires: 1,
path: '/'
});
});
jQuery('.close span').mouseover(function() {
jQuery.cookie('back_call2', '2', {
expires: 1,
path: '/'
});
});
function showmodal() {
if (jQuery.cookie('back_call') != 1 && jQuery.cookie('back_call2') != 2 ) {
jQuery("#dialog").modal('show')
} else {
return setTimeout;
}
}
setTimeout(showmodal, 2000);
});