This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gsap.registerPlugin(ScrollTrigger, ScrollSmoother, ScrollToPlugin); | |
// Sticky menu | |
function stickyMenuFunc() { | |
const sidebarElement = document.querySelector('.list-anchor'); | |
const sectionSidebar = '.section__sidebar'; | |
if (sidebarElement) { | |
gsap.to(sidebarElement, { | |
scrollTrigger: { | |
trigger: sidebarElement, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (){ | |
const $infoListCount = $('.info__list'); | |
const $infoItemCount = '.info__item'; | |
const $infoNumCount = '.info__num'; | |
$infoListCount.each(function(){ | |
$($infoItemCount, this).each(function(i){ | |
$(this).find($infoNumCount).text(('0' + (i+1)).slice(-2)); | |
}); | |
}); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//fixed header | |
$(function() { | |
const header = $('.header'); | |
const headerFixed = 'header--fixed'; | |
$(window).scroll(function() { | |
if($(this).scrollTop() > 1) { | |
header.addClass(headerFixed); | |
} else { | |
header.removeClass(headerFixed); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html{ | |
height: 100%; | |
} | |
body{ | |
display: flex; | |
flex-direction: column; | |
height: 100%; | |
} | |
.header{ | |
flex: 0 0 auto; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class=""> | |
<label class="form-label"> | |
<input class="jq-check-all" type="checkbox" data-id="sort"> | |
<span class="form-label__capt">Все</span> | |
</label> | |
<label class="form-label"> | |
<input class="jq-check-rest" type="checkbox" data-id="sort"> | |
<span class="form-label__capt"></span> | |
</label> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta http-equiv="x-dns-prefetch-control" content="on"> | |
<link rel="dns-prefetch" href="https://www.googletagmanager.com"> | |
<link rel="dns-prefetch" href="https://connect.facebook.net"> | |
<link rel="dns-prefetch" href="https://www.google-analytics.com"> | |
<link rel="dns-prefetch" href="https://adservice.google.com"> | |
<link rel="dns-prefetch" href="https://staticxx.facebook.com"> | |
<link rel="dns-prefetch" href="https://www.facebook.com"> | |
<link rel="dns-prefetch" href="https://tpc.googlesyndication.com"> | |
<link rel="dns-prefetch" href="https://ajax.googleapis.com"> | |
<link rel="dns-prefetch" href="https://fonts.googleapis.com"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var link = $('.link'); | |
link.each(function() { | |
if ( (window.location.pathname.indexOf( $(this).attr('href') ) ) > -1) { | |
$(this).addClass('selected'); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('.js-collapse').forEach(function(accordion) { | |
accordion.addEventListener('click', function(event) { | |
//event.preventDefault(); | |
let subAccordion = accordion.querySelector('.js-collapse-target'); | |
let clickTarget = event.target; | |
if( clickTarget.closest('.js-collapse-toggle') ) { | |
accordion.classList.toggle('open'); | |
setTimeout(function() { | |
if (subAccordion.style.maxHeight) { | |
subAccordion.style.maxHeight = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hasClass(el, className) { | |
return el.classList ? el.classList.contains(className) : new RegExp('\\b'+ className+'\\b').test(el.className); | |
} | |
function addClass(el, className) { | |
if (el.classList) el.classList.add(className); | |
else if (!hasClass(el, className)) el.className += ' ' + className; | |
} | |
function removeClass(el, className) { | |
if (el.classList) el.classList.remove(className); | |
else el.className = el.className.replace(new RegExp('\\b'+ className+'\\b', 'g'), ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ready (MutationObserver) | |
(function(win) { | |
'use strict'; | |
var listeners = [], | |
doc = win.document, | |
MutationObserver = win.MutationObserver || win.WebKitMutationObserver, | |
observer; | |
function ready(selector, fn) { | |
listeners.push({ | |
selector: selector, |
NewerOlder