{"size": 1933, "ext": "js", "max_stars_repo_path": "presentation/js/main.js", "max_stars_repo_name": "marius-dev/emag-apps-ui-kit", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "presentation/js/main.js", "max_issues_repo_name": "marius-dev/emag-apps-ui-kit", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "presentation/js/main.js", "max_forks_repo_name": "marius-dev/emag-apps-ui-kit", "max_forks_repo_forks_event_min_datetime": "2021-08-16T10:44:27.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-16T10:44:27.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 25.7733333333, "max_line_length": 98, "alphanum_fraction": 0.5638903259}
$(document).ready(function() {  
	
	$('.red-line').addClass('animate-line');
    
	var $window = $(window);
	var $container = $(".container");
	var $logo = $('.logo');
	var $homeSection = $('.home');
	var $aboutSection = $('.about');
	var $menuTop = $('.menu-top');
	
	setPageHeight();
	showMenu();
	disableArrowKeys();
	
    $window.on('resize', function(){
		resetPage();
		setPageHeight();
	});
	
	$container.on('scroll', function(){
		showMenu();
	});
	
	function resetPage(){
		$container.scrollTop(0);
		$homeSection.css({'height':''});
		$aboutSection.css({'height':''});
		$menuTop.removeClass('menu-top-show');
	}
	
	function setPageHeight(){
		var windowHeight = $window.height();
		$homeSection.css({'height':''});
		$homeSection.height( Math.max( windowHeight - $('#header').height(), $homeSection.height() ) );
		var sectionHeight = Math.max($aboutSection.height()+$('#footer').height(), windowHeight);
		$aboutSection.height(sectionHeight);
	}
	
	$('.find-out').on('click', function(){
		$container.animate({ scrollTop: $homeSection.height()+$logo.height()}, 500,function(){
			$menuTop.addClass('menu-top-show ');
		});
	})
	
	$('.btn-home').on('click', function(){
	   $(this).blur();
		$menuTop.removeClass('menu-top-show ')
		$container.animate({ scrollTop: 0 }, 500, function(){	
		});	
	});
	
	function showMenu(){
		if($container.scrollTop() > $homeSection.height()){
			$menuTop.addClass('menu-top-show');
			$logo.addClass('logo-small');
		}else{
			$menuTop.removeClass('menu-top-show ');
			$logo.removeClass('logo-small');
		}
	}
	
	function disableArrowKeys() {
        var ar = new Array(37, 39);
        $(document).keydown(function(e) {
            var key = e.which;
			if ($.inArray(key, ar) > -1) {
                e.preventDefault();
                return false; 
           }
            return true;
        });
    }
});
