var userAgent = window.navigator.userAgent.toLowerCase(); var isIE = false; if (userAgent.indexOf('msie') != -1 || userAgent.indexOf('trident') != -1) { isIE = true; } else if (userAgent.indexOf('edge') != -1) {} else if (userAgent.indexOf('chrome') != -1) {} else if (userAgent.indexOf('safari') != -1) {} else if (userAgent.indexOf('firefox') != -1) {} else if (userAgent.indexOf('opera') != -1) {} else {} // HTML-LOAD $(function(){ }); // ASSETS-LOAD $(window).on('load', function() { $(".loading").fadeOut(600, function() { $(".container").css("opacity", "1"); scrollAnime(); }); }); $(window).on("resize", function() { scrollAnime(); }); $(window).on("scroll", function() { scrollAnime(); }); $('a.scroller[href^="#"]').click(function() { var href = $(this).attr("href"); var target = $(href); var position = target.offset().top; $('body,html').stop().animate({ scrollTop: position }, 500); return false; }); $(".openShare").on("click", function() { let TYPE = $(this).data("type"); var SHARE_URL = ""; var SHARE_TITLE = TITLE; if ($(this).data("page")) { SHARE_URL = URL + $(this).data("page"); SHARE_TITLE = $("title").first().text(); } // SNS type switch (TYPE) { case "tw": SHARE_URL = "https://twitter.com/intent/tweet?text=" + SHARE_TITLE + "&url=" + URL; break; case "fb": SHARE_URL = "https://www.facebook.com/sharer/sharer.php?u=" + URL; break; case "line": SHARE_URL = "https://social-plugins.line.me/lineit/share?url=" + URL; break; default: break; } console.log("???" + SHARE_URL) window.open(SHARE_URL, TYPE, 'width=550, height=450, personalbar=0, toolbar=0, scrollbars=1, resizable=1'); }); function scrollAnime() { var windowHeight = $(window).innerHeight(), topWindow = $(document).scrollTop(), fadeH = 450; $('.fadein').each(function() { var targetPosition = $(this).offset().top; fadeH = $(this).data("fadeheight") != undefined ? $(this).data("fadeheight") : fadeH; if (topWindow > targetPosition - windowHeight + (fadeH) || $(this).hasClass("firstView")) { $(this).addClass($(this).data("fadein")); } }); }