Ejemplo n.º 1
0
$(() => {
	svg4everybody();

	// при ширине viewport < 480px вызываем слайдер
	enquire.register('screen and (max-width: 479px)', {
		match() {
			$('#slider').slick({
				arrows: false,
				dots: true,
				infinite: true,
				autoplay: true,
				autoplaySpeed: 6000,
				speed: 300,
				slidesToShow: 1
			});

			$('#sliderPlayers').slick({
				arrows: false,
				dots: true,
				infinite: true,
				autoplay: true,
				autoplaySpeed: 6000,
				speed: 300,
				slidesToShow: 1
			});
		},
		unmatch() {
			$('#slider').slick('unslick');
			$('#sliderPlayers').slick('unslick');
		}

	});
});
Ejemplo n.º 2
0
ready(() => {
	svg4everybody({
		polyfill: true, // polyfill <use> elements for External Content
	});

	// moduleTest(); // this is a test, uncomment this line to try it
});
Ejemplo n.º 3
0
    init: function() {

      //Iniitalize svg4everybody
      svg4everybody();

      //List for notication close
      $('#tofino-notification .close').on('click', function() {
        if (tofinoJS.cookieExpires) {
          Cookies.set('tofino-notification-closed', 'yes', {expires: parseInt(tofinoJS.cookieExpires)});
        } else {
          Cookies.set('tofino-notification-closed', 'yes');
        }
      });

      //Assign sticky
      var $sticky = $('.navbar-sticky-top');

      if ($sticky.length) {
        //Sticky polyfill for css position: sticky
        $sticky.Stickyfill();

        //Assign stick offset
        var stickyTop = $sticky.offset().top;

        $(window).scroll(function() {
          if ($(this).scrollTop() > stickyTop) {
            $sticky.addClass('stuck');
          } else {
            $sticky.removeClass('stuck');
          }
        });
      }
    }
module.exports = ctx => {
  svg4everybody();
  searchBox();
  clipboard();
  map();
  moreButton();
  moreCordion();
  moreDetails();
  carousel(ctx);
  mediaplayer();
  headerMenu();
  illuminate();
  osd(ctx);
};
Ejemplo n.º 5
0
  function enter (ctx) {
    // Temporary until templates pulled into js for client side rendering
    if (!ctx.isInitialRender) {
      window.location = ctx.path;
    }

    // TODO: AJAX fetch data for person

    svg4everybody();
    searchBox();
    clipboard();
    moreButton();
    openseadragon();
    slickCarousel();
  }
Ejemplo n.º 6
0
    value: function run() {
      if ((0, _UsesFunctions.isMobile)()) {
        this.body.addClass('is-mobile');
      }
      // Анимация для страницы
      if (document.querySelector('.has-anim')) {
        var _AOS = require('aos');
        _AOS.init({
          disable: 'mobile',
          offset: 200,
          duration: 600,
          easing: 'ease-in-sine',
          delay: 100
        });
      }

      SvgEvery();
    }
Ejemplo n.º 7
0
  run() {
    if (isMobile()) {
      this.body.addClass('is-mobile');
    }
    // Анимация для страницы
    if (document.querySelector('.has-anim')) {
      const AOS = require('aos');
      AOS.init({
        disable: 'mobile',
        offset: 200,
        duration: 600,
        easing: 'ease-in-sine',
        delay: 100,
      });
    }

    SvgEvery();
  }
Ejemplo n.º 8
0
ready(() => {
	const anchors = new AnchorJS();
	anchors.options = {
		icon: '¶'
	};
	anchors.add('article h1, article h2, article h3, article h4');

	trak.start();
	packageInfo();
	demos();
	svg4everybody();

	if (document.querySelector('.sidebarReveal')) {
		document.querySelector('.sidebarReveal').addEventListener('click', ev => {
			document.querySelector('.sidebar').classList.toggle('u-showAboveMid');
		}, false);
	}

});
Ejemplo n.º 9
0
document.addEventListener('DOMContentLoaded', () => {
    svg4everybody();
    objectFitImages();
    cl('ready');
});
Ejemplo n.º 10
0
$(() => {
	svg4everybody();

	/*const video = document.getElementById('avi-video');
	const video2 = document.getElementById('avi-video2');
	setTimeout(function () {      
		video.play();
		video2.play();
	}, 100);*/

	const anchors = [
		'intro',
		'vigo',
		'about',
		'track',
		'track-details',
		'track-products',
		'habits',
		'protection',
		'share',
		'products'
	];

	const mobileAt = 600;

	const scrollingSpeed = 1500;

	$('#fullpage').fullpage({
		scrollbar: false,
		navigation: true,
		navigationPosition: 'index__fullpage-nav',
		css3: false,
		scrollingSpeed,
		anchors,
		onLeave: (index, nextIndex, direction) => {
			track(direction, index, scrollingSpeed);
			share(direction, index, scrollingSpeed);
			protection(direction, index, scrollingSpeed);
			products(direction, index, scrollingSpeed);
		}
	});

	$('.js-scroll-down').click(event => {
		event.preventDefault();
		$.fn.fullpage.moveSectionDown();
	});

	initSlick();
	$(window).resize(() => {
		initSlick();
	});

	$('.js-slick-text').slick({
		slidesToShow: 1,
		slidesToScroll: 1,
		dots: true,
		arrows: false,
		adaptiveHeight: true
	});

});
Ejemplo n.º 11
0
$(() => {
	svg4everybody();
});
Ejemplo n.º 12
0
$(document).ready(() => {
    svg4everybody();

    var cache = {};

    $('.logo').on('click', function(evt) {
        evt.preventDefault();
    });

    $('.tabs__header__item__link').on('click', function(evt) {
        evt.preventDefault();

        var $this = $(this);

        //$('.tab--active').removeClass('tab--active');
        $('.tabs__header__item--active').removeClass('tabs__header__item--active');

        //$($this.attr('href')).addClass('tab--active');
        $this.closest('.tabs__header__item').addClass('tabs__header__item--active');

        if($this.attr('href').indexOf('1') > -1) {
            $('#lead_type').val($('#lead_type').data('value-buy'));
        } else {
            $('#lead_type').val($('#lead_type').data('value-refinance'));
        }
    });

    window.noUiSlider = noUiSlider;

    var moneyValue = document.getElementById('moneyValue');

    noUiSlider.create(moneyValue, {
        range: {
            'min': 350000,
            'max': 3000000
        },
        //snap: true,
        start: 400000,
        step: 50000
    });

    moneyValue.noUiSlider.on('update', function() {

        if(!$('.noUi-handle-lower span').length) {
            $('.noUi-handle-lower').append('<span class="slider-value"></span>');
        }

        var moneyValueNumber = parseInt(moneyValue.noUiSlider.get());

        $('#moneyValueInput').val(moneyValueNumber);
        $('.slider-value').text(moneyValueNumber.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ") + ' Kč');

        if($(window).width() < 768) {
            if (moneyValueNumber <= 600000) {
                $(moneyValue).addClass('min-range');
            } else {
                $(moneyValue).removeClass('min-range');
            }
            if (moneyValueNumber >= 2800000) {
                $(moneyValue).addClass('max-range')
            } else {
                $(moneyValue).removeClass('max-range');
            }
        }
    });


    $('.clients').slick({
        dots: false,
        // centerMode: true,
        slidesToShow: 2,
        slidesToScroll: 2,
        responsive: [
            //{
            //    breakpoint: 1024,
            //    settings: {
            //        slidesToShow: 3,
            //        slidesToScroll: 3,
            //        infinite: true,
            //        dots: true
            //    }
            //},
            {
                breakpoint: 600,
                settings: {
                    slidesToShow: 1,
                    slidesToScroll: 1
                }
            },
            //{
            //    breakpoint: 480,
            //    settings: {
            //        slidesToShow: 1,
            //        slidesToScroll: 1
            //    }
            //}
            // You can unslick at a given breakpoint now by adding:
            // settings: "unslick"
            // instead of a settings object
        ]
    });

    function calculateClientHeight() {
        var maxClientHeight = 0,
            clients = $('.client');
        clients.each(function() {
            maxClientHeight = Math.max(maxClientHeight, $(this).outerHeight());
        });

        clients.css({height: maxClientHeight + 'px'})
    }

    calculateClientHeight();

    $(window).resize(function() {
        calculateClientHeight();
    });

    $('.partners').slick({
        dots: false,
        arrows: false,
        // centerMode: true,
        infinite: true,
        //slidesToShow: 2,
        slidesToScroll: 3,
        centerMode: true,
        variableWidth: true,
        autoplay: true,
        autoplaySpeed: 2000
    });

    $('.partner').each(function(i, p) {
        var $p = $(p),
            img = $p.find('img');
        $p.append('<span class="partner__over"><img src="' + img.attr('src') + '" alt="' + img.attr('alt') +  '" /></span>')

        $p.on('click', function(evt) {
            evt.preventDefault();
            $('html, body').animate({
                scrollTop: $p.offset().top - Math.round($(window).innerHeight() / 2) + 'px'
            }, 200);
        })
    });

    $('.nav--mobile').on('click', function(evt) {
        evt.preventDefault();

        $(this).toggleClass('nav--mobile--active');
        $('.nav--top').toggleClass('nav--top--active');
    });

    //$('.scrolldown').on('click', function(evt) {
    //    evt.preventDefault();
    //
    //    $('html, body').animate({
    //        scrollTop: $($(this).attr('href')).offset().top + 'px'
    //    }, 300);
    //});

    $('.scrollto').on('click', function(evt) {
        evt.preventDefault();

        $('html, body').animate({
            scrollTop: $($(this).attr('href')).offset().top + 'px'
        }, 300);

        if(typeof $(this).data('tab') != "undefined") {
            $('a[href="#' + $(this).data('tab') + '"]').trigger('click');
        }
    });

    $('.news__item').on('click', function(evt) {
        evt.preventDefault();

        var target = $($(this).attr('href')),
            targetDependentHeight = target.outerHeight() + 2*$('.news__details').css('padding-top'),
            finalHeight;

        finalHeight = targetDependentHeight > $(document).height() ? targetDependentHeight : $(document).height();

        cache.prevPosition = $(window).scrollTop();


        $('.news__details')
            .removeClass('hidden')
            .css({
                height: finalHeight
            });

        target.removeClass('hidden');

        target.append($('.news__detail__close'));

        $('html, body').animate({
            scrollTop: '0px'
        }, 800);
    });

    function closeDetail() {
        $('.news__details__item:visible').fadeOut(500, function() {
            $(this).addClass('hidden').removeAttr('style');
        });

        $('.news__details').fadeOut(500, function() {
            $(this).addClass('hidden').removeAttr('style');
        });

        $('html, body').animate({
            scrollTop: cache.prevPosition + 'px'
        }, 800);

    }

    $('.news__detail__close').on('click', function(evt) {
        evt.preventDefault();
        evt.stopPropagation();
        closeDetail();
    });

    $('.news__details').on('click', function(evt) {
        evt.preventDefault();
        evt.stopPropagation();

        if($.inArray('news__details', evt.currentTarget.classList) > -1) {
            closeDetail();
        }
    });

    // IE9 placeholder polyfill
    if (!('placeholder' in document.createElement('input'))) {

        $('[placeholder]').focus(function() {
            var input = $(this);
            if (input.val() == input.attr('placeholder')) {
                input.val('');
                input.removeClass('placeholder');
            }
        }).blur(function() {
            var input = $(this);
            if (input.val() == '' || input.val() == input.attr('placeholder')) {
                input.addClass('placeholder');
                input.val(input.attr('placeholder'));
            }
        }).blur();

        $('[placeholder]').parents('form').submit(function() {
            $(this).find('[placeholder]').each(function() {
                var input = $(this);
                if (input.val() == input.attr('placeholder')) {
                    input.val('');
                }
            })
        });
    }
});
Ejemplo n.º 13
0
export default function() {
    svg4everybody();
}
Ejemplo n.º 14
0
});

if (isSafari) {
    $('html').addClass('safari');
}


morhOnvif();
morphLightning();
initTextareaAutoresize();
buildHeaderScrollScene();
buildContentFadeScenes(scrollController);
buildCommonScrollScenes();
setTimeout(setFeaturesHeight, 200);
initMap('#map');
svg4everybody();
drawHeroSvg('.hero-figure.is-active svg', 300);
activateScrollToAnchor();

function drawHeroSvg(el, timeout = 0, cb = $.noop) {
    if (mq.matches) return;

    if (typeof el === 'string') {
        el = $(el);
    }

    if (/drawsvg-initialized/.test(el.attr('class'))) {
        el.drawsvg('animate');
        return;
    }
Ejemplo n.º 15
0
$(() => {
	'use strict';
	svg4everybody();

	
});
Ejemplo n.º 16
0
$(() => {
	svg4everybody();

	// Responsive menu
	function menuResponsive() {
		const menuResponsiveButton = $('.menu-responsive__button');
		const menuResponsiveButtonActive = 'menu-responsive__button_active';
		const menuResponsiveList = $('.menu-responsive__list');
		const menuResponsiveListActive = 'menu-responsive__list_active';
		menuResponsiveButton.click(function () {
			menuResponsiveButton.toggleClass(menuResponsiveButtonActive);
			menuResponsiveList.toggleClass(menuResponsiveListActive);
		});

		console.log('responsive menu loaded');
	}


	// Responsive menu
	function menuOffcanvas() {
		const menuOffcanvasButton = $('.menu-offcanvas__button');
		const menuOffcanvasButtonActive = 'menu-offcanvas__button_active';
		const menuOffcanvasList = $('.menu-offcanvas__list');
		const menuOffcanvasListActive = 'menu-offcanvas__list_active';
		menuOffcanvasButton.click(function () {
			menuOffcanvasButton.toggleClass(menuOffcanvasButtonActive);
			menuOffcanvasList.toggleClass(menuOffcanvasListActive);
		});

		console.log('offcanvas menu loaded');
	}

	// Tabs
	function tabs() {
		const tabsNavLink = $('.tabs__link');
		const tabsNavLinkActive = 'tabs__link_active';
		const tab = $('.tabs__tab');
		const tabActive = 'tabs__tab_active';

		tabsNavLink.click(function (event) {
			event.preventDefault();
			$(this).addClass(tabsNavLinkActive);
			$(this).siblings().removeClass(tabsNavLinkActive);
			const tabCurrent = $(this).attr('href');
			tab.not(tabCurrent).removeClass(tabActive).hide();
			$(tabCurrent).fadeIn(50).addClass(tabActive).show();

			// carouselSecond.reloadSlider();

			console.log(tabCurrent);

		});
	}

	// owlCarousel
	function carouselOwl() {
		const owlcarousel = $('.carousel-owl__list');
		owlcarousel.owlCarousel({
			margin: 10,
			autoWidth: false,
			items: 3,
			loop: true,
			center: false,
			stagePadding: 0,
			dots: true,
			responsive: {
				320: {
					items: 2
				},
				768: {
					items: 2
				},
				1000:{
					items: 4
				}
			}

		});
		console.log('owlCarouselLoaded');
	}

	// bxSlider
	function bxslider() {
		const sliderBx = $('.slider-bx__list');
		sliderBx.bxSlider({
			mode: 'horizontal',
			slideMargin: 0,
			infiniteLoop: true,
			useCSS: true
			// minSlides: 3,
			// maxSlides: 3
		});

		console.log('bxsliderLoaded');

	}

	// Spinner
	function spinner() {
		const amountSpinner = $('.spinner__input');
		const amountSpinnerUp = $('.spinner__button_up');
		const amountSpinnerDown = $('.spinner__button_down');

		amountSpinner.spinner({
			max: 50,
			min: 0,
			step: 1
		});

		amountSpinnerUp.click(function () {
			amountSpinner.spinner('stepUp');
		});

		amountSpinnerDown.click(function () {
			amountSpinner.spinner('stepDown');
		});

	}


	function priceRange() {
		const rangeSlider = $('.range-slider__slider');
		const priceTextFrom = $('.range-slider__input#price-from');
		const priceTextTo = $('.range-slider__input#price-to');
		const priceInputFrom = $('.range-slider__price-from span');
		const priceInputTo = $('.range-slider__price-to span');

		// Range slider
		rangeSlider.slider({
			min: 100,
			max: 99999,
			values: [ 0, 99999 ],
			range: true,
			step: 1,
			slide: function (event, ui) {
				priceTextFrom.val( ui.values[0].toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1 ') + '');
				priceTextTo.val( ui.values[1].toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1 ') + '');

				priceInputFrom.text(ui.values[0]);
				priceInputTo.text(ui.values[1]);

				// $('.filter__price-input#price-from').val(ui.values[0]);
				// $('.filter__price-input#price-to').val(ui.values[1]);
			}
			// change: function(event, ui) {
			// 	$('.filter__price-input#price-from').val(ui.values[0]);
			// 	$('.filter__price-input#price-to').val(ui.values[1]);
			// }
		});

		// $('.filter__price-input#price-from').val($('.filter__range-slider').slider('values', 0).toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1 ") + "");
		// $('.filter__price-input#price-to').val($('.filter__range-slider').slider('values', 1).toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1 ") + "");


		// $('.range-slider__input#price-from').keyup(function () {
		// 	$('.range-slider__slider').slider('values', 0, this.value);
		// });
		// $('.range-slider__input#price-to').keyup(function () {
		// 	$('.range-slider__slider').slider('values', 0, this.value);
		// });

		console.log('rangeSlider loaded');
	}




	menuResponsive();
	menuOffcanvas();
	tabs();
	carouselOwl();
	bxslider();
	spinner();
	priceRange();


});
Ejemplo n.º 17
0
ready(() => svg4everybody());
Ejemplo n.º 18
0
$(document).ready(() => {
	log('it works!');
  svg4everybody();
});
Ejemplo n.º 19
0
export function enable() {
  svg4everybody();
}
Ejemplo n.º 20
0
import 'babel-polyfill';
import LinkButton from '@economist/component-link-button';
import React from 'react';
import SubscribeMessage from './index';
import { createI13nNode } from 'react-i13n'; // eslint-disable-line id-match
import svgForEverybody from 'svg4everybody';
/* eslint-disable  react/display-name */
if (typeof navigator !== 'undefined') {
  svgForEverybody();
}
const TrackedSubscribeLink = createI13nNode(LinkButton, {
  isLeafNode: true,
  bindClickEvent: true,
  follow: true,
});
function renderSubscribeLink(props) {
  return (
    <TrackedSubscribeLink
      i13nModel={{
        action: 'click',
        element: 'Subscribe link',
      }}
      { ...props }
    />
  );
}

export default (
  <div>
    <br style={{ marginTop: 100 }} />
    <SubscribeMessage href="https://subscriptions.economist.com" />
Ejemplo n.º 21
0
$(() => {
	svg4everybody();
	const cats = new Cats();
});