function filter($state){
var x = document.getElementsByClassName($state);
var btn = document.getElementById($state);
if (btn.className == "btn"){
btn.className = btn.dataset.class;
for (i = 0; i < x.length; i++) {x[i].className = " animated fadeInLeft "+$state;}
}
else{
for (i = 0; i < x.length; i++) {x[i].className = " animated fadeOutRight "+$state;}
btn.className = "btn";
}
}