A Pen by ddimonn8080

Developer
Size
22,065 Kb
Views
38,456

How do I make an a pen by ddimonn8080?

What is a a pen by ddimonn8080? How do you make a a pen by ddimonn8080? This script and codes were developed by Ddimonn8080 on 31 July 2022, Sunday.

A Pen by ddimonn8080 Previews

A Pen by ddimonn8080 - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>A Pen by ddimonn8080</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div style="transform: translate3d(0px, 460px, 0px);" data-module="oscillation" class="common-canvas inited"><canvas style="width: 1376px; height: 140px;" height="140" width="1376"></canvas></div> <script src="js/index.js"></script>
</body>
</html>

A Pen by ddimonn8080 - Script Codes CSS Codes

.common-canvas { position: absolute; margin-top: -70px; top: 0px; height: 140px; width: 100%; z-index: 2;
}
audio, canvas, progress, video { display: inline-block; vertical-align: baseline;
}

A Pen by ddimonn8080 - Script Codes JS Codes

(function(){ 'use strict'; var win = window; var nav = navigator; var ua = nav.userAgent; win.isIE = function(version) { var myNav = ua.toLowerCase(); var v = (myNav.indexOf('msie') !== -1) ? parseInt(myNav.split('msie')[1]) : false; if (!version) { return v; } return v === version; }; win._isIpad = ua.match(/iPad/i) !== null; win._isIphone = nav.platform.indexOf('iPhone') !== -1; win._isIpod = nav.platform.indexOf('iPod') !== -1; win._isAndroid = /Android/i.test(ua); win._isIEMobile = /IEMobile/i.test(ua); win._isTouch = 'ontouchstart' in win || 'onmsgesturechange' in win; win._isIE = win.isIE(); win._isIE8 = win.isIE(8); win._isIE9 = win.isIE(9); win._isIE9 = win.isIE(9); win._isIE10 = win.isIE(10); win._isIE11 = win.isIE(11); win._isChrome = !!win.chrome; win._isFF = ua.toLowerCase().indexOf('firefox') > -1; win._isOpera = ua.toLowerCase().indexOf('Opera') > -1; win._isSafari = ua.indexOf('Safari') !== -1 && ua.indexOf('Chrome') === -1; win._isApple = win._isIpod || win._isIphone || win._isIpad; win._isMobile = win._isAndroid || win._isApple || win._isIEMobile;
})();
var warmMeUp = { '/' : [ '/build/images/[email protected]' ], '/internet/home/' : [ '/build/images/[email protected]', '/build/images/[email protected]' ], '/internet/business/' : [ '/build/images/[email protected]', '/build/images/[email protected]' ], '/about/virgin/' : [ '/build/images/[email protected]' ], '/about/relations/' : [ '/build/images/relations/[email protected]' ], '/about/topartners/' : [ '/build/images/partners/[email protected]' ]
};
$(function(){ //loader "use strict"; animation['onPageLoaded'](); layoutConfigurator.init(); var path = document.location.pathname.replace(/^\/en/,''); path = path.replace(/\/$/,''); initModules(); animationsConfigurator.getEnterTimeline('default', path , function(){}) if (path =='/' || path == "") animation['brandNewVirgin'](); if (warmMeUp[document.location.pathname.replace(/^\/en/,'')]) { var imgs = warmMeUp[document.location.pathname.replace(/^\/en/,'')] if (window.devicePixelRatio<1.5) imgs = $.map(imgs, function(img){ return img.replace('@2x',''); }) createImages(imgs, function(){ fastdom.defer(1,function(){ initApplication(); }) }) } else { fastdom.defer(2,function(){ initApplication(); }) }
})
// http://stackoverflow.com/questions/8921783/cross-browser-solution-for-a-callback-when-loading-multiple-images
function createImages(srcs, fn) { var imgs = [], img; var remaining = srcs.length; for (var i = 0; i < srcs.length; i++) { img = new Image(); imgs.push(img); img.onload = function() { --remaining; if (remaining == 0) { fn(imgs); } }; img.src = srcs[i]; } return(imgs);
}
var __modules = {};
function initModules() { $('[data-module]:not(.inited)').each(function(){ var name = $(this).addClass('inited').attr('data-module'); if (!__modules[name]){ throw "Data module "+name+" is not EXISTS!!"; } __modules[name].call(this, $(this)); });
}
function scrollSize() { if (window._scrollbarWidth) return window._scrollbarWidth; var scrollDiv = $('<div><div>').css({ width: 100, height: 100, overflow: 'scroll', position: 'absolute', top: -9999 }).appendTo($('body')); var scrollbarWidth = scrollDiv[0].offsetWidth - scrollDiv[0].clientWidth; scrollDiv.remove(); return window._scrollbarWidth = scrollbarWidth;
}
function openPopup(el, cls) { var popup = { el : $('<div class="popup"><div class="background"></div><div class="scroll"><div class="playout"></div></div>') }, close; if(document.location.pathname.indexOf('/en/') != -1){ close = $('<div class="cross">Close</div>'); } else{ close = $('<div class="cross">Закрыть</div>'); } $('body').css({ 'overflow':'hidden' }); $('header, footer, section').css({ paddingRight : scrollSize() }); popup.layout = popup.el.find('.playout'), popup.background = popup.el.find('.background') popup.scroll = popup.el.find('.scroll') if (cls) popup.el.addClass(cls) popup.layout.append(close); popup.layout.append(el); $('body').append(popup.el); popup.el .on('mouseenter', function(){ window.scrolldisabled = true; }) .on('mouseleave', function(){ window.scrolldisabled = false; }) popup.syncSize = function() { var ph = popup.layout.height(), pw = popup.layout.width(), wh = $(window).height() if (wh > ph+160) { popup.layout.css({ top : '50%', marginLeft : popup.layout.outerWidth()*-0.5, marginTop : popup.layout.outerHeight()*-0.5 }) popup.scroll.removeClass('active'); } else { popup.layout.css({ top : 10, marginLeft : popup.layout.outerWidth()*-0.5, marginTop : 80, marginBottom : 80, }) popup.scroll.addClass('active'); } } popup.syncSize(); popup.el.find('img').load(function(){ popup.syncSize(); }) $(window).bind('resize.popup', function(){ popup.syncSize(); }) popup.close = function() { popup.el.remove(); $(window).unbind('.popup'); $('body').css({ 'overflow':'visible', 'overflow-y':'scroll' }); $('header, footer, section').css({ paddingRight : 0 }); } close.click(function(){ popup.close(); }) popup.scroll.click(function(e){ var t = $(e.target); if (t.hasClass('playout') || t.parents('.playout').length) return; popup.close(); }); return popup;
}
function preffix() { return document.location.pathname.indexOf('/en/') !== -1 ? '/en' : '';
}
function getLang() { return document.location.pathname.indexOf('/en/') !== -1 ? 'en' : 'ru';
}
function Load(el, action, cb) { $.ajax({ url: preffix()+'/popups/'+action, cache : false, success : function(data) { el.html(data); if (cb) cb() } });
}
function LoadPhoneMail(el, action, cb) { $.ajax({ url: preffix()+'/contacts/city/?code='+action, cache : false, success : function(data) { var html = $(data); el.html(html.find('.contacts-infobox__telephone')[0]); //el.append(html.find('.contacts-infobox__important_link')); if (cb) cb() } })
}
function LoadTariffsFormb2c(el, action, cb) { $.ajax({ url: preffix()+'/tariffsFormb2c/?code='+action, cache : false, success : function(data) { el.replaceWith(data); if (cb) cb() } })
}
function thankPopup(){ var el = $('<div></div>'), popup = openPopup(el, 'thank-popup'); Load(el, 'thank', function(){ $('.popup .playout').addClass('loaded'); popup.syncSize(); }); return popup;
}
function specialOfferPopup(offer) { var el = $('<div></div>'), popup = openPopup(el, 'offer-popup'); Load(el, offer, function(){ $('.popup .playout').addClass('loaded'); popup.syncSize(); }); return popup;
}
// NP wrapper
var NP = { interval: false, count : 0, start: function() { NP.stop(); NProgress.start(); this.count++; if (this.count>1) return; this.interval = setInterval( NProgress.inc.bind( NProgress ), 250 ); }, stop: function() { if (!this.count) return; this.count--; clearInterval( this.interval ); NProgress.done(); }
};
function getIEversion() { var rv = 0; // Return value assumes failure. if (navigator.appName === 'Microsoft Internet Explorer') { var ua = navigator.userAgent; var re = new RegExp( 'MSIE ([0-9]{1,}[.0-9]{0,})' ); if (re.exec( ua ) !== null) { rv = parseFloat( RegExp.$1 ); } } return rv;
}
(function( $ ) { $.fn.pop = function() { var top = this.get(-1); this.splice(this.length-1,1); return top; }; $.fn.shift = function() { var bottom = this.get(0); this.splice(0,1); return bottom; }; $.shuffle = function(arr) { for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x); return arr; }
})(jQuery);
jQuery.validator.addMethod("lettersonly", function(value, element) { return this.optional(element) || /^[a-zа-яё]+$/i.test(value);
}, "Letters only please");
NProgress.configure({ showSpinner: false });
var animation = {};
animation['onPageLoaded'] = function(){ if( $('.header').hasClass('err404') ) return; var tl = new TimelineMax(); tl.to('.loader', 0.4,{ startAt:{ autoAlpha:1 }, autoAlpha:0, immediateRender:true, force3D:true, ease:Power3.easeInOut },0) tl.to('.header', 1.2 ,{ startAt:{ y:-40, opacity:0 }, opacity:1, y:0, immediateRender:true, force3D:true, ease:Power3.easeOut },0); tl.staggerTo('.header__logo, .header-menu__elem, .header-controls', .3, { startAt:{ y:-10,opacity:0 }, y:0, opacity:1, immediateRender:true, force3D:true, ease:Power2.easeOut }, .2) return tl;
}
animation['brandNewVirgin'] = function(){ window.line.setAmplitude(0.1); var tl = new TimelineMax(); var splitted = new SplitText('.main-page__greeting', {type:"words,chars"}).words; var i = 0; tl.to({},2,{}); //for eng if(document.location.pathname.indexOf('/en') != -1){ tl.staggerTo(splitted[0].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(6)) } }, .07) tl.staggerTo(splitted[1].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(1)) } }, .07,'+=.5') tl.staggerTo(splitted[2].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(4)) } }, .07,'+=.1') tl.staggerTo(splitted[3].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(4)) } }, .07,'+=.1') tl.staggerTo(splitted[4].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(5)) } }, .07,'+=.7') tl.staggerTo(splitted[5].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(6)) } }, .07,'+=.1') tl.staggerTo(splitted[6].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(2)) } }, .07,'+=.1') tl.staggerTo(splitted[7].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(2)) } }, .07,'+=.1') tl.staggerTo(splitted[8].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(2)) } }, .07,'+=.1') } else { //for ru tl.staggerTo(splitted[0].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(6)) } }, .07) tl.staggerTo(splitted[1].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(1)) } }, .07,'+=.5') tl.staggerTo(splitted[2].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(4)) } }, .07,'+=.1') tl.staggerTo(splitted[3].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(4)) } }, .07,'+=.1') tl.staggerTo(splitted[4].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(5)) } }, .07,'+=.1') tl.staggerTo(splitted[5].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(6)) } }, .07,'+=.7') tl.staggerTo(splitted[6].children, .1, { startAt:{ autoAlpha:0,x:-2 }, autoAlpha:1, x:0, immediateRender:true, onStart:function(){ window.line.impulse(_.random(2)) } }, .07,'+=.1') }
}
// LAYOUT CONFIGURATOR 3000
var layoutConfigurator = { configs : { default : { height : 740, isHeaderTransparent : true, isVoiceLineVisible : true, isSubMinuVisible : false }, fullsize : { height : function(){ var h = getViewport().height; if (h<500) h = 500; return h; }, VoiceLineOffset : function(){ var h = getViewport().height; if (h<600) h = 600; return h/3*1.5; }, isHeaderTransparent : true, isVoiceLineVisible : true, isSubMinuVisible : false }, big__empty : { height : function(){ var h = getViewport().height, min = 550, infoboxHeight, footerHeight, mapHeight; infoboxHeight = Math.ceil( $('.contacts-infobox').outerHeight() ); footerHeight = Math.ceil( $('.footer').outerHeight() ); if(h > 550 + infoboxHeight + footerHeight){ mapHeight = h - infoboxHeight - footerHeight; if(mapHeight < 550){ mapHeight = 550; } $('.contacts-map__container').height(mapHeight) return mapHeight; } else{ $('.contacts-map__container').height(550) mapHeight = 550; return mapHeight; } }, isHeaderTransparent : false, isVoiceLineVisible : false, isSubMinuVisible : false }, teaser : { height : 580, isVoiceLineVisible : false, isHeaderTransparent : false, isSubMinuVisible : true }, landing : { height : 580, VoiceLineOffset : 460, isVoiceLineVisible : true, isHeaderTransparent : true, isSubMinuVisible : false }, promo : { height : 740, VoiceLineOffset : 460, isVoiceLineVisible : true, isHeaderTransparent : true, isSubMinuVisible : false }, no : { height : 0, isVoiceLineVisible : false, isHeaderTransparent : false, isSubMinuVisible : false } }, assigns:[ ['^/camera' ,'landing'], ['^/pbx' ,'landing'], ['^/internet/' ,'promo'], ['^/about/contacts' ,'big__empty'], ['^/contacts' ,'big__empty'], ['^/about/' ,'teaser'], ['^/forms/' ,'no'], ['^/' ,'fullsize'] ], activeLayout : 'default', onResize:function(){ var o = this.getConfig(this.activeLayout); TweenMax.set('.top-section', { height: o.height }); TweenMax.set('.content', { y: o.height }); if( !$('.header').hasClass('err404') ){ $('.header')[!o.isHeaderTransparent?'addClass':'removeClass']('header_active'); TweenMax.set('.header__bg', { autoAlpha:!o.isHeaderTransparent?1:0, force3D:true }) } TweenMax.set('.common-canvas, .loader__preloadLine', { y:o.VoiceLineOffset?o.VoiceLineOffset:0, force3D:true }) TweenMax.set('.secondary-nav', { autoAlpha:o.isSubMinuVisible?1:0, force3D:true }) }, findLayout : function(path){ var layout = false; $.each(this.assigns, function(){ var regexp = new RegExp(this[0],'i'); if (regexp.test(path)) { layout = this[1]; return false; } }); return layout; }, getConfig : function(name) { var conf = $.extend({},this.configs[name]); $.each(conf, function(i,v){ if ($.isFunction(v)) conf[i] = v(); }); return conf; }, timeline : function(oldPage, newPage){ var oldLayout = this.findLayout(oldPage); var newLayout = this.findLayout(newPage); if (oldLayout === newLayout) return; this.activeLayout = newLayout; console.log('Где находимся', newLayout); var o = this.getConfig(oldLayout); var n = this.getConfig(newLayout); // layout console.log('heights:', o.height,n.height) TweenMax.to('.top-section', 1.2, { startAt:{ height:o.height }, height: n.height, immediateRender:true, ease:Power2.easeInOut }); TweenMax.to('.content', 1.2, { startAt:{ y:o.height }, y: n.height, immediateRender:true, ease:Power2.easeInOut }); TweenMax.to('.common-canvas', .5, { startAt:{ opacity:o.isVoiceLineVisible?1:0, autoAlpha:o.isVoiceLineVisible?1:0, y:o.VoiceLineOffset?o.VoiceLineOffset:n.VoiceLineOffset?n.VoiceLineOffset-40:400 }, opacity:n.isVoiceLineVisible?1:0, autoAlpha:n.isVoiceLineVisible?1:0, y:n.VoiceLineOffset?n.VoiceLineOffset:o.VoiceLineOffset?o.VoiceLineOffset:400, immediateRender:true, ease:n.isVoiceLineVisible?Power2.easeOut:Power2.easeIn, force3D:true }) TweenMax.to('.secondary-nav', .5, { startAt:{ opacity:o.isSubMinuVisible?1:0, autoAlpha:o.isSubMinuVisible?1:0 }, opacity:n.isSubMinuVisible?1:0, autoAlpha:n.isSubMinuVisible?1:0, immediateRender:true, ease:n.isSubMinuVisible?Power2.easeOut:Power2.ease, force3D:true }) // header setTimeout(function(){ if( !$('.header').hasClass('err404') ){ $('.header')[!n.isHeaderTransparent?'addClass':'removeClass']('header_active'); } },300) if( !$('.header').hasClass('err404') ){ TweenMax.to('.header__bg',.5, { autoAlpha:!n.isHeaderTransparent?1:0, force3D:true, delay : .5 }) console.log(n.isHeaderTransparent); TweenMax.to('.header__border',.5, { autoAlpha:!n.isHeaderTransparent?1:0, force3D:true, delay : .5 }) } else{ TweenMax.to('.header__border', .1, { autoAlpha:1, force3D:true }) } }, init : function(){ $(window).on('resize',_.throttle(function(){ layoutConfigurator.onResize.call(layoutConfigurator); },16*5)) var path = document.location.pathname.replace(/^\/en/,''); console.log(path); this.activeLayout = this.findLayout( path ); this.onResize(); }
}
// BRAND NEW ANIMATION SCENE CONTAINER EVER SEEN IN MY LIFE!
var animationsConfigurator = { enter : {}, leave : {}, animate : function(oldPage, newPage, cb) { oldPage = oldPage.replace(/\/$/,''); newPage = newPage.replace(/\/$/,''); if (oldPage == '') oldPage = '/'; if (newPage == '') newPage = '/'; var i = 0; animationsConfigurator.getLeaveTimeline(oldPage, newPage, animationCallback) animationsConfigurator.getEnterTimeline(oldPage, newPage, animationCallback) function animationCallback(source) { i++; if (i==2) { cb(); } } }, getEnterTimeline : function(oldPage, newPage, cb){ // if (!animationsConfigurator.enter[newPage]) throw 'Для страницы '+newPage+' нет enter анимаций'; if (!animationsConfigurator.enter[newPage]) return cb('enter1'); if (animationsConfigurator.enter[newPage][oldPage]) return animationsConfigurator.enter[newPage][oldPage](new TimelineMax({ onComplete:cb })); if (!animationsConfigurator.enter[newPage]['default']) return cb('enter2'); //if (!animationsConfigurator.enter[newPage]['default']) throw 'Дефолтной enter анимации для страницы '+newPage+' нет'; return animationsConfigurator.enter[newPage]['default'](new TimelineMax({ onComplete:cb })); }, getLeaveTimeline : function(oldPage, newPage, cb){ // if (!animationsConfigurator.leave[oldPage]) throw 'Для страницы '+oldPage+' нет leave анимаций'; if (!animationsConfigurator.leave[oldPage]) return cb('leave1'); if (animationsConfigurator.leave[oldPage][newPage]) return animationsConfigurator.leave[oldPage][newPage](new TimelineMax({ onComplete:cb })); if (!animationsConfigurator.leave[oldPage]['default']) return cb('leave2'); //if (!animationsConfigurator.leave[oldPage]['default']) throw 'Дефолтной leave анимации для страницы '+oldPage+' нет'; return animationsConfigurator.leave[oldPage]['default'](new TimelineMax({ onComplete:cb })); }
};
function declareAnimation_ENTER(oldPage, newPage, fn) { var opts if (!fn) { fn = newPage; newPage = oldPage; oldPage = 'default'; } if (!animationsConfigurator.enter[newPage]) animationsConfigurator.enter[newPage] = {} animationsConfigurator.enter[newPage][oldPage] = fn;
}
function declareAnimation_LEAVE(oldPage, newPage, fn) { var opts if (!fn) { fn = newPage; newPage = 'default'; } if (!animationsConfigurator.leave[oldPage]) animationsConfigurator.leave[oldPage] = {} animationsConfigurator.leave[oldPage][newPage] = fn;
}
declareAnimation_ENTER('/internet/home', function(tl){ tl.to('.top-section__bg_home', 2.8, { startAt:{ scale:1.05 }, scale:1, force3D:true, ease:Power2.easeOut, immediateRender:true },0) tl.to('.home-top__hands', 1.5, { startAt:{ y:30 }, y:0, force3D:true, immediateRender:true, ease:Power2.easeOut },0) tl.to('.internet-page_home .internet-page__title', .5, { startAt:{opacity:0 }, opacity:1, force3D:true, immediateRender:true },1) tl.to('.internet-page_home .button_top-home', .5, { startAt:{opacity:0, x:-20 }, opacity:1, x:0, force3D:true, immediateRender:true, ease:Power2.easeOut },1.2)
})
declareAnimation_LEAVE('/internet/home', function(tl){ tl.to('.internet-page_home .internet-page__title', .5, { startAt:{opacity:1 }, opacity:0, force3D:true, immediateRender:true },0) tl.to('.internet-page_home .button_top-home', .5, { startAt:{opacity:1, x:0 }, opacity:0, x:20, force3D:true, immediateRender:true, ease:Power2.easeOut },0) tl.to('.home-top__hands', .6, { startAt:{ y:0, opacity:1 }, y:30, opacity:0, force3D:true, immediateRender:true },.2) tl.to('.top-section__bg_home', .5, { startAt:{opacity:1 }, opacity:0, force3D:true, immediateRender:true },.6) return tl;
})
declareAnimation_ENTER('/internet/business', function(tl){ tl.to('.top-section__bg_business', 2, { startAt:{ scale:1.05 }, scale:1, force3D:true, ease:Power2.easeOut, immediateRender:true },0) tl.to('.top-section__table', 2, { startAt:{ scale:.97 }, scale:1, force3D:true, ease:Power2.easeOut, immediateRender:true },0) tl.to('.internet-page_business .internet-page__title', .5, { startAt:{opacity:0 }, opacity:1, force3D:true, immediateRender:true },1) tl.to('.internet-page_business .button_top-home', .9, { startAt:{opacity:0, x:-20 }, opacity:1, x:0, force3D:true, immediateRender:true, ease:Power2.easeOut },1.3) return tl;
})
declareAnimation_LEAVE('/internet/business', function(tl){ tl.to('.internet-page_business .internet-page__title', .5, { startAt:{opacity:1 }, opacity:0, force3D:true, immediateRender:true },0) tl.to('.top-section__table', 1, { startAt:{ scale:1 }, scale:.97, force3D:true, ease:Power2.easeIn, immediateRender:true },0) tl.to('.internet-page_business .button_top-home', .5, { startAt:{opacity:1, x:0 }, opacity:0, x:20, force3D:true, immediateRender:true, ease:Power2.easeOut },0) tl.to('.top-section__bg_business', 1, { startAt:{opacity:1 }, opacity:0, force3D:true, immediateRender:true },0.6) tl.to('.top-section__table', .5, { startAt:{opacity:1 }, opacity:0, force3D:true, immediateRender:true },0.6) return tl;
})
declareAnimation_ENTER('/about/virgin', function(tl){ tl.to('.top-section__bg_about-virgin', 2, { startAt:{ scale:1.03 }, scale:1, force3D:true, ease:Power2.easeOut, immediateRender:true },0) tl.to('.about-page__title_about-virgin', .5, { startAt:{ y:20, opacity:0 }, y:0, opacity:1, force3D:true, ease:Power2.easeOut, immediateRender:true },.6) return tl;
})
declareAnimation_LEAVE('/about/virgin', function(tl){ tl.to('.top-section__bg_about-virgin', .7, { startAt:{ opacity:1 }, opacity:0, force3D:true, ease:Power2.easeIn, immediateRender:true },0) tl.to('.about-page__title_about-virgin', .5, { startAt:{ y:0, opacity:1 }, y:20, opacity:0, force3D:true, ease:Power2.easeIn, immediateRender:true },0) return tl;
})
declareAnimation_ENTER('/about/relations', function(tl){ tl.to('.top-section__bg_about-relations', 2, { startAt:{ scale:1.03 }, scale:1, force3D:true, ease:Power2.easeOut, immediateRender:true },0) tl.to('.about-page__title_about-relations', .5, { startAt:{ y:20, opacity:0 }, y:0, opacity:1, force3D:true, ease:Power2.easeOut, immediateRender:true },.6) return tl;
})
declareAnimation_LEAVE('/about/relations', function(tl){ tl.to('.top-section__bg_about-relations', .7, { startAt:{ opacity:1 }, opacity:0, force3D:true, ease:Power2.easeIn, immediateRender:true },0) tl.to('.about-page__title_about-relations', .5, { startAt:{ y:0, opacity:1 }, y:20, opacity:0, force3D:true, ease:Power2.easeIn, immediateRender:true },0) return tl;
})
declareAnimation_ENTER('/about/topartners', function(tl){ tl.to('.top-section__bg_about-partners', 2, { startAt:{ scale:1.03 }, scale:1, force3D:true, ease:Power2.easeOut, immediateRender:true },0) tl.to('.about-page__title_about-partners', .5, { startAt:{ y:20, opacity:0 }, y:0, opacity:1, force3D:true, ease:Power2.easeOut, immediateRender:true },.6) return tl;
})
declareAnimation_LEAVE('/about/topartners', function(tl){ tl.to('.top-section__bg_about-partners', .7, { startAt:{ opacity:1 }, opacity:0, force3D:true, ease:Power2.easeIn, immediateRender:true },0) tl.to('.about-page__title_about-partners', .5, { startAt:{ y:0, opacity:1 }, y:20, opacity:0, force3D:true, ease:Power2.easeIn, immediateRender:true },0) return tl;
})
declareAnimation_ENTER('/about/contacts', function(tl){ TweenMax.set('.contact-page', { opacity : 0}); tl.to('contacts-map__container', .5, { startAt:{ scale:1.1 }, scale:1, force3D:true, immediateRender:true },1) tl.to('.contact-page', .5, { startAt:{ y:5, opacity:0 }, y:0, opacity:1, force3D:true, immediateRender:true },1) return tl;
})
declareAnimation_LEAVE('/about/contacts', function(tl){ tl.to('.contacts-map', .3, { startAt:{ opacity:1 }, opacity:0, force3D:true },0) tl.to('.contact-page', .3, { startAt:{ y:0, opacity:1 }, y:10, opacity:0, force3D:true, ease:Power2.easeIn },0) return tl;
})
declareAnimation_ENTER('/contacts', function(tl){ TweenMax.set('.contact-page', { opacity : 0}); tl.to('contacts-map__container', .5, { startAt:{ scale:1.1 }, scale:1, force3D:true, immediateRender:true },1) tl.to('.contact-page', .5, { startAt:{ y:5, opacity:0 }, y:0, opacity:1, force3D:true, immediateRender:true },1) return tl;
})
declareAnimation_LEAVE('/contacts', function(tl){ tl.to('.contacts-map', .3, { startAt:{ opacity:1 }, opacity:0, force3D:true },0) tl.to('.contact-page', .3, { startAt:{ y:0, opacity:1 }, y:10, opacity:0, force3D:true, ease:Power2.easeIn },0) return tl;
})
declareAnimation_ENTER('/', function(tl){ fastdom.defer(60, function(){ window.line.impulse(2,0.15) }) tl.to('.top-section__bg_index', 2, { startAt:{ opacity:0 }, opacity:1, ease:Power2.easeOut, immediateRender:true, force3D:true }, 0) tl.to('.main-page__group-btn', .4, { startAt:{ y:-10, opacity:0 }, y:0, opacity:1, ease:Power2.easeOut, immediateRender:true, force3D:true }, 1) tl.to('.main-page__question', .45, { startAt:{ y:-15, opacity:0 }, y:0, opacity:1, ease:Power2.easeOut, immediateRender:true, force3D:true }, 1.1) tl.to('.main-page__greeting', .5, { startAt:{ y:-20, opacity:0 }, y:0, opacity:1, ease:Power2.easeOut, immediateRender:true, force3D:true }, 1.2) tl.to('.main-page__button-help', .5, { startAt:{ y:-25, opacity:0 }, y:0, opacity:1, ease:Power2.easeOut, immediateRender:true, force3D:true }, 1.2) return tl;
})
declareAnimation_LEAVE('/', function(tl){ tl.to('.top-section__bg_index', 1, { startAt:{ opacity:1 }, opacity:0, ease:Power2.easeIn, force3D:true }, 0) tl.to('.main-page__group-btn', .4, { startAt:{ y:0, opacity:1 }, y:20, ease:Power2.easeIn, opacity:0, force3D:true }, 0) tl.to('.main-page__question', .45, { startAt:{ y:0, opacity:1 }, y:15, ease:Power2.easeIn, opacity:0, force3D:true }, .1) tl.to('.main-page__greeting', .5, { startAt:{ y:0, opacity:1 }, y:10, ease:Power2.easeIn, opacity:0, force3D:true }, .2) tl.to('.main-page__button-help', .5, { startAt:{ y:0, opacity:1 }, y:10, opacity:0, ease:Power2.easeOut, immediateRender:true, force3D:true }, .2) return tl;
})
declareAnimation_ENTER('/camera', function(tl){ tl.to('.top-section__bg_internet-business-cctv', 2, { startAt:{ scale:1.03 }, scale:1, force3D:true, ease:Power2.easeOut, immediateRender:true },0) tl.to('.internet-page__title_business-cctv', .5, { startAt:{ y:20, opacity:0 }, y:0, opacity:1, force3D:true, ease:Power2.easeOut, immediateRender:true },.6) tl.to('.internet-page__subtitle', .5, { startAt:{ y:20, opacity:0 }, y:0, opacity:1, force3D:true, ease:Power2.easeOut, immediateRender:true },.6) tl.to('.internet-page_business-cctv .button_top-home', .9, { startAt:{opacity:0, x:-20 }, opacity:1, x:0, force3D:true, immediateRender:true, ease:Power2.easeOut },1.3) tl.to('.header-controls__control_lang_en', .5, { startAt:{ opacity:1 }, opacity:0, force3D:true, ease:Power2.easeOut, immediateRender:true },0) return tl;
})
declareAnimation_LEAVE('/camera', function(tl){ tl.to('.top-section__bg_internet-business-cctv', .7, { startAt:{ opacity:1 }, opacity:0, force3D:true, ease:Power2.easeIn, immediateRender:true },0) tl.to('.internet-page__title_business-cctv', .5, { startAt:{ y:0, opacity:1 }, y:20, opacity:0, force3D:true, ease:Power2.easeIn, immediateRender:true },0) tl.to('.internet-page__subtitle', .5, { startAt:{ y:0, opacity:1 }, y:20, opacity:0, force3D:true, ease:Power2.easeIn, immediateRender:true },0) tl.to('.internet-page_business-cctv .button_top-home', .5, { startAt:{opacity:1, x:0 }, opacity:0, x:20, force3D:true, immediateRender:true, ease:Power2.easeOut },0) tl.to('.header-controls__control_lang_en', .5, { startAt:{ opacity:0 }, opacity:1, force3D:true, ease:Power2.easeOut, immediateRender:true },0) return tl;
})
declareAnimation_ENTER('/pbx', function(tl){ tl.to('.top-section__bg_atc', 2, { startAt:{ scale:1.03 }, scale:1, force3D:true, ease:Power2.easeOut, immediateRender:true },0) tl.to('.internet-page__title_business-cctv', .5, { startAt:{ y:20, opacity:0 }, y:0, opacity:1, force3D:true, ease:Power2.easeOut, immediateRender:true },.6) tl.to('.internet-page__subtitle', .5, { startAt:{ y:20, opacity:0 }, y:0, opacity:1, force3D:true, ease:Power2.easeOut, immediateRender:true },.6) tl.to('.internet-page_business-cctv .button_top-home', .9, { startAt:{opacity:0, x:-20 }, opacity:1, x:0, force3D:true, immediateRender:true, ease:Power2.easeOut },1.3) tl.to('.header-controls__control_lang_en', .5, { startAt:{ opacity:1 }, opacity:0, force3D:true, ease:Power2.easeOut, immediateRender:true },0) return tl;
})
declareAnimation_LEAVE('/pbx', function(tl){ tl.to('.top-section__bg_atc', .7, { startAt:{ opacity:1 }, opacity:0, force3D:true, ease:Power2.easeIn, immediateRender:true },0) tl.to('.internet-page__title_business-cctv', .5, { startAt:{ y:0, opacity:1 }, y:20, opacity:0, force3D:true, ease:Power2.easeIn, immediateRender:true },0) tl.to('.internet-page__subtitle', .5, { startAt:{ y:0, opacity:1 }, y:20, opacity:0, force3D:true, ease:Power2.easeIn, immediateRender:true },0) tl.to('.internet-page_business-cctv .button_top-home', .5, { startAt:{opacity:1, x:0 }, opacity:0, x:20, force3D:true, immediateRender:true, ease:Power2.easeOut },0) tl.to('.header-controls__control_lang_en', .5, { startAt:{ opacity:0 }, opacity:1, force3D:true, ease:Power2.easeOut, immediateRender:true },0) return tl;
})
var routing = { prev : null, current : null, parsePathname : function(){ }, checkPage : function(){ routing.current = document.location.pathname.replace(/^\/en/,''); }, initPage : function(){ this.checkPage(); var path = this.current; mainLinks = $('.header-menu__link'), secondaryLinks = $('.secondary-nav__link'); mainLinks.removeClass('active'); if( path.indexOf('about') != -1 ){ mainLinks.eq(2).addClass('active'); } if(path == '/') return $.each(mainLinks, function(i,e){ var link = $(e).prop('href'); if( link.indexOf(path) != -1){ $(e).addClass('active'); } }); $.each(secondaryLinks, function(i,e){ var link = $(e).prop('href'); if( link.indexOf(path) != -1){ $(e).addClass('active'); } }); }
};
routing.initPage();
window.throttlingTO = 500;
function initApplication() { handlePopups(); initPopups(); selectForTouch(); if(document.location.pathname.indexOf('/en/') !== -1) { $('body').addClass('en'); } $('[href="'+document.location.pathname+'"]').addClass('active');
}
function handlePopups(){ $(document).on('click', '[data-popup]', function(){ var self = $(this); var popupName = self.data('popup'); var el = $('<div></div>'), popup = openPopup(el, 'connection-popup'); Load(el, popupName, function(){ $('.popup .playout').addClass('loaded'); popup.syncSize(); }); return popup; });
}
function selectForTouch(){ if(_isTouch){ $(document).on('click', '.customSelect', function(){ var self = $(this); self.find('select').css({ "position" : "absolute", "left" : "-5000px" }).show(); self.find('select').focus(); }); }
}
function phonePopup(){ console.log('PHONE POPUP'); var el = $('<div></div>'), popup = openPopup(el, 'phonePopup'); Load(el, 'popupsPhone', function(){ var city = ip2location, phoneNumber = $('.phone-popup__phone-number'), phoneLink = $('.phone-popup__phone-link'), selectbox = $('.selectbox_phone'), optionsElems = selectbox.find('option'); var options = {}; optionsElems.each(function(i, e){ var el = $(e), val = $(e).val(); options[val] = { 'phone': el.data('phone'), 'tel': el.data('tel'), 'email': el.data('email') }; }); $('.popup .playout').addClass('loaded'); popup.syncSize(); initModules(); if(getIEversion() && getIEversion()<=9){ $('input,textarea').placeholder(); } $('.phone-form__button').addClass('phone-form__button_disable'); $("#phoneNumber").mask("9 (999) 999-9999", { completed : function(){ $("#phoneNumber").addClass('valid'); } }); var sb = new SelectBox({ selectbox: selectbox, customScrollbar: true, width : 300, height : 285, scrollOptions : { verticalDragMaxHeight : 42, showArrows: true }, changeCallback: function(value) { city = value; replacePhone(value); } }); sb.jumpToValue(ip2location); replacePhone(ip2location); $('.phone-form input').on('keyup', function(){ validate(); }); function replacePhone(city){ phoneNumber.text(options[city].phone).attr('href', 'tel:' +options[city].tel); phoneLink.text(options[city].email).attr('href', 'mailto:' +options[city].email); } function validate(){ var name = $('#phoneName').val(), number = $('#phoneNumber').val(); if( name !== '' && number !== '' && $('#phoneNumber').hasClass('valid')){ $('.phone-form__button').removeClass('phone-form__button_disable'); } else{ $('.phone-form__button').addClass('phone-form__button_disable'); } } $('.phone-form__button').on('click', function(){ var self = $(this); if( self.hasClass('phone-form__button_disable') ) return; function submitForm(){ $.post(API_URL+'/forms/phone/process.php', { city : city, name : $('#phoneName').val(), phone : $('#phoneNumber').val() }, function(){ $('.phone-form').hide(); $('.phone-succes').show(); if (/^\/pbx/.test(document.location.pathname)) { setTimeout("ga('send', 'event', 'callme_pbx', 'callme_pbx')",300); setTimeout("yaCounter28555973.reachGoal('callme_pbx')",600); } if (/^\/camera/.test(document.location.pathname)) { setTimeout("ga('send', 'event', 'callme_camera', 'callme_camera')",300); setTimeout("yaCounter28555973.reachGoal('callme_camera')",600); } }); } submitForm(); }); }); return popup;
}
function initPopups(){ $(document).on('click', '[data-offerPopup]', function(){ specialOfferPopup($(this).data('offerpopup')); }); $(document).on('click', '[data-committeepopup]', function(){ committeePopup($(this).data('committeepopup')); }); $(document).on('click', '[data-phonePopup]', function(){ phonePopup(); }); $(document).on('click', '[data-teamPopup]', function(){ teamPopup($(this).data('teampopup')); });
}
function committeePopup(commitet) { var el = $('<div></div>'), popup = openPopup(el, 'committee-popup'); Load(el, commitet, function(){ $('.popup .playout').addClass('loaded'); popup.syncSize(); }); return popup;
}
function teamPopup(person) { var el = $('<div></div>'), popup = openPopup(el, 'teamPopup'); Load(el, person, function(){ $('.popup .playout').addClass('loaded'); popup.syncSize(); }); return popup;
}
function specialOfferPopup(offer) { var el = $('<div></div>'), popup = openPopup(el, 'offer-popup'); Load(el, offer, function(){ $('.popup .playout').addClass('loaded'); popup.syncSize(); }); return popup;
}
function specialOfferPopup(offer) { var el = $('<div></div>'), popup = openPopup(el, 'offer-popup'); Load(el, offer, function(){ $('.popup .playout').addClass('loaded'); popup.syncSize(); }); return popup;
}
function checkConnectionPopup() { var el = $('<div></div>'), popup = openPopup(el, 'connection-popup'); Load(el, 'checkConnection', function(){ $('.popup .playout').addClass('loaded'); popup.syncSize(); }); return popup;
}
if( (getIEversion() && getIEversion()>9) || ( Pjax.isSupported && Pjax.isSupported() ) ){ var prevAddress = document.location.pathname.replace(/^\/en/,''); var oldElements = []; var mainPjax = new Pjax({ elements: 'a[data-pjax], .list-services a[href^="/"]', scrollTop : false, selectors: ['title', '.top-section__container_el', '.content__inner', '.top-section__container_bg'], switches : { ".top-section__container_bg" : function(oldEl, newEl, options){ $(window).trigger('addresschange'); var nextAddress = document.location.pathname.replace(/^\/en/,''); if (prevAddress == nextAddress) return; console.log(prevAddress,' > ',nextAddress) var oldE = $(oldEl); var oldElems = oldE.find('>'); var newE = oldE.prepend($(newEl).html()); oldElements.push(oldElems) layoutConfigurator.timeline(prevAddress, nextAddress); animationsConfigurator.animate(prevAddress, nextAddress, function(){ $.each(oldElements, function(i, e){ var element = $(e); modules.require(['i-bem__dom'], function(BEMDOM){ BEMDOM.destruct(element); }); }); oldElements = []; }); prevAddress = nextAddress; }, '.top-section__container_el' : function(oldEl, newEl, options){ var nextAddress = document.location.pathname.replace(/^\/en/,''); if (prevAddress == nextAddress) return; var oldE = $(oldEl); var oldElems = oldE.find('>'); var newE = oldE.append($(newEl).html()); oldElements.push(oldElems) }, '.content__inner' : function(oldEl, newEl, options){ var nextAddress = document.location.pathname.replace(/^\/en/,''); if (prevAddress == nextAddress) return; var oldE = $(oldEl); oldEl.outerHTML = newEl.outerHTML; oldElements.push(oldE); } } }); $(document).on('pjax:success', function(){ initModules(); modules.require(['retinaUtils'], function(retinaUtils){ if(retinaUtils.isRetina) retinaUtils.replaceSrc(); }); modules.require(['i-bem__dom_init', 'next-tick'], function(init, nextTick) { nextTick(init); }); line.stop(2.5,0.4); }); $(document).on('pjax:complete', function(){ routing.initPage(); setTimeout(function(){ mainPjax.refresh(); }, 1000); // for relink on pjax load });
}
//Обертка для старых браузеров без поддержки PJAX
function relocation(link, cb){ if( (getIEversion() && getIEversion()>9) || ( Pjax.isSupported && Pjax.isSupported() ) ){ Pjax.trigger( $("[href='"+link+"']").get(0), 'click') if( $.isFunction(cb) ){ cb(); } } else{ if( $.isFunction(cb) ){ cb(); } setTimeout(function(){ location.href = link; },1000); }
}
__modules['mainButtons'] = function(module){ function mainButtons(){ $("[data-hover='main-button']") .mouseover(function(){ var self = $(this), tl = self.data('timeline-hover'); tl.play(); }) .mouseout(function(){ var self = $(this); self.data('timeline-hover').reverse(); }) $("[data-hover='main-button']").each(function(item,elem){ var self = $(elem), scale; if(self.hasClass('scaleRight')){ scale = "right"; } else{ scale = "left" } self.data('timeline-hover', initHover(self,scale)); }); function initHover(self,scale) { var tl = new TimelineMax(), hover = self.find('.button__hover'), arrowHover = self.find('.button__arrow_hover'), originX; tl.timeScale(10); tl.stop(); if(self.data('visual') == "hover"){ var visual = $("[data-visual='active']"); tl.to(visual, 3.5, { startAt:{ opacity:0 }, opacity : 1, force3D: true, immediateRender:true, ease:Power2.easeInOut }, 0); } tl.to(hover, 3.5, { startAt:{ opacity:0}, opacity : 1, scaleX:1, force3D: true, immediateRender:true, ease:Power2.easeInOut }, 0); tl.to(arrowHover, 3.5, { startAt:{ opacity:0}, opacity:1, force3D: true, immediateRender:true, ease:Power2.easeInOut }, 0); return tl; } } mainButtons();
}
var flag = false;
var preload = function(){ var preloadLine = $('.preloadLine'), number = $('.preloadLine__number'), tl = new TimelineMax({onUpdate:updateStats, onComplete : function(){ animation['onPageLoaded'](); }}); tl.stop(); tl.to(preloadLine, 0.5, { startAt:{ opacity :0}, opacity :1, force3D: true, immediateRender:true, ease:Power2.ease }); tl.to(preloadLine, 2, { startAt:{ css : {width: "0%"}}, css : {width: "100%"}, force3D: true, immediateRender:true, ease:Power2.ease }, 0); return tl; function updateStats(){ var tlBackground = tlBackground || new TimelineMax(); var num = tl.progress().toFixed(2)*100; number.text(Math.round(num)); if(Math.round(num) == 85){ TweenMax.to($('.preloadLine__number'),0.3, { startAt:{ opacity :1}, opacity :0, force3D: true, immediateRender:true, ease:Power2.ease }); } if((Math.round(num) >= 100) && (flag == false) ){ flag = true; tlBackground.stop(); tlBackground.to( $('.main'), 2, { startAt:{ opacity :0}, opacity :1, force3D: true, immediateRender:true, ease:Power2.ease }); tlBackground.play(); } }
}
__modules['oscillation'] = function(module){ //getViewport().width Из за небольших отступов по бокам var SW = new SiriWave({ container: module.get(0), width: getViewport().width+10, height: 140, color: 'ed1c24', frequency: 2, speed: 0.07, amplitude: .01, autostart: true }); // dirty resize $(window).resize(_.throttle(function(){ SW.width = (getViewport().width+10)*SW.ratio; SW.canvas.width = (getViewport().width+10)*SW.ratio; SW.canvas.style.width = (getViewport().width+10)*SW.ratio + 'px'; SW.width_2 = SW.width / 2; SW.width_4 = SW.width / 4; SW._clear(); },80)); function impulse(impulse, factor) { factor = factor || 1; impulse = impulse || 3; TweenMax.to(SW, .15, { amplitude: .1*impulse*1.2, frequency:2+(impulse/2), ease:Power2.easeOut, onComplete:function(){ TweenMax.to(SW, (.15+(impulse/80))/factor, { amplitude:.0001, frequency:2, ease:Power2.easeIn }); } }) } function set(impulse) { impulse = impulse || 3; TweenMax.to(SW, .3, { amplitude: .1*impulse, frequency:2+(impulse/3), ease:Power2.easeOut }) } function impulseFrequency(impulse) { impulse = impulse || 3; TweenMax.to(SW, .3, { frequency:2+(impulse/3), ease:Power2.easeOut, onComplete:function(){ TweenMax.to(SW, .2+(impulse/50), { frequency:2, ease:Power2.easeIn }); } }) } function setFrequency(impulse) { impulse = impulse || 3; TweenMax.to(SW, .3, { frequency:2+(impulse/3), ease:Power2.easeOut }); } function setAmplitude(impulse) { TweenMax.to(SW, .3, { amplitude:impulse, ease:Power2.easeOut }); } function impulseSpeed(impulse) { impulse = impulse || 3; TweenMax.to(SW, .3, { speed:0.1+(impulse/30), ease:Power2.easeOut, onComplete:function(){ TweenMax.to(SW, .2+(impulse/50), { speed:0.1, ease:Power2.easeIn }); } }) } function setSpeed(impulse) { impulse = impulse || 3; TweenMax.to(SW, .3, { frequency:0.1+(impulse/30), ease:Power2.easeOut }); } function stop(impulse, factor){ factor = factor || 1; impulse = impulse || 3; TweenMax.to(SW, 0, { amplitude: .1*impulse*1.2, frequency:2+(impulse/2), ease:Power2.easeOut, onComplete:function(){ TweenMax.to(SW, 0, { amplitude:.0001, frequency:2, ease:Power2.easeIn }); } }) } window.line = { setAmplitude : setSpeed, set : set, impulse : impulse, setFrequency : setFrequency, impulseFrequency : impulseFrequency, setSpeed : setSpeed, impulseSpeed : impulseSpeed, stop : stop } $('body').on('mouseenter','.button',function(){ set(2.5) }) $('body').on('mouseleave','.button',function(){ impulse(2.5,0.4) })
};
__modules['mainButtonHelp'] = function(module){ var tl = new TimelineMax(); tl.stop(); tl.to(".main-page__border-button", 0.3, {left:"0", top:"0", bottom:"0", width:"100%", height:"100%", backgroundColor:"#fff", ease:Power0.easeOut}, 0); tl.to(".main-page__text-button", 0.3, {color:"#000"}, 0.2); tl.to(".main-page__icon-button", 0.3, {startAt:{autoAlpha: 1}, autoAlpha: 0, immediateRender: true, ease:Power0.easeOut}, 0.2); tl.to(".main-page__icon-button-hover", 0.3, {startAt:{autoAlpha: 0}, autoAlpha: 1, immediateRender: true, ease:Power0.easeOut}, 0.2); module.mouseover(function(){ tl.play(); }) module.mouseleave(function(){ tl.reverse(); })
};
__modules['virginCompany'] = function(module){ $.removeCookie('virginCompany', { path: '/' }); return; if( $.cookie('virginCompany') == 'collapse'){ module.hide(); } module.find('.virgin-company__cross').click(function(){ var block = $(this).closest('.virgin-company'); layout = $('.virgin-company .layout'); layout.css({ 'visibility' : 'hidden' }); $('.virgin-company__cross').css({ 'visibility' : 'hidden' }); TweenMax.to(block, 0.5, { height : 0, force3D:true, immediateRender:true, ease:Power3.easeOut}); $.cookie('virginCompany', 'collapse', { expires: 365, path: '/' }); });
}
__modules['cctv-whatyouneed'] = function(module){ module.find('.internet-business-cctv-whatyouneed__openbutton').click(function(){ module.find('.internet-business-cctv-whatyouneed__comparison').addClass('active') module.find('.internet-business-cctv-whatyouneed__closebutton').addClass('active') $(this).removeClass('active') }) module.find('.internet-business-cctv-whatyouneed__closebutton').click(function(){ module.find('.internet-business-cctv-whatyouneed__comparison').removeClass('active') module.find('.internet-business-cctv-whatyouneed__openbutton').addClass('active') $(this).removeClass('active') var moduletop = module.offset().top $('body,html').animate({scrollTop:moduletop-80}, '500') })
}
__modules['cctv-settings'] = function(module){ module.find('.internet-business-cctv-settings__tabmenubutton').click(function(){ if ($(this).hasClass('active')) return; var tab = $(this).attr('rel') module.find('.internet-business-cctv-settings__tabmenubutton').removeClass('active') module.find('.internet-business-cctv-settings__tabmenubutton[rel="'+tab+'"]').addClass('active') module.find('.internet-business-cctv-settings__settingstab').removeClass('active') module.find('.internet-business-cctv-settings__settingstab[rel="'+tab+'"]').addClass('active') })
}
__modules['cctv-whatcontainer'] = function(module){ if(!_isSafari && !_isIE9){ CSSPlugin.defaultTransformPerspective = 1000; function initHover(self){ var frontCard = self.children(".internet-business-cctv-whatyouneed__whatfront"), backCard = self.children(".internet-business-cctv-whatyouneed__whatback"), tl = new TimelineMax({paused:true}); tl .to(frontCard, 0.5, {startAt: { rotationY:0 }, rotationY:180, force3D: true, immediateRender:true, ease:Power2.ease}) .to(backCard, 0.5, {startAt: { rotationY:-180}, rotationY:0, force3D: true, immediateRender:true, ease:Power2.ease},0) return tl; } $(".internet-business-cctv-whatyouneed__what") .mouseenter(function(){ var tl = $(this).data('timeline-hover'); if (!tl) $(this).data('timeline-hover', tl = initHover($(this))) tl.play(); }) .mouseleave(function(){ $(this).data('timeline-hover').reverse(); }) } else{ module.find(".internet-business-cctv-whatyouneed__whatback").hide(); $(".internet-business-cctv-whatyouneed__what") .mouseenter(function(){ $(this).find('.internet-business-cctv-whatyouneed__whatback').show(); $(this).find('.internet-business-cctv-whatyouneed__whatfront').hide(); }) .mouseleave(function(){ $(this).find('.internet-business-cctv-whatyouneed__whatfront').show(); $(this).find('.internet-business-cctv-whatyouneed__whatback').hide(); }) }
}
__modules['pbx-settings'] = function(module){ module.find('.pbx-settings__tabmenubutton').click(function(){ if ($(this).hasClass('active')) { return; } var tab = $(this).attr('rel'); module.find('.pbx-settings__tabmenubutton').removeClass('active'); module.find('.pbx-settings__tabmenubutton[rel="'+tab+'"]').addClass('active'); module.find('.pbx-settings__settingstab').removeClass('active'); module.find('.pbx-settings__settingstab[rel="'+tab+'"]').addClass('active'); });
};
__modules['pbx-tasks'] = function(module){ module.find('.pbx-tasks__boxopenbutton').click(function(){ module.find('.pbx-tasks__box').removeClass('open'); $(this).parent().addClass('open'); }); module.find('.pbx-tasks__boxclosebutton').click(function(){ $(this).parent().removeClass('open'); }); function initHover(self){ var frontCard = self.children(".pbx-tasks__taskfront"), backCard = self.children(".pbx-tasks__taskback"), tl = new TimelineMax(); tl.to(frontCard, 0.5, {startAt: { rotationY:0 }, rotationY:180, force3D:true, immediateRender:true, ease:Power2.ease }); tl.to(backCard, 0.5, {startAt: { rotationY:-180}, rotationY:0, force3D:true, immediateRender:true, ease:Power2.ease },0); tl.stop(); return tl; } if (!window._isSafari && !window._isIE9) { CSSPlugin.defaultTransformPerspective = 1000; $(".pbx-tasks__task") .each(function(){ $(this).data('timeline-hover', initHover($(this))); }) .mouseenter(function(){ $(this).data('timeline-hover').play(); }) .mouseleave(function(){ $(this).data('timeline-hover').reverse(); }); } else { module.find(".pbx-tasks__taskback").hide(); $(".values__item") .mouseenter(function(){ $(this).find('.pbx-tasks__taskback').show(); $(this).find('.pbx-tasks__taskfront').hide(); }) .mouseleave(function(){ $(this).find('.pbx-tasks__taskfront').show(); $(this).find('.pbx-tasks__taskback').hide(); }); }
};
__modules['pbx-rates'] = function(module){ module.find('.pbx-rates__servicecontainerbutton').click(function(){ $(this).removeClass('active') if ($(this).attr('rel')=="open") { module.find('.pbx-rates__servicecontainerbutton[rel="close"]').addClass('active') module.find('.pbx-rates__serviceopencontainer').addClass('active') } else { module.find('.pbx-rates__servicecontainerbutton[rel="open"]').addClass('active') module.find('.pbx-rates__serviceopencontainer').removeClass('active') } $('body,html').animate({scrollTop:module.find('.pbx-rates__servicecontainerbutton.active').offset().top-130}, '500') });
};
__modules['aboutInfo'] = function(module){ var menu = module.find('.about-tabs-menu'), tabs = module.find('.about-info__tab'); menu.on('click', '.about-tabs-menu__item', function(e){ var self = $(this), eq = self.prevAll().length; self.addClass('about-tabs-menu__item_active'); if( tabs.eq(eq).find('.partners-chart-staff').length ){ tabs.eq(eq).find('.partners-chart-staff').data('tl').play(); } self.siblings().removeClass('about-tabs-menu__item_active'); tabs.removeClass('about-info__tab_active'); tabs.eq(eq).addClass('about-info__tab_active'); });
}
__modules['partnersChartStaff'] = function(module){ var pointsWrapper = module.find('.partners-chart-staff__points-wrapper'), logo = module.find('.partners-chart-staff__logo'), staff = module.find('.partners-chart-staff__staff'), tl = new TimelineMax(); tl.to(pointsWrapper, 0.5, {startAt:{ css : { width : 0} }, css : { width : "32.2%"}, immediateRender:true, force3D:true, ease:Power3.easeOut}) tl.to(logo, 0.5, {startAt:{ opacity : 0, transformOrigin : '50% 100%', scale : 0 }, opacity:1, scale : 1, immediateRender:true, force3D:true, ease:Power3.easeOut}); tl.to(pointsWrapper, 1.5, {startAt:{ css : { width : "32.2%" } }, css : { width : "100%"}, immediateRender:false, force3D:true, ease:Power3.easeOut}) tl.to(staff, 0.5, {startAt:{ opacity : 0, transformOrigin : '50% 50%', scale : 0 }, opacity:1, scale : 1, immediateRender:true, force3D:true, ease:Power3.easeOut}, "+1.5"); tl.stop(); module.data('tl', tl);
}
__modules['partnersChartRegional'] = function(module){ var pointsWrapper = module.find('.partners-chart-regional__points-wrapper'), logo = module.find('.partners-chart-regional__logo'), staff = module.find('.partners-chart-regional__regional'), tl = new TimelineMax(); tl.to(pointsWrapper, 0.5, {startAt:{ css : { width : 0} }, css : { width : "31.7%"}, immediateRender:true, force3D:true, ease:Power3.easeOut}) tl.to(logo, 0.5, {startAt:{ opacity : 0, transformOrigin : '50% 100%', scale : 0 }, opacity:1, scale : 1, immediateRender:true, force3D:true, ease:Power3.easeOut}); tl.to(pointsWrapper, 1.5, {startAt:{ css : { width : "31.7%" } }, css : { width : "100%"}, immediateRender:false, force3D:true, ease:Power3.easeOut}) tl.to(staff, 0.5, {startAt:{ opacity : 0, transformOrigin : '50% 50%', scale : 0 }, opacity:1, scale : 1, immediateRender:true, force3D:true, ease:Power3.easeOut}, "+1.5"); var scene = new ScrollScene({ triggerElement: module, reverse : false }) .setTween(tl) .addTo(scrollMagicController);
}
__modules['values'] = function(module){ if(!_isSafari && !_isIE9){ CSSPlugin.defaultTransformPerspective = 1000; function initHover(self){ var frontCard = self.children(".values__front"), backCard = self.children(".values__back"), tl = new TimelineMax({paused:true}); tl .to(frontCard, 0.5, {startAt: { rotationY:0 }, rotationY:180, force3D: true, immediateRender:true, ease:Power2.ease}) .to(backCard, 0.5, {startAt: { rotationY:-180}, rotationY:0, force3D: true, immediateRender:true, ease:Power2.ease},0); return tl; } $(".values__item") .mouseenter(function(){ var tl = $(this).data('timeline-hover'); if (!tl) { $(this).data('timeline-hover', tl = initHover($(this))); } tl.play(); }) .mouseleave(function(){ $(this).data('timeline-hover').reverse(); }); } else{ module.find(".values__back").hide(); $(".values__item") .mouseenter(function(){ $(this).find('.values__back').show(); $(this).find('.values__front').hide(); }) .mouseleave(function(){ $(this).find('.values__front').show(); $(this).find('.values__back').hide(); }); }
};
__modules['accept-link'] = function(module){ module.click(function(){ if($('.popup').length){ $('.popup').remove(); $(window).unbind('.popup'); } var self = $(this); var el = $('<div></div>'), popup = openPopup(el, 'acceptPopup'); Load(el, 'popupsaccept', function(){ $('.popup .playout').addClass('loaded'); popup.syncSize(); }); return popup; });
};
__modules['body'] = function(module){ window.scrollMagicController = new ScrollMagic();
};
__modules['businessForm'] = function(module){ var form; var submitBtn = $('.form__submit'); var checkboxValues; $("#phone").mask("9 (999) 999-9999"); submitBtn.addClass('form__submit_disable'); function submitForm(){ $.post(API_URL+'/forms/business/process.php', { company : $('#company').val(), lastname : $('#lastname').val(), phone : $('#phone').val(), name : $('#name').val(), email : $('#email').val(), region : $('#region').val(), city : $('#city').val(), address : $('#address').val(), services : checkboxValues, price : Math.round( $('.range-slider__elem').val() ), ip2locationB2B: window.ip2locationB2B }, function(){ if(document.location.pathname.indexOf('/en/') != -1){ relocation('/en/internet/business/', function(){ thankPopup(); }); } else{ relocation('/internet/business/', function(){ thankPopup(); }); } }) } $(submitBtn).on('click', function(){ if(submitBtn.hasClass('form__submit_disable') ){ return; } else{ var errorMessages = { company: { required: "Это поле обязательно для заполнения" }, email : { required: "Это поле обязательно для заполнения", email: "Не валидный email" }, name : { required: "Это поле обязательно для заполнения", lettersonly : "Имя не должно содержать цифры и символы" }, lastname : { required: "Это поле обязательно для заполнения", lettersonly : "Фамилия не должнa содержать цифры и символы" }, region : { required: "Это поле обязательно для заполнения" }, city : { required: "Это поле обязательно для заполнения" }, address : { required: "Это поле обязательно для заполнения" } } form = $('#businessForm').validate({ rules: { company: { required : true }, lastname : { required : true, lettersonly : true }, name : { required : true, lettersonly : true }, email : { email : true, required : true }, region : { required : true }, city : { required : true }, address : { required : true } }, messages: errorMessages, errorClass: 'input__elem_error', errorElement:'span' }); form.form(); if( $('.input__elem_error:first').length ){ $("html, body").animate({scrollTop: $('.input__elem_error:first').offset().top - 200 }, '500', 'swing', function() { $('.input__elem_error:first').focus(); }); } if( form.valid() ){ submitBtn.addClass('form__submit_disable'); submitForm(); } } }) module.on('change', function(){ checkboxToArray(); validate(); }); module.find('input').on('keyup', function(){ validate(); }); function validate(){ var company = $('#company').val(), lastname = $('#lastname').val(), phone = $('#phone').val(), name = $('#name').val(), email = $('#email').val(), region = $('#region').val(), city = $('#city').val(), address = $('#address').val(); if(company != '' && lastname != '' && phone != '' && name != '' && email != '' && region != '' && city != '' && address != '' && checkboxValues.length > 0 ){ submitBtn.removeClass('form__submit_disable'); } else{ submitBtn.addClass('form__submit_disable'); } } function checkboxToArray(){ checkboxValues = module.find("input:checkbox:checked").map(function(){ return $(this).val(); }).toArray(); console.log(checkboxValues) } $('.form-container__close').click(function(){ if(document.location.pathname.indexOf('/en/') != -1){ relocation('/en/internet/business/'); } else{ relocation('/internet/business/'); } });
}
__modules['camera-form'] = function(module){ var action = module.attr('action') module.find('input').on('keyup', function(){ validate(); }) module.find('input[name="phone"]').mask("9 (999) 999-9999", { completed : function(){ module.find('input[name="phone"]').addClass('valid'); } }); function validate(){ var name = module.find('input[name="name"]').val(), phone = module.find('input[name="phone"]').val(); if( name != '' && phone != '' && module.find('input[name="phone"]').hasClass('valid')){ $('.internet-business-cctv-wanttotry__connectbutton').removeClass('disable') } else{ $('.internet-business-cctv-wanttotry__connectbutton').addClass('disable') } } $('.internet-business-cctv-wanttotry__connectbutton').on('click', function(){ var self = $(this); if( self.hasClass('disable') ) return; function submitForm(){ $.post(API_URL+'/forms/'+action, { city : module.find('select').val(), name : module.find('input[name="name"]').val(), phone : module.find('input[name="phone"]').val() }, function(){ if (action == "pbx/process.php") { setTimeout("ga('send', 'event', 'zaj_pbx', 'zaj_pbx')",300); setTimeout("yaCounter28555973.reachGoal('zaj_pbx')",600); } if (action == "cctv/process.php") { setTimeout("ga('send', 'event', 'zaj_camera', 'zaj_camera')",300); setTimeout("yaCounter28555973.reachGoal('zaj_camera')",600); } module.find('.internet-business-cctv-wanttotry__writesectioncontainer').hide(); module.find('.internet-business-cctv-wanttotry__writesectionsucces').show(); }) } submitForm(); });
};
__modules['cctv-wanttotry'] = function(module){ var sb = new SelectBox({ selectbox: module.find('.selectbox_internet'), customScrollbar: true, width : 300, height : 285, scrollOptions : { verticalDragMaxHeight : 42, showArrows: true }, changeCallback: function(value) { replacePhoneNumber(value); } }); var options = [], phoneElem = $('.contacts-infobox__telephone'), city; module.find('.selectbox_internet option').each(function(i, e){ var el = $(e), val = $(e).val(); options[val] = { 'name' : val, 'phone': el.data('phone'), 'tel': el.data('tel') }; }); function replacePhoneNumber(city){ phoneElem.text(options[city].phone).attr('href', 'tel:'+options[city].tel); } onCityUpdate(function(){ if( options[ip2location] ) { city = options[ip2location].name; } else if(options[ip2locationB2C]){ city = options[ip2locationB2C].name; } else if(options[ip2locationB2B]){ city = options[ip2locationB2B].name; } else{ city = 'moscow'; } sb.jumpToValue(city); });
};
__modules['checkConnection'] = function(module){ module.find('.check-connection__button_default').addClass('check-connection__button_disable'); var index = null; var cities = new Bloodhound({ remote: '/bitrix/templates/furniture_red/components/altasib/kladr.input/beta/ajax_script.php?mode=action&action=C&string=%QUERY', datumTokenizer: Bloodhound.tokenizers.obj.whitespace('text'), queryTokenizer: Bloodhound.tokenizers.whitespace }); cities.initialize(); var streets = new Bloodhound({ remote: { url : '/bitrix/templates/furniture_red/components/altasib/kladr.input/beta/ajax_script.php?string=%QUERY', ajax : { type : 'POST', cache : true, data : { mode : 'action', action : 'S' }, beforeSend:function(jqXHR, settings){ console.log(window.d = settings) settings.data+="&city="+module.find('input[name=city_id]').val(); } } }, datumTokenizer: Bloodhound.tokenizers.obj.whitespace('text'), queryTokenizer: Bloodhound.tokenizers.whitespace }); streets.initialize(); var houses = new Bloodhound({ remote: { url : '/bitrix/templates/furniture_red/components/altasib/kladr.input/beta/ajax_script.php?string=%QUERY', ajax : { type : 'POST', cache : true, data : { mode : 'action', action : 'H' }, beforeSend:function(jqXHR, settings){ settings.data+="&street="+module.find('input[name=street_id]').val(); } } }, datumTokenizer: Bloodhound.tokenizers.obj.whitespace('text'), queryTokenizer: Bloodhound.tokenizers.whitespace }); houses.initialize(); module.find('input[name=city]').typeahead({ highlight : true }, { name: 'cities', valueKey : 'id', displayKey: 'text', source: cities.ttAdapter() }).on('typeahead:selected', function(e, data){ module.find('input[name=city_id]').val(data.id); $(this).data('prev-id', data.id); $(this).data('prev-val', $(this).val()); $(this).data('city-title', data.title); validate(); }).on('typeahead:closed', function(){ if (!module.find('input[name=city_id]').val()) { $(this).val(''); } if ($(this).val() != $(this).data('prev-val') && $(this).data('prev-id') == module.find('input[name=city_id]').val()) { $(this).val($(this).data('prev-val')); } }).on('typeahead:opened', function(){ $(this).data('prev-id', module.find('input[name=city_id]').val()); $(this).data('prev-val', $(this).val()); }); module.find('input[name=street]').typeahead({ highlight : true }, { name: 'streets', displayKey: 'text', source: streets.ttAdapter() }).on('typeahead:selected', function(e, data){ module.find('input[name=street_id]').val(data.id); $(this).data('prev-id', data.id); $(this).data('prev-val', $(this).val()); validate(); }).on('typeahead:closed', function(){ if (!module.find('input[name=street_id]').val()) { $(this).val(''); } if ($(this).val() != $(this).data('prev-val') && $(this).data('prev-id') == module.find('input[name=street_id]').val()) { $(this).val($(this).data('prev-val')); } }).on('typeahead:opened', function(){ $(this).data('prev-id', module.find('input[name=street_id]').val()); $(this).data('prev-val', $(this).val()); }); module.find('input[name=house]').typeahead({ minLength: 0 }, { name: 'houses', displayKey: 'text', source: houses.ttAdapter() }).on('typeahead:selected', function(e, data){ module.find('input[name=house_id]').val(data.id); $(this).data('prev-id', data.id); $(this).data('prev-val', $(this).val()); validate(); }).on('typeahead:closed', function(){ if (!module.find('input[name=house_id]').val()) { $(this).val(''); } if ($(this).val() != $(this).data('prev-val') && $(this).data('prev-id') == module.find('input[name=house_id]').val()) { $(this).val($(this).data('prev-val')); } }).on('typeahead:opened', function(){ $(this).data('prev-id', module.find('input[name=house_id]').val()); $(this).data('prev-val', $(this).val()); }); // Обработчик формы подписки $('.form__box_subscribe .check-connection__button_subscribe').click(function(){ var email = $('#email-subscribe').val(), name = $('#name-subscribe').val(), kladr = module.find('input[name=house_id]').val(); address = module.find('input[name=city]').val() + ' ' + module.find('input[name=street]').val() + ' ' + module.find('input[name=house]').val(); console.log({ email : email, name : name, kladr : kladr, address : address }); if( email !== '' && name !== '' ){ $.post(API_URL+'/forms/home/future.php', { email : email, name : name, kladr : kladr, address : address },function(){ if(document.location.pathname.indexOf('/en/') != -1){ relocation('/en/internet/home/', function(){ thankPopup(); }); } else{ relocation('/internet/home/', function(){ thankPopup(); }); } }); } }); function validate(){ var cityId = $('input[name=city_id]').val(), streetId = $('input[name=street_id]').val(), houseId = $('input[name=house_id]').val(); if( cityId != '' && streetId != '' && houseId != ''){ module.find('.check-connection__button').removeClass('check-connection__button_disable'); } } module.find('.check-connection__button_default').click(function(){ if( $(this).hasClass('check-connection__button_disable') ) return; var data = { city : module.find('input[name=city]').val(), city_id : module.find('input[name=city_id]').val(), street : module.find('input[name=street]').val(), street_id : module.find('input[name=street_id]').val(), house : module.find('input[name=house]').val(), house_id : module.find('input[name=house_id]').val() } module.find('.check-connection__stage').hide(); module.find('.check-connection__stage_inprocess').show(); module.find('.check-connection__button').addClass('.check-connection__button_disable') NP.start() $.ajax({ url : '/ajax/check.php', method : 'POST', data : { FIELD_NAME : data.house_id }, success : function(data){ NP.stop() data = !!parseInt(data); if (data) { $('.form__box_subscribe').hide(); $('.check-connection__button_another').show(); $('.check-connection__button_default').hide(); module.find('.check-connection__item_info').removeClass('check-connection__item_error'); module.find('.check-connection__item_info').addClass('check-connection__item_success'); module.find('.check-connection__stage').hide(); module.find('.check-connection__stage_success').show(); $('.form__box_important').addClass('form__box_success'); $('.form__holder').hide(); LoadTariffsFormb2c($('.radiobuttons'), window.cityCodes[$('input[name=city]').data('city-title')], function(){ initModules(); function initForm() { var activeTariff = location.hash.replace(/#/, ''); if(activeTariff != ''){ $("[data-tariff="+activeTariff+"]").find('.radiobuttons__radio').click(); } else{ $("[data-tariff]:eq(0)").find('.radiobuttons__radio').click(); } } initForm(); }); } else { $('.form__box_important').removeClass('form__box_success'); $('.check-connection__button_another').show(); $('.check-connection__button_default').hide(); module.find('.check-connection__stage').hide(); module.find('.check-connection__stage_error').show(); module.find('.check-connection__button').removeClass('.check-connection__button_disable'); module.find('.check-connection__item_info').removeClass('check-connection__item_success'); module.find('.check-connection__item_info').addClass('check-connection__item_error'); $('.form__box_subscribe').show(); $('.form__holder').show(); } $('.check-connection__button_another').click(function(){ module.find('input').val(""); $('.form__holder').show(); $('.check-connection__button_another').hide(); $('.check-connection__button_default').show(); $('.form__box_subscribe').hide(); module.find('.check-connection__stage').show(); module.find('.check-connection__stage_error').hide(); module.find('.check-connection__stage_success').hide(); module.find('.check-connection__stage_inprocess').hide(); module.find('.check-connection__item_info').removeClass('check-connection__item_error'); module.find('.check-connection__item_info').removeClass('check-connection__item_success'); module.find('.check-connection__button_default').addClass('check-connection__button_disable'); }); } }) })
}
__modules['checkboxes'] = function(module){ module.on('click', '.checkboxes__row', function(){ var self = $(this); if(self.find('input').is(':checked')){ self.find('input').prop('checked','').trigger('change'); } else{ self.find('input').prop('checked','checked').trigger('change'); } }); module.find('input').change(function(){ if ($(this).is(':checked')) $(this).parents('.checkboxes__row').addClass('checkboxes__row_checked') else $(this).parents('.checkboxes__row').removeClass('checkboxes__row_checked') });
};
__modules['header'] = function(module){ module.find("a[data-pjax]").click(function(){ module.find('a[data-pjax].active').removeClass('active'); $('.secondary-nav .secondary-nav__link').removeClass('active'); $(this).addClass('active'); }); //module.find('.header__logo').css('left', 15 + scrollSize()); var logo = module.find('.header__logo'), left = parseInt(logo.css('left')); //logo.css('left', left+scrollSize()); /*var tween = TweenMax.to('.header__bg-scroll', 0.3, { startAt:{ autoAlpha:0 }, autoAlpha:1, immediateRender:true, force3D:true, ease:Power3.easeOut }); */ var tl = new TimelineMax(); tl.to('.header__bg-scroll', 0.3, { startAt:{ autoAlpha:0 }, autoAlpha:1, immediateRender:true, force3D:true, ease:Power3.easeOut },0); tl.to('.header__border', 0.3, { startAt:{ autoAlpha:0 }, autoAlpha:1, immediateRender:true, force3D:true, ease:Power3.easeOut },0); var scene = new ScrollScene({ triggerElement: '.top-section', offset: getViewport().height/8, triggerHook : "onLeave" }) .setTween(tl) .addTo(scrollMagicController) .setClassToggle('.header', 'header_activescroll');
}
__modules['homeForm'] = function(module){ var submitBtn = $('.form__submit'), form; submitBtn.addClass('form__submit_disable'); $("#phone").mask("9 (999) 999-9999"); function submitForm(){ $.post(API_URL+'/forms/home/process.php', { city : $('#city').val(), street : $('#street').val(), house : $('#house').val(), lastname : $('#lastname').val(), phone : $('#phone').val(), name : $('#name').val(), email : $('#email').val(), tariff : $('.radiobuttons__input:checked').val(), price : +$('.form-price__number').text() }, function(){ if(document.location.pathname.indexOf('/en/') != -1){ relocation('/en/internet/home/', function(){ thankPopup(); }); } else{ relocation('/internet/home/', function(){ thankPopup(); }); } }); } $(submitBtn).on('click', function(){ if(submitBtn.hasClass('form__submit_disable') ) return; else{ var errorMessages = { email : { required: "Это поле обязательно для заполнения", email: "Не валидный email" }, name : { required: "Это поле обязательно для заполнения", lettersonly : "Имя не должно содержать цифры и символы" }, lastname : { required: "Это поле обязательно для заполнения", lettersonly : "Фамилия не должнa содержать цифры и символы" } } form = $('#homeForm').validate({ rules: { lastname : { required : true, lettersonly : true }, name : { required : true, lettersonly : true }, email : { email : true, required : true } }, messages: errorMessages, errorClass: 'input__elem_error', errorElement:'span' }); form.form(); if( $('.input__elem_error:first').length ){ $("html, body").animate({scrollTop: $('.input__elem_error:first').offset().top - 200 }, '500', 'swing', function() { $('.input__elem_error:first').focus(); }); } if( form.valid() ){ submitForm(); } } }) module.on('change', function(){ caculateSum(); validate(); }) module.find('input').on('keyup', function(){ caculateSum(); validate(); }) function validate(){ var lastname = $('#lastname').val(), phone = $('#phone').val(), name = $('#name').val(), email = $('#email').val(); function checkRadio(){ var checked = false; $("[name='tariff']").each(function(i,e){ var elem = $(e); if( elem.prop('checked') ){ checked = true; } }); return checked; } if( lastname != '' && phone != '' && name != '' && email != '' && checkRadio()){ submitBtn.removeClass('form__submit_disable'); } else{ submitBtn.addClass('form__submit_disable'); } } function initForm() { var activeTariff = location.hash.replace(/#/, ''); if(activeTariff != ''){ $("[data-tariff="+activeTariff+"]").find('.radiobuttons__radio').click(); } else{ $("[data-tariff]").eq(0).find('.radiobuttons__radio').click(); } } function initActiveCity(){ var param = parseQueryString(), city = param['city']; onCityUpdate(function(){ if(!city){ city = window.ip2locationB2C; } LoadTariffsFormb2c($('.radiobuttons'), city, function(){ initModules(); initForm(); }); }); } function parseQueryString() { var str = window.location.search; var objURL = {}; str.replace( new RegExp( "([^?=&]+)(=([^&]*))?", "g" ), function( $0, $1, $2, $3 ){ objURL[ $1 ] = $3; } ); return objURL; }; function caculateSum() { var internetTariff = module.find('input[name="tariff"]:checked').val(); var internetPrice = +module.find('[data-tariff="'+internetTariff+'"]').data('price'); if (internetPrice) { $('.form-price__number').text(' '+internetPrice+' '); } } fastdom.defer(1, function(){ initForm(); initActiveCity(); }); $('.form-container__close').click(function(){ if(document.location.pathname.indexOf('/en/') != -1){ relocation('/en/internet/home/'); } else{ relocation('/internet/home/'); } });
}
__modules['radiobuttons'] = function(module){ module.on('click', '.radiobuttons__row', function(){ var self = $(this); self.find('input').prop('checked','checked').trigger('change') }); module.find('input').change(function(){ module.find('.radiobuttons__row_checked').removeClass('radiobuttons__row_checked'); if ($(this).prop('checked')) $(this).parents('.radiobuttons__row').addClass('radiobuttons__row_checked') else $(this).parents('.radiobuttons__row').removeClass('radiobuttons__row_checked') });
};
__modules['selectbox'] = function(module){ var sb = new SelectBox({ selectbox: module, customScrollbar: true, width : module.data('size'), height : 285, scrollOptions : { verticalDragMaxHeight : 42, showArrows: true } });
}
__modules['rangeSlider'] = function(module){ var slider = module.find('.range-slider__elem'), out = $('.form-price__number'), defValue = 1000; out.text(defValue + " "); slider.noUiSlider({ start: [defValue], step : 1000, range: { 'min': 1000, 'max': 100000 } }); slider.on('slide', function(){ var val = $(this).val(); val = parseInt(val).toFixed(0); out.text(val+" "); });
};
__modules['selectbox'] = function(module){ var sb = new SelectBox({ selectbox: module, customScrollbar: true, width : module.data('size'), height : 285, scrollOptions : { verticalDragMaxHeight : 42, showArrows: true } });
};
modules.define('cityCodesService', ['i-bem', 'jquery'], function(provide, BEM, $) { provide(BEM.decl(this.name, { onSetMod: { js: { inited: function() { this.url = '/ajax/cityCodes.php'; this.getCityCodesFunc(); } } }, getCityCodesFunc: function() { var d = $.Deferred(), self = this; $.get(self.url).then(function(data) { window.cityCodes = data; d.resolve(data); }); this.getCityCodes = d.promise(); } }, { } ));
});
modules.define('city-codes', ['i-bem', 'cityCodesService'], function(provide, BEM, cityCodesService) { // Для того чтобы cityCodesService инициализировался его надо прокинуть в define. provide(BEM.create('cityCodesService'));
});
modules.require(['city-codes'], function(cityCodes) {
});
modules.define('contacts-map', ['i-bem','i-bem__dom', 'events__channels'], function(provide, BEM, BEMDOM, channels) { provide(BEMDOM.decl(this.name, { onSetMod: { js: { inited: function() { this.initGmaps(); this.loadCities(); channels('global').on('change_selectbox_contacts', this.onChangeCity, this); }, '': function(){ channels('global').un('change_selectbox_contacts', this.onChangeCity, this); } } }, onChangeCity: function(e, data){ this.relocate(data.value); this.loadAndReplace(data.value); }, initGmaps: function() { google.maps.Map.prototype.setCenterWithOffset = function(latlng, offsetX, offsetY) { var map = this; var ov = new google.maps.OverlayView(); ov.onAdd = function() { var proj = this.getProjection(); var aPoint = proj.fromLatLngToContainerPixel(latlng); aPoint.x = aPoint.x+offsetX; aPoint.y = aPoint.y+offsetY; map.setCenter(proj.fromContainerPixelToLatLng(aPoint)); }; ov.draw = function() {}; ov.setMap(this); }; this.map = new GMaps({ div: this.elem('container')[0], lat: 55.799213, lng: 37.5294836, scrollwheel: false, zoom: 15, disableDefaultUI : false }); new google.maps.Marker({ position: new google.maps.LatLng(55.799213,37.5294836), map: this.map.map, icon: new google.maps.MarkerImage('/build/images/contacts-map-pin.png', new google.maps.Size(68, 102), new google.maps.Point(0,0), new google.maps.Point(19, 50)) }); var latlng = new google.maps.LatLng(55.799213,37.5294836); this.map.setCenterWithOffset(latlng, 0, -50); }, loadCities: function() { var self = this, d = $.Deferred(); $.get('/ajax/cities.php').then(function(data){ self.cities = data; self.setAllMArker(data); d.resolve({cities: data}); }); this.__self.getCities = d.promise(); }, setAllMArker: function(cities) { var self = this; $.each(cities, function(i,e){ new google.maps.Marker({ position: new google.maps.LatLng(e.point.lat, e.point.lng), map: self.map.map, icon: new google.maps.MarkerImage('/build/images/contacts-map-pin.png', new google.maps.Size(68, 102), new google.maps.Point(0,0), new google.maps.Point(19, 50)) }); }); }, relocate: function(city) { var cityObj = _.where(this.cities, {city: city})[0], point; point = new google.maps.LatLng(cityObj.point.lat, cityObj.point.lng); this.map.panTo(point); this.map.setCenterWithOffset(point, cityObj.offset.h, cityObj.offset.v); }, loadAndReplace: function (value) { var elem = $('.content__inner'); this.LoadContacts(elem, value , function(){ console.log("loaded view"); }); }, LoadContacts: function(el, action, cb) { $.ajax({ url: preffix()+'/contacts/city/?code='+action, cache : false, success : function(data) { $('.contacts-infobox').remove(); el.prepend(data); if (cb) cb() } }); } }));
});
modules.define('internet-clients', ['i-bem__dom', 'events__channels'], function(provide, BEMDOM, channels){ provide(BEMDOM.decl(this.name, { onSetMod: { js: { inited: function() { channels('global').on('change_selectbox_internet_business', this.onChangeCity, this); }, '': function() { channels('global').un('change_selectbox_internet_business', this.onChangeCity, this); } } }, onChangeCity: function(e, data){ this.loadAndReplace(data.value); }, loadAndReplace: function (city){ var elem = $('.internet-clients__side_region'); this.LoadClientsB2B(elem, city, function(){ }); }, LoadClientsB2B: function(el, action, cb) { $.ajax({ url: preffix()+'/clients/?code='+action, cache : false, success : function(data) { data = $(data); var elements = data.find('.clients-table__row'); var separator = data.find('.clients-table__separator:eq(0)').clone(); var parent = elements.parent(); elements = elements.detach(); var last = elements.pop(); elements = $.shuffle(elements); elements = elements.slice(0,3); elements.push(last); parent.empty().append(elements); el.empty(); el.append(data); elements.each(function(){ if ($(this).next().length) { $(this).after(separator.clone()); } }) if (cb) cb() } }) } }, { }));
});
modules.define('internet-special', ['i-bem__dom', 'events__channels'], function(provide, BEMDOM, channels){ provide(BEMDOM.decl(this.name, { onSetMod: { js: { inited: function() { channels('global').on('change_selectbox_'+this.params.eventName, this.onChangeCity, this); this.sliderbox = this.findBlocksInside('sliderbox')[0]; this.loadOffers(); }, '': function() { channels('global').un('change_selectbox_'+this.params.eventName, this.onChangeCity, this); } } }, onChangeCity: function(e, data){ this.filterOffers(data.value); }, filterOffers: function(city){ var offersByCity = this.offers[city], slides = this.domElem.find('.sliderbox__item'), length = 0; this.sliderbox.destroySliderbox(); slides.each(function(i, e){ var elem = $(e), offer = elem.data('offers')+''; if( _.indexOf(offersByCity, offer) === -1 ){ elem.hide(); elem.attr('slide-enabled', false); } else{ elem.show(); elem.attr('slide-enabled', true); length++; } }); if(length>0){ this.domElem.show(); this.emit('filter', {length: length}); } else if(length==0){ this.domElem.hide(); } }, loadOffers: function() { var self = this, d = $.Deferred(); $.get(self.params.url+'?lang='+getLang()).then(function(data){ self.offers = data; d.resolve({offers: data}); }); this.__self.getOffers = d.promise(); } }, { }));
});
modules.define('ip2locationService', ['i-bem', 'jquery'], function(provide, BEM, $) { provide(BEM.decl(this.name, { onSetMod: { js: { inited: function() { this.url = '/ajax/bx-mycity.php?lang='+getLang(); this.getMyCityFunc(); } } }, getMyCityFunc: function() { var d = $.Deferred(), self = this; $.get(self.url).then(function(data) { var ip2location, ip2locationCity, ip2locationB2B, ip2locationCityB2B, ip2locationB2C, ip2locationCityB2C; // Ближайщий город из общего списка window.ip2location = data.common.CODE; window.ip2locationCity = data.common.NAME; ip2location = data.common.CODE; ip2locationCity = data.common.NAME; // Ближайщий город из списка b2b window.ip2locationB2B = data.b2b.CODE; window.ip2locationCityB2B = data.b2b.NAME; ip2locationB2B = data.b2b.CODE; ip2locationCityB2B = data.b2b.NAME; // Ближайщий город из списка b2c window.ip2locationB2C = data.b2c.CODE; window.ip2locationCityB2C = data.b2c.NAME; ip2locationB2C = data.b2c.CODE; ip2locationCityB2C = data.b2c.NAME; $.each(_onCityUpdateFns, function(){ this(); }); window.onCityUpdate = function(fn){ fn(); }; // Для старых модулей оставил функциональность d.resolve({ ip2location: ip2location, ip2locationCity: ip2locationCity, ip2locationB2B: ip2locationB2B, ip2locationCityB2B: ip2locationCityB2B, ip2locationB2C: ip2locationB2C, ip2locationCityB2C: ip2locationCityB2C }); }); this.getMyCity = d.promise(); } }, { } ));
});
modules.define('ip2location', ['i-bem', 'ip2locationService'], function(provide, BEM, ip2locationService) { // Для того чтобы ip2locationService инициализировался его надо прокинуть в define. provide(BEM.create('ip2locationService'));
});
modules.define('retinaUtils', ['jquery'], function(provide, $) { var retinaUtils = {}; retinaUtils.isRetina = window.devicePixelRatio>1.5; retinaUtils.replaceSrc = function(){ var elements = $('[data-retina-src]'); elements.each(function(i, e){ var self = $(e), src = self.data('retina-src'); self.attr('src', src); }); } provide(retinaUtils);
});
modules.define('secondary-nav', ['i-bem__dom'], function(provide, BEMDOM) { provide(BEMDOM.decl(this.name, { onSetMod: { js: { inited: function() { } } }, _onLinkClick: function(e){ var target = $(e.target); this.domElem.find('a[data-pjax].active').removeClass('active'); target.addClass('active'); } }, { live: function(){ this.liveBindTo('link', 'click', function(e) { this._onLinkClick(e); }); return false; } }
));
});
modules.define('selectbox', ['i-bem', 'i-bem__dom', 'ip2location', 'events__channels'], function(provide, BEM, BEMDOM, ip2location, channels) { provide(BEMDOM.decl(this.name, { onSetMod: { js: { inited: function() { this.__self.initialize.apply(this); } } } }, { initialize: function(){ var self = this; self.selectbox = new SelectBox({ selectbox: self.domElem, customScrollbar: true, width : 300, height : 285, scrollOptions : { verticalDragMaxHeight : 42, showArrows: true }, changeCallback: function(value) { channels('global').emit('change_selectbox_'+self.params.eventName, {value: value}); } }); }, onCityAndCitiesLoad: function(){ var self = this; $.when( BEM.blocks['contacts-map'].getCities, ip2location.getMyCity ).done(function (cities, ip2location) { if(self.domElem.val() === ip2location.ip2location){ /* Если значение которое текущие у селекта совпадает с полученным из ip2location Вызывает событие напрямую, а не через смену значения селекта, потому что changeCallback у селекта в данном случае не сработает. */ channels('global').emit('change_selectbox_'+self.params.eventName, {value: ip2location.ip2location}); } else { self.selectbox.jumpToValue(ip2location.ip2location); } }); }, onCityB2CLoad: function(){ var self = this; $.when( BEM.blocks['internet-special'].getOffers , ip2location.getMyCity ).done(function(offers, ip2location){ if(self.domElem.val() === ip2location.ip2locationB2C){ /* Если значение которое текущие у селекта совпадает с полученным из ip2location Вызывает событие напрямую, а не через смену значения селекта, потому что changeCallback у селекта в данном случае не сработает. */ channels('global').emit('change_selectbox_'+self.params.eventName, {value: ip2location.ip2locationB2C}); } else { self.selectbox.jumpToValue(ip2location.ip2locationB2C); } }); }, onCityB2BLoad: function(){ var self = this; $.when( BEM.blocks['services-business'].getServices, ip2location.getMyCity, BEM.blocks['internet-special'].getOffers ).done(function(services, ip2location, offers){ if(self.domElem.val() === ip2location.ip2locationB2B){ /* Если значение которое текущие у селекта совпадает с полученным из ip2location Вызывает событие напрямую, а не через смену значения селекта, потому что changeCallback у селекта в данном случае не сработает. */ channels('global').emit('change_selectbox_'+self.params.eventName, {value: ip2location.ip2locationB2B}); } else { self.selectbox.jumpToValue(ip2location.ip2locationB2B); } }); } }
));
});
modules.define('selectbox', function(provide, selectbox) { provide(selectbox.decl({ modName : 'contacts'}, { onSetMod: { js: { inited: function(){ this.__self.initialize.apply(this); this.__self.onCityAndCitiesLoad.apply(this); } } } }));
});
modules.define('selectbox', function(provide, selectbox){ provide(selectbox.decl({modName: 'internet', modVal: 'home'},{ onSetMod: { js: { inited: function(){ var self = this; this.__self.initialize.apply(this); setTimeout(function(){ self.__self.onCityB2CLoad.apply(self); }, 0); } } } }));
});
modules.define('selectbox', function(provide, selectbox){ provide(selectbox.decl({modName: 'internet', modVal: 'business'},{ onSetMod: { js: { inited: function(){ var self = this; this.__self.initialize.apply(this); setTimeout(function(){ self.__self.onCityB2BLoad.apply(self); }, 0); } } } }));
});
modules.define('services-business', ['i-bem__dom', 'events__channels'], function(provide, BEMDOM, channels){ provide(BEMDOM.decl(this.name, { onSetMod: { js: { inited: function() { channels('global').on('change_selectbox_internet_business', this.onChangeCity, this); this.initListAnimation(); this.loadServices(); }, '': function() { channels('global').un('change_selectbox_internet_business', this.onChangeCity, this); } } }, onChangeCity: function(e, data){ this.filterServices(this.services[data.value]); }, loadServices: function() { var self = this, d = $.Deferred(); $.get('/ajax/citiesServices.php?lang='+getLang()).then(function(data){ self.services = data; d.resolve({services: data}); }); this.__self.getServices = d.promise(); }, filterServices: function (arr){ $(".list-services__item").hide(); $(".list-services__item").removeClass('visible'); $.grep(arr,function(elem){ $(".list-services__item[data-services="+elem+"]").show().addClass('visible'); }); $(".list-services__item").removeClass('list-services__item_first').removeClass('list-services__item_last'); $(".list-services__item.visible:eq(0)").addClass('list-services__item_first'); $(".list-services__item.visible:eq(-1)").addClass('list-services__item_last'); }, initListAnimation: function(){ function initClick(self) { var item = self.closest('.list-services__item'), button = item.find('.list-services__button'), buttonText = item.find('.list-services__button-text'), buttonTextActive = item.find('.list-services__button-text_active'), buttonArrow = item.find('.list-services__button-arrow'), description = item.find('.list-services__description'), separator = item.find('.list-services__separator'), content = item.find('.list-services__content'), contentHeight = content.height(), tl = new TimelineMax({onStart : function(){item.addClass('active');}, onReverseComplete : function(){item.removeClass('active');} }); tl.timeScale(10); tl.stop(); tl.to(buttonArrow, 3, { startAt : {transformOrigin:"50% 50%", rotation:0}, rotation : 180, force3D: true, immediateRender:true, ease:Power2.easeInOut }); tl.to(buttonText, 3, {startAt:{opacity:1}, opacity:0, force3D:true, immediateRender:false,ease:Power2.easeInOut },0); tl.to(buttonTextActive, 3, {startAt:{opacity:0, x: -20}, opacity:1, x : 0, force3D:true, immediateRender:true,ease:Power2.easeInOut },0 ); tl.to(content, 3, { startAt: {autoAlpha:0 }, autoAlpha:1, force3D:true, immediateRender:true,ease:Power2.easeInOut },0) tl.to(item, 3, { css:{height: 140 + contentHeight + 30 + 'px' }, force3D:true, immediateRender:false, ease:Power2.easeInOut}, 0 ); tl.to(separator, 3, { css:{height: 62 + contentHeight + 'px' }, force3D:true, immediateRender:false, ease:Power2.easeInOut}, 0 ); return tl; } $(".list-services__button").click(function(e){ var active = $(".list-services__item.active"), self = $(this), item = self.closest('.list-services__item'), isBtn = $(e.target).closest('.list-services__button').length, tl = $(this).data('timeline-click'); if ( active.length != 0 ){ active.data('timeline-click').timeScale(10).reverse(); } if (!tl) item.data('timeline-click', tl = initClick($(this))) if( item.hasClass('active') && isBtn ){ item.addClass('inprogress'); tl.reverse(); } else{ tl.play(); } }); } }, { }));
});
modules.define('services-home', ['i-bem', 'i-bem__dom', 'events__channels'], function(provide, BEM, BEMDOM, channels){ provide(BEMDOM.decl(this.name, { onSetMod: { js: { inited: function() { channels('global').on('change_selectbox_internet_home', this.onChangeCity, this); }, '': function() { channels('global').un('change_selectbox_internet_home', this.onChangeCity, this); } } }, onChangeCity: function(e, data){ this.loadAndReplace(data.value); }, loadAndReplace: function(city){ var elem = $('.services-block__item_internet'); this.LoadTariffsB2C(elem, city, function(){ mainPjax.refresh(); // Рефрешим ссылки которое появились в загруженном шаблоне. }); }, LoadTariffsB2C: function(el, action, cb) { $.ajax({ url: preffix()+'/tariffsb2c/?code='+action, cache : false, success : function(data) { el.html(data); if (cb) { cb(); } } }); } }, { }));
});
modules.define('sliderbox', ['i-bem__dom'], function(provide, BEMDOM){ provide(BEMDOM.decl(this.name, { onSetMod: { js: { inited: function() { this.findBlocksOutside('internet-special')[0].on('filter', this.onFilter, this); this.sliderInited = false; }, '': function() { this.findBlocksOutside('internet-special')[0].un('filter', this.onFilter, this); } } }, onFilter: function(e, data){ this.destroySliderbox(); if(data.length > 1){ this.initialize(); this.initSliderbox(); } }, destroySliderbox: function(){ if(this.sliderInited){ this.domElem.cycle('destroy'); this.sliderInited = false; } }, initSliderbox: function(){ var internetSpecialLeftside = $('.internet-special__leftside'); this.domElem.cycle({ speed: 600, manualSpeed: 600, swipe : true, slides : $('[slide-enabled="true"]'), pager : '.sliderbox__pager', pagerTemplate : "<span></span>", pagerActiveClass : "active", prev : '.sliderbox__arrow_prev', next : '.sliderbox__arrow_next', paused : false, pauseOnHover : true }); this.sliderInited = true; this.domElem.on('cycle-after', function(e, optioHash, outgoingSlideEl, incomingSlideEl, forwardFlag){ var html = $(incomingSlideEl).find('.internet-special__leftside_tmp').html(); internetSpecialLeftside.html(html); }); }, initialize: function(){ var arrows = $('.sliderbox__arrow'), arrowPrev = $('.sliderbox__arrow_prev'), arrowNext = $('.sliderbox__arrow_next'), tl = new TimelineMax(), internetSpecialLeftside = $('.internet-special__leftside'); TweenMax.set(arrows, { opacity : 0} ); tl.stop(); tl.to(arrowPrev, 0.4, { startAt : { opacity : 0, x : 10 }, opacity : 1, x : 0, force3D:true, immediateRender:false, ease:Power2.easeInOut }, 0 ); tl.to(arrowNext, 0.4, { startAt : { opacity : 0, x : -10 }, opacity : 1, x : 0, force3D:true, immediateRender:false, ease:Power2.easeInOut }, 0 ); this.domElem .mouseenter(function(){ tl.play(); }) .mouseleave(function(){ tl.reverse(); }); } }, { }));
});
modules.define('header-controls', ['i-bem__dom'], function(provide, BEMDOM){ provide(BEMDOM.decl(this.name, { onSetMod: { js: { inited: function(){ var elem; if(this.elem('control', 'lang').length){ elem = this.elem('control', 'lang'); } else { elem = this.elem('control', 'lang', 'en'); } this.bindTo(elem, 'click', this._onControlLangClick); } } }, _onControlLangClick: function(){ var path; if(document.location.pathname.indexOf('/en/') !== -1){ path = document.location.pathname.replace(/^\/en/,''); } else{ path = '/en'+document.location.pathname; } location.href = path; } }, { }));
});
modules.require(['retinaUtils'], function(retinaUtils) { if (retinaUtils.isRetina) { retinaUtils.replaceSrc(); }
});
/* Инициализация блоков которые имеют класс i-bem на dom-ready */
modules.require(['i-bem__dom_init', 'jquery', 'next-tick'], function(init, $, nextTick) { $(function() { nextTick(init); });
});
A Pen by ddimonn8080 - Script Codes
A Pen by ddimonn8080 - Script Codes
Home Page Home
Developer Ddimonn8080
Username ddimonn8080
Uploaded July 31, 2022
Rating 3
Size 22,065 Kb
Views 38,456
Do you need developer help for A Pen by ddimonn8080?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Ddimonn8080 (ddimonn8080) Script Codes
Name
Menu icons css
Menu
Bootstrap grid sistem
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!