// JavaScript Document
$(document).ready(function(){
	$("#post01").animatedModal();
	$("#post04").animatedModaltwo();
	$("#post05").animatedModalVideo();
new materialTouch('.md-ripple');
var item = $('.js-onebyone');

/*$(function() {
  $('.u_ex_wrap').each(function(i) {
  $(this).delay((i++) * 150).fadeTo(500,1); })
});*/

$.fn.animateIn = function(options) {
  var self = $(this);

  var settings = $.extend({
    cname: 'class',
  }, options);

  var action = function() {
    (function animate(counter) {

      setTimeout(function() {

        self.eq(counter).addClass(settings.cname);

        counter++;

        if (counter < self.length) animate(counter);

      }, 60);

    })(0);
  };
  action();
};

item.animateIn({
  cname: 'show'
});	

$(window).scroll(function() {
var theta = $(window).scrollTop() / 10 % Math.PI;
$('.leftgear').css({ transform: 'rotate(' + theta + 'rad)' });

});
/*Right settings menu*/
$('html').click(function() {
  $('.some-info-menu').removeClass("activated");
});

$('.some-info-menu ul li').each(function() {
    var delay = $(this).index() * 50 + 'ms';

    $(this).css({
        '-webkit-transition-delay': delay,
        '-moz-transition-delay': delay,
        '-o-transition-delay': delay,
        'transition-delay': delay
    });                  
});

$(".mat-menu").click (function(e){
  e.stopPropagation();
  $('.some-info-menu').toggleClass("activated");
});

 $('.some-info-menu').click (function(e){
  e.stopPropagation();
});

/*Left Menu Show hide*/
$('html').click(function() {
  $('.menu-area-wrap').removeClass("activedd");
});


$(".tt").click (function(e){
  e.stopPropagation();
  $('.menu-area-wrap').toggleClass("activedd");
});

 $('.menu-area-wrap').click (function(e){
  e.stopPropagation();
});

/*Image and Text Post*/
$(".open-post").on('click',function(){
  
   
    var state=$(this).data("state");
    if(state==="close")
    {
        $(this).data("state",'open');
    $(".post-container").animate({width:"100%"}, 10);
    }
    else
    {
        $(this).data("state",'close');
        $(".post-container").animate({width:"0%"}, 10);
    }
});

/*Select Post Tipe*/
$('html').click(function() {
  $('.select-post-tipe').removeClass("selected");
});

$(".icon-mail-send").click (function(e){
  e.stopPropagation();
  $('.select-post-tipe').toggleClass("selected");
});

 $('.select-post-tipe').click (function(e){
  e.stopPropagation();
});
/*Search Modal Button Clik*/
 $("#demo02, #demo03").animatedModal({
  modalTarget: 'modal-02',
  animatedIn: 'lightSpeedIn',
  animatedOut: 'bounceOutDown',
  color: "rgba(0, 0, 0, 0.25)",
  // Callbacks
  beforeOpen: function() {
   // console.log("The animation was called");
  },
  afterOpen: function() {
   // console.log("The animation is completed");
  },
  beforeClose: function() {
   // console.log("The animation was called");
  },
  afterClose: function() {
   // console.log("The animation is completed");
  }
});
$('html').click(function() {
  $('.block-menu').removeClass("active");
});

$('.block-menu ul li').each(function() {
    var delay = $(this).index() * 50 + 'ms';

    $(this).css({
        '-webkit-transition-delay': delay,
        '-moz-transition-delay': delay,
        '-o-transition-delay': delay,
        'transition-delay': delay
    });                  
});

$(".block_u").click (function(e){
  e.stopPropagation();
  $('.block-menu').toggleClass("active");
});

 $('.block-menu').click (function(e){
  e.stopPropagation();
});

});

