$(document).ready(function() { //effects for viewport larger than 960px if ($(window).width() > 960) { var revealOnScroll = $(".revealOnScroll"); var $window = $(window); $window.scroll(function() { var scroll = $window.scrollTop(); // adds css animation to element when scrolling down if (scroll >= 300) { revealOnScroll.removeClass('animated'); } else { revealOnScroll.addClass('animated'); } }); //$("#releaseModal").modal('show'); } //effects for all viewports var $window = $(window); $window.scroll(function() { var scroll = $window.scrollTop(); var logo = $(".brand-logo") // show logo in the navbar when scrolling past hero element with main logo if (scroll >= 130) { logo.show().removeClass('d-none'); $('.navbar').addClass('bg-white'); } else { logo.hide(); $('.navbar').removeClass('bg-white'); } }); // smooth scroll to id $(".scroll").on('click', function() { var data_id = $(this).data('id'); $('.scroll-content').each(function() { var el = $(this); if (el.attr('id') == data_id) el.show(); else el.hide(); }); $('html, body').animate({ scrollTop: $('#' + data_id).offset().top -70 }, 'slow'); }); $('.github-stars').mouseover(function() { $( '.github-stars-counter' ).toggleClass('d-none d-flex'); }); $('.github-stars').mouseout(function() { $( '.github-stars-counter' ).toggleClass('d-flex d-none'); }); }); // play / pause background video var video = $('#bgr_video').get(0); $(document).delegate('.play-btn', 'click', function() { video.play(); $('.play-btn > i').attr('class', 'fas fa-pause fa-lg'); $(this).toggleClass("play-btn pause-btn"); }); $(document).delegate('.pause-btn', 'click', function() { if (video.paused !== true && video.ended !== true) { video.pause(); $('.pause-btn > i').attr('class', 'fas fa-play fa-lg'); $(this).toggleClass("pause-btn play-btn"); } }); // tooltips $(function () { $('[data-toggle="tooltip"]').tooltip() })