/* Add your JavaScript code here.

If you are using the jQuery library, then don't forget to wrap your code inside jQuery.ready() as follows:

jQuery(document).ready(function( $ ){
    // Your code in here
});

--

If you want to link a JavaScript file that resides on another server (similar to
<script src="https://example.com/your-js-file.js"></script>), then please use
the "Add HTML Code" page, as this is a HTML code that links a JavaScript file.

End of comment */ 
jQuery(document).ready(function( $ ){
  $("#logo").each(function () {
                    
    
   var i = 5;
        var j = 0;
        var timer, fade, red_dote_new;
            i = 5;
            j = 0;
            red_dote_new = document.getElementsByClassName("logo-red-dot");
    		for (index = 0; index < red_dote_new.length; ++index) {
    			red_dote_new[index].setAttribute("style", "opacity: 0;");
      			logo_demo_new = document.getElementsByClassName("logo-demo");
			}
            timer = setInterval(timerFunc, 20);
            setTimeout(stopTimer, 1900);
        
        function timerFunc() {
            i++;
            $(".logo-demo").html(i % 10 ? i % 10 : 'O');
          	
        }

        function timerFunc1() {
            $(".logo-demo").html(i % 2 ? 1 : 'O');
          	
            i++;
        }
        
        function stopTimer() {
            clearInterval(timer);
            setTimeout(ease, i);
        }
        
        function ease() {
            if ( i <= 105) {
                mVar = setTimeout(ease, (i - 96) * (i - 96) * (i - 96));
            } else {
                fade = setInterval(fadeRedDot, 40);
            }
            timerFunc1();
        }

        function fadeRedDot() {
            j += 0.05;
          for (index = 0; index < red_dote_new.length; ++index) {
    red_dote_new[index].setAttribute('style', "opacity: " + j + ";");
}
            if (j >= 1) {
                clearInterval(fade);
            }
        }
    });
});