blob: 14d183b513ccdbb0226dd0a74371cd1024daa061 [file] [log] [blame]
window.lazyLoadOptions={elements_selector:".lazy"},function(){if(!$(".lower-ie").length){document.getElementById("nav-index").className="active";var e=navigator.userAgent,n=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),e=e.match(/Edge\/([\d.]+)/),i=(window.supportTouch="ontouchstart"in window&&!n&&!e,ScrollReveal().reveal(".reveal",{container:"#page-index",delay:300}),ScrollReveal().reveal(".reveal-later",{container:"#page-index",delay:600}),ScrollReveal().reveal(".reveal-latest",{container:"#page-index",delay:1200}),ScrollReveal().reveal(".reveal-about",{container:"#page-index",delay:600}),{});function t(e,n){var t=e;"string"==typeof e&&(t=document.getElementById(e)),i[e]=lottie.loadAnimation({container:t,renderer:"svg",loop:!1,autoplay:!0,path:n})}t("icon-1","asset/lottie/json/chart.json"),t("icon-2","asset/lottie/json/fly.json"),t("icon-3","asset/lottie/json/analysis.json"),t("icon-4","asset/lottie/json/compatible.json"),t("icon-5","asset/lottie/json/grown.json"),t("icon-6","asset/lottie/json/simple.json");for(var o=0;o<6;o++)t("bg-icon-"+(o+1),"asset/lottie/json/bg_0"+(o+1)+".json"),!function(e){$("#index-feature-"+(e+1)).mouseenter(function(){i["icon-"+(e+1)].goToAndPlay(0)})}(o);var a,l=!1,s=!1,d=(t("paper-icon","asset/lottie/json/paper.json"),$("#page-index").scroll(function(){var e=$("#start-line").offset().top,n=$("#end-line").offset().top;e>=$(window).scrollTop()&&e<$(window).scrollTop()+$(window).height()-200?l||($("#publication").css("opacity",1),i["start-line"]?i["start-line"].goToAndPlay(0):t("start-line","asset/lottie/json/start_line.json"),i["paper-icon"]?i["paper-icon"].goToAndPlay(0):t("paper-icon","asset/lottie/json/paper.json"),l=!0):l=l||!1,n<=400?s||(i["end-line"]?i["end-line"].goToAndPlay(0):t("end-line","asset/lottie/json/end_line.json"),s=!0):s=s||!1}),!1);setTimeout(()=>{a=c()},3e3),window.startMagic=function(){function e(){$("#play-landing-animation .loading").hide();var e=document.querySelector(".home-landing-animation-cover svg").getBoundingClientRect(),e={left:e.left,top:e.top,width:e.width,height:e.height};$("#main").addClass("cinematic-mode"),document.getElementById("home-landing-animation-close-btn").onclick=function(){landingAnimation.pause(),$("#main").removeClass("cinematic-mode")},d?landingAnimation.resume():(landingAnimation.init(document.getElementById("home-landing-animation-viewport"),{initialPieLayout:e,initialPieAnimation:!1,updateURLHash:!1}),d=!0)}$("#play-landing-animation .loading").show(),"undefined"!=typeof landingAnimation?e():(a=a||c()).then(function(){e()})},$("#play-landing-animation").on("click",startMagic)}function c(){return new Promise(e=>{var n="https://fastly.jsdelivr.net/npm/echarts-www-landing-animation/",t=document.createElement("link"),i=document.createElement("script"),o=(t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),2);function a(){--o||setTimeout(()=>{e()},500)}i.onload=a,t.onload=a,t.href=n+"dist/style.css",i.src=n+"dist/echarts-www-landing-animation.js",document.head.appendChild(t),document.head.appendChild(i)})}}();