

 $(document).ready(function(){
   $("#open-menu").click(function(){
     $(".menu").animate({
       height: "toggle"
      });
   });

   $(".mbcontainer").click(function(){
     $(this).toggleClass( "change" );
   });

 });

 // function myFunction(x) {
   // x.classList.toggle("change");
// }

//--- Counter Function
function animate(obj, initVal, lastVal, duration) {
  let startTime = null;

//get the current timestamp and assign it to the currentTime variable
let currentTime = Date.now();

//pass the current timestamp to the step function
const step = (currentTime ) => {

//if the start time is null, assign the current time to startTime
if (!startTime) {
  startTime = currentTime ;
}

//calculate the value to be used in calculating the number to be displayed
const progress = Math.min((currentTime - startTime)/ duration, 1);

//calculate what to be displayed using the value gotten above
obj.innerHTML = Math.floor(progress * (lastVal - initVal) + initVal);

//checking to make sure the counter does not exceed the last value (lastVal)
if (progress < 1) {
  window.requestAnimationFrame(step);
} else {
     window.cancelAnimationFrame(window.requestAnimationFrame(step));
  }
};
//start animating
  window.requestAnimationFrame(step);
}
let text1 = document.getElementById('0100');
let text2 = document.getElementById('0101');

const load = () => {
  animate(text1, 0, 1800, 3000);
  animate(text2, 0, 180, 3000);
  
}
//--------------------


  $(document).ready(function(){
    $('.single-item-rtl').slick({
      rtl: true,
      dots: true,
      infinite: true,
      speed: 300,
      slidesToShow: 1,
      slidesToScroll: 1,
      responsive: [
        {
          breakpoint: 1024,
          settings: {
            slidesToShow: 1,
            slidesToScroll:1,
            infinite: true,
            dots: true
          }
        },
        {
          breakpoint: 600,
          settings: {
            slidesToShow: 1,
            slidesToScroll: 1
          }
        },
        {
          breakpoint: 480,
          settings: {
           slidesToShow: 1,
           slidesToScroll: 1
          }
        }
      ]
    });
        
});


$('.form-check-input').change(function () {
  if ($(this).prop("checked")) {
  
     $('#style2').attr("disabled","disabled");
     $('#style1').removeAttr("disabled");
  }
  else{
  
      $('#style2').removeAttr("disabled");
      $('#style1').attr("disabled","disabled");
   
  }
});



// $('.menu li').click(function(){
//   $('.menu li').removeClass("menu-item-active");
//   $(this).addClass("menu-item-active");
 
// });



$(window).scroll(function() {   if ($(this).scrollTop()>50)    {       $('.menu ').hide(500);  $('.mbcontainer').removeClass( "change" );
      myFunction(document);    }
 });



$(document).mouseup(function(e){
  var container = $(".hamburger-menu-btn");

  // If the target of the click isn't the container
  if(!container.is(e.target) && container.has(e.target).length === 0){
    $('.menu ').hide(500);
      $('.mbcontainer').removeClass( "change" );
  }
});




