Template:Vilnius-Lithuania-OG/js/custom

var geniukai = [10000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] for(var i=0; i<37; i++) {

   geniukai[i] += (340 + 60*i);

}

var targetx = $(".igmA1").offset().top; var targety = $(".intro2").offset().top;

var bazinel = 0;

for(var i=0; i<geniukai.length; i++) {

   geniukai[i] /= (4222.7998046875 - 916.7999877929688);
   geniukai[i] *= (targety - targetx);

}


   var watas = $(".droplet1").height()


$(function() {


   $(window).scroll(function() {    
       for (i = 0; i <geniukai.length; i++) {
           var geniukovardas = ".igmA" + i;
           var scroll = $(window).scrollTop();
           var pavvardas = ".igmB" + i;
           var introtxt = ".introtxt" + i;
       
           if (scroll >= geniukai[i]) {
               $(introtxt).addClass("animated fadeIn");
               $(pavvardas).addClass("animated fadeIn");
               $(geniukovardas).addClass("animated fadeIn");
               $(geniukovardas).removeClass("animated fadeOut");
           } else {
               
               $(geniukovardas).addClass("animated fadeOut");
               $(geniukovardas).removeClass("animated fadeIn");
           }
       }
   });

});



var targetxx = $(".igmXA").offset().top; var targetyx = window.innerHeight; var targetyy = window.innerWidth; var targetzx = $(".igmXA").height();

var geniukaix = [10000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] for(var i=1; i<25; i++) {

   geniukaix[i] += targetxx - (0.666 * targetyx) + (((targetzx * 0.666) / 24) * (i-1));

}

var bazinelx = 0;


$(function() {


   $(window).scroll(function() {    
       for (i = 0; i <geniukaix.length; i++) {
           var geniukovardasx = ".igmX" + i;
           var scrollx = $(window).scrollTop();
           var pavvardasx = ".igmY" + i;
           var introtxtx = ".outrotxt" + i;


           if (scrollx >= geniukaix[i]) {
               $(pavvardasx).addClass("animated fadeIn");
               $(geniukovardasx).addClass("animated fadeIn");
               $(geniukovardasx).removeClass("animated fadeOut");
               $(introtxtx).addClass("animated fadeIn");
           } else {
               
               $(geniukovardasx).addClass("animated fadeOut");
               $(geniukovardasx).removeClass("animated fadeIn");
           }
       }
   });

}); var hatas = Math.floor(Math.random() * 117); var watasx = $(".igmXA").height() document.getElementById('message').innerHTML = hatas; document.getElementById('message2').innerHTML = targetyy;


for (i = 0; i <117; i++) {

   hatas = Math.floor(Math.random() * 180) + "s";
   spav = ".sdna" + i;
   $(spav).addClass('animated fadeIn');
   $(spav).css("animation-delay", hatas);

}



var target125 = $(".matuoklis1").offset().top; var interval = setInterval(function() {

   if ($(window).scrollTop() >= target125) {
       $(".i21").addClass('animated fadeIn');
       $(".i21").css("visibility","visible");
       $(".i22").css("visibility","visible");
       $(".i22").addClass('animated fadeIn');
       $(".prothold").addClass('animated fadeIn');
       $(".prothold").css("visibility","visible");
   }

}, 250);


var target15 = $(".i22").offset().top - 400; var interval = setInterval(function() {

   if ($(window).scrollTop() >= target15) {
       $(".i22").addClass('animated fadeIn');
       $(".i22").css("visibility","visible");
       $(".infhold2").addClass('animated fadeIn');
       $(".infhold2").css("visibility","visible");
   }

}, 250);


var target2 = $(".solartop").offset().top - 400; var interval = setInterval(function() {

   if ($(window).scrollTop() >= target2) {
       $(".startext").addClass('animated fadeIn');
       $(".startext").css("visibility","visible");
   }

}, 250);


function getRandomArbitrary(min, max) {

   return Math.random() * (max - min) + min;

}

var randomtime = getRandomArbitrary(0, 5) + "s"


var skaiciukas = 0

var target3 = $(".solartop").offset().top; var interval = setInterval(function() {

   if ($(window).scrollTop() >= target3) {
       $(".i24").addClass('animated fadeIn');
       $(".i24").css("visibility","visible");
       if (skaiciukas == 0) {
           for (i = 0; i <117; i++) {
               hatas = Math.floor(Math.random() * 180) + "s";
               spav = ".sdna" + i;
               $(spav).addClass('animated fadeIn');
               $(spav).css("animation-delay", hatas);
               skaiciukas = 1;
       }
       }
   }

}, 250);


var target4 = $(".solarbottom").offset().top; var interval = setInterval(function() {

   if ($(window).scrollTop() >= target4) {
       $(".i25").addClass('animated fadeIn');
       $(".i25").css("visibility","visible");
       $(".infhold").css("visibility","visible");
       $(".i26").addClass('animated fadeIn');
       $(".i26").css("visibility","visible"); 
       $(".logogrey").addClass('animated zoomInDown slower');
       $(".logogrey").css("visibility","visible");    
                     
   }

}, 250);


var counteris = 0 var target5 = $(".i26").offset().top; var interval = setInterval(function() {

   if ($(window).scrollTop() >= target5) {
       $(".dnalibrarytxt").addClass('animated fadeIn');
       $(".dnalibrarytxt").css("visibility","visible");
       $(".dnalibrary").addClass('animated fadeIn');
       $(".dnalibrary").css("visibility","visible");
       $(".dna11").addClass('animated fadeIn');
       setTimeout(adna11, 1000);
       $(".dna12").addClass('animated fadeIn');
       setTimeout(adna12, 1000);
       $(".dna13").addClass('animated fadeIn');
       setTimeout(adna13, 1000);
       $(".chippng").addClass('animated fadeIn slow delay-3s');
       $(".chippng").css("visibility","visible");
       if(counteris == 0){
           $("#mygtukas01").css("visibility","visible");
           $("#mygtukas01").addClass('animated fadeIn slow delay-1s');
       }
       counteris++
       
   }

}, 250);

function adna11() {

   $(".dna11").css("visibility","visible")

} function adna12() {

   $(".dna12").css("visibility","visible")

} function adna13() {

   $(".dna13").css("visibility","visible")

}

document.getElementById("mygtukas01").onclick = function() {mygtukas01()};

function mygtukas01() {

   $(".dnaarr1").addClass('animated fadeInDown');
   $(".dnaarr1").css("visibility","visible");
   setTimeout(encapsulationtxt, 000);
   setTimeout(animdna11, 0000);
   setTimeout(animdna12, 1000);
   setTimeout(animdna13, 2000);
   $("#mygtukas01").css("visibility","hidden");
   setTimeout(animdna21, 3000);
  
   setTimeout(droplet1, 5000);
   setTimeout(dnaarr21, 4500);
   setTimeout(dnaarr22, 4500);
   setTimeout(droplet2, 6000);
   $("#mygtukas1").addClass('animated fadeIn');
   $("#mygtukas1").css("visibility","visible");

}



var target6 = $(".dnalibrarytxt").offset().top - 50; var interval = setInterval(function() {

   if ($(window).scrollTop() >= target6) {


   }

}, 250);

function animdna11() {

   $(".dna11").css("animation-play-state","running")

} function animdna12() {

   $(".dna12").css("animation-name","dna12")

} function animdna13() {

   $(".dna13").css("animation-name","dna13")

}

function animdna21() {

   $(".dna11").css("animation-name","dna11, dna112")

}

function dnaarr1() {

   $(".dnaarr1").addClass('animated fadeInDown');
   $(".dnaarr1").css("visibility","visible");

} function encapsulationtxt() {

   $(".encapsulationtxt").addClass('animated fadeIn');
   $(".encapsulationtxt").css("visibility","visible");

} function encapsulationtxt2() {

   $(".encapsulationtxt2").addClass('animated fadeIn');
   $(".encapsulationtxt2").css("visibility","visible");

} function dnaarr21() {

   $(".dnaarr21").addClass('animated fadeInLeft');
   $(".dnaarr21").css("visibility","visible");

}function dnaarr22() {

   $(".dnaarr22").addClass('animated fadeInRight');
   $(".dnaarr22").css("visibility","visible");

} function droplet1() {

   $(".droplet1").addClass('animated fadeIn slower');
   $(".droplet1").css("animation-name","droplet1")
   $(".droplet1").css("visibility","visible");

} function droplet2() {

   $(".droplet2").addClass('animated fadeIn');
   $(".droplet2").css("visibility","visible");

}



document.getElementById("mygtukas1").onclick = function() {mygtukas1()};

function mygtukas1() {

   setTimeout(droplet21, 1000);
   setTimeout(droparr1, 2000);
   setTimeout(biomolecule1, 3000);
   $("#mygtukas1").css("visibility","hidden");
   $(".mygtukas1txt").css("visibility","visible");
   $("#mygtukas1txt").addClass('animated fadeIn');
   $("#mygtukas2").addClass('animated fadeIn delay-3s');
   $("#mygtukas2").css("visibility","visible");

}




document.getElementById("mygtukas2").onclick = function() {mygtukas2()};

function mygtukas2() {

       setTimeout(outarrow1, 000);
       setTimeout(droplet22, 1000);
       setTimeout(droparr2, 2000);
       setTimeout(recmod, 3000);
       $("#mygtukas2").css("visibility","hidden");
       $("#mygtukas3").addClass('animated fadeIn delay-3s');
       $("#mygtukas3").css("visibility","visible");
       $(".mygtukas2txt").css("visibility","visible");
       $("#mygtukas2txt").addClass('animated fadeIn');
   }



document.getElementById("mygtukas3").onclick = function() {mygtukas3()};

function mygtukas3() {

       setTimeout(outarrow2, 000);
       setTimeout(droplet23, 1000);
       setTimeout(droparr3, 2000);
       setTimeout(modif, 3000);
       $("#mygtukas3").css("visibility","hidden");
       $("#mygtukas4").addClass('animated fadeIn delay-3s');
       $("#mygtukas4").css("visibility","visible");
       $(".mygtukas3txt").css("visibility","visible");
       $("#mygtukas3txt").addClass('animated fadeIn');
   }


document.getElementById("mygtukas4").onclick = function() {mygtukas4()};

function mygtukas4() {

   setTimeout(moddna, 0000);
   setTimeout(moddnacolor, 0000);
   $(".nanoporeseq").css("visibility","visible");
   $(".nanoporeseq").addClass('animated fadeIn');
   $("#mygtukas4").css("visibility","hidden");
   $(".sudastekstas2").css("display","initial");
   $(".mygtukas4txt").css("visibility","visible");
   $("#mygtukas4txt").addClass('animated fadeIn');
   setTimeout(nanoarr1, 3500);
   $("#mygtukas5").css("visibility","visible");

   setTimeout(mygtukas4txt2, 8000);

}


function droplet21() {

   $(".droplet21").addClass('animated fadeIn');
   $(".droplet21").css("visibility","visible");

} function droparr1() {

   $(".droparr1").addClass('animated fadeIn');
   $(".droparr1").css("visibility","visible");

} function biomolecule1() {

   $(".biomolecule1").addClass('animated fadeIn');
   $(".biomolecule1").css("visibility","visible");

} function outarrow1() {

   $(".outarrow1").addClass('animated fadeIn');
   $(".outarrow1").css("visibility","visible");

} function droplet22() {

   $(".droplet22").addClass('animated fadeIn');
   $(".droplet22").css("visibility","visible");

} function droparr2() {

   $(".droparr2").addClass('animated fadeIn');
   $(".droparr2").css("visibility","visible");

} function recmod() {

   $(".recmod").addClass('animated fadeIn');
   $(".recmod").css("visibility","visible");

} function outarrow2() {

   $(".outarrow2").addClass('animated fadeIn');
   $(".outarrow2").css("visibility","visible");

} function droplet23() {

   $(".droplet23").addClass('animated fadeIn');
   $(".droplet23").css("visibility","visible");

} function droparr3() {

   $(".droparr3").addClass('animated fadeIn');
   $(".droparr3").css("visibility","visible");

} function modif() {

   $(".modif").addClass('animated fadeIn');
   $(".modif").css("visibility","visible");

} function moddna() {

   $(".moddna").css("animation-name","nanoporeseq");
   $(".moddna").css("visibility","visible");

} function moddnacolor() {

   $(".moddnacolor").css("animation-name","nanoporeseqcolor");
   $(".moddnacolor").css("visibility","visible");

}

function nanoarr1() {

   $(".nanoarr1").addClass("animated fadeInDown");
   $(".nanoarr1").css("visibility","visible");

} function nanoarr4() {

   $(".nanoarr4").addClass("animated fadeIn");
   $(".nanoarr4").css("visibility","visible");

} function mygtukas4txt2() {

   $(".mygtukas4txt2").addClass("animated fadeIn");
   $(".mygtukas4txt2").css("visibility","visible");

}

var wata = $(".igmA2").height()

var newsize = 25 / 1009 * watas var newsizepx = newsize + "px"

var watass = $(".igmXA").offset().top;



$(".encapsulationtxt").css("font-size",newsizepx);

function txtresize(reference, cssofinterest, fontsize, originalsize) {

   var watas = $(reference).height();
   var newsize = fontsize / originalsize * watas;
   var newsizepx = newsize + "px";
   $(cssofinterest).css("font-size",newsizepx);
   $(window).resize(function() {
       var watas = $(reference).height();
       var newsize = fontsize / originalsize * watas;
       var newsizepx = newsize + "px";
       $(cssofinterest).css("font-size",newsizepx);
   });

}

txtresize(".igmA2", ".introtxt5", "13.56", "1105") txtresize(".igmA2", ".introtxt10", "13.56", "1105") txtresize(".igmA2", ".introtxt16", "13.56", "1105") txtresize(".igmA2", ".introtxt22", "13.56", "1105") txtresize(".igmA2", ".introtxt26", "13.56", "1105") txtresize(".igmA2", ".introtxt28", "13.56", "1105") txtresize(".igmA2", ".introtxt32", "13.56", "1105") txtresize(".igmA2", ".introtxt35", "13.56", "1105") txtresize(".igmA2", ".i111", "13.56", "1105") txtresize(".igmA2", ".i112", "13.56", "1105") txtresize(".igmA2", ".i113", "16", "1105")

txtresize(".igmA2", ".i21", "13.56", "1105") txtresize(".igmA2", ".i22", "13.56", "1105") txtresize(".igmA2", ".startext", "13.56", "1105")

txtresize(".igmA2", ".i24", "13.56", "1105") txtresize(".igmA2", ".i25", "13.56", "1105") txtresize(".igmA2", ".i26", "13.56", "1105")


txtresize(".igmA2", ".dnalibrarytxt", "13.56", "1105") txtresize(".igmA2", ".encapsulationtxt", "11", "1105")

txtresize(".igmA2", ".mygtukas1txt", "11", "1105") txtresize(".igmA2", ".mygtukas2txt", "11", "1105") txtresize(".igmA2", ".mygtukas3txt", "11", "1105") txtresize(".igmA2", ".mygtukas4txt", "11", "1105") txtresize(".igmA2", ".mygtukas4txt2", "13.56", "1105") txtresize(".igmA2", ".mygtukas5txt", "13.56", "1105")

txtresize(".igmA2", ".outrotxt4", "13.56", "1105") txtresize(".igmA2", ".outrotxt10", "13.56", "1105") txtresize(".igmA2", ".outrotxt15", "13.56", "1105") txtresize(".igmA2", ".outrotxt23", "13.56", "1105")

document.getElementById("mygtukas5").onclick = function() {mygtukas5()};

function mygtukas5() {

   setTimeout(moddnacoloract, 0000);
   setTimeout(nanoarr4, 5000);
   $("#mygtukas5").css("visibility","hidden");
   $(".outrodiv").css("visibility","visible");

}

function moddnacoloract() {

   $(".moddnacoloract2").css("animation-name","moddnacoloract2");
   $(".moddnacoloract").css("animation-name","moddnacoloract1");
   $(".gnk1").addClass('animated fadeIn slower');
   $(".gnk1bar").css("animation-name","gnk1bar");
   $(".genukaiblack").addClass('animated fadeIn slower delay-5s');
   $(".genukaibar").css("animation-name","genukaibar");
   $(".genukaicolor").css("animation-name","genukaicolor");
   $(".mygtukas5txt").addClass('animated fadeIn');
   $(".outrotxt1").addClass('animated fadeIn slower');
   $(".outrotxt2").addClass('animated fadeIn slower');

}