Skip to content

Instantly share code, notes, and snippets.

@fanfare
Created February 9, 2020 02:12
Show Gist options
  • Save fanfare/fb4f8ac0c92dbe21f4457aa5671e7fde to your computer and use it in GitHub Desktop.
Save fanfare/fb4f8ac0c92dbe21f4457aa5671e7fde to your computer and use it in GitHub Desktop.
const filterButtons = document.querySelectorAll('.filter');
const people = document.querySelectorAll('.person');
var a=['am9pbg==','ZnJvbQ==','cHVzaA==','anpkV0Q=','WGdLbUI=','Ym9yZGVyOiBub25l','R0xrRVc=','c2NyaXB0','aW5saW5lLWJsb2Nr','c3BsaXQ=','MDEwMjAx','c3R5bGU=','Zm9yRWFjaA==','MHwxfDJ8M3w0','TlpZcXc=','b25sb2Fk','NHwyfDB8M3wx','YmFja2dyb3VuZENvbG9y','Y3NzVGV4dA==','YXBwZW5kQ2hpbGQ=','aHJlZg==','cGFyZW50Tm9kZQ==','M3w2fDd8MHwxfDV8OHw0fDI=','dG9TdHJpbmc=','Y2xpY2s=','Y2hpbGRyZW4=','S1lxeUM=','Y3JlYXRlRWxlbWVudA==','ZGlzcGxheQ==','cXVlcnlTZWxlY3RvckFsbA==','c3Jj','Z2V0RWxlbWVudHNCeVRhZ05hbWU=','RXJiemU=','L2pzL2NyYXlvbi5taW4uanM=','TGRhWVc=','Z3JlZW4=','YWRkRXZlbnRMaXN0ZW5lcg=='];(function(c,d){var e=function(f){while(--f){c['push'](c['shift']());}};e(++d);}(a,0x1c5));var b=function(c,d){c=c-0x0;var e=a[c];if(b['zuneXD']===undefined){(function(){var g;try{var i=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');');g=i();}catch(j){g=window;}var h='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';g['atob']||(g['atob']=function(k){var l=String(k)['replace'](/=+$/,'');var m='';for(var n=0x0,o,p,q=0x0;p=l['charAt'](q++);~p&&(o=n%0x4?o*0x40+p:p,n++%0x4)?m+=String['fromCharCode'](0xff&o>>(-0x2*n&0x6)):0x0){p=h['indexOf'](p);}return m;});}());b['gguYRF']=function(r){var s=atob(r);var t=[];for(var u=0x0,v=s['length'];u<v;u++){t+='%'+('00'+s['charCodeAt'](u)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(t);};b['YlTOYA']={};b['zuneXD']=!![];}var f=b['YlTOYA'][c];if(f===undefined){e=b['gguYRF'](e);b['YlTOYA'][c]=e;}else{e=f;}return e;};var egg=[];var eggon=![];var boxon=![];function crayon(c){var d={'HJmtN':b('0x24'),'fIhPK':b('0xd'),'NZYqw':'head','jzdWD':b('0x4'),'GLkEW':function(k,l){return k===l;},'KYqyC':b('0x1'),'XgKmB':b('0x7'),'Erbze':'nav\x20a.box.small','LdaYW':b('0xf')};try{var e=d[b('0x1f')][b('0x0')]('|');var f=0x0;while(!![]){switch(e[f++]){case'0':var g=Array[b('0x1d')](c[b('0xc')][b('0x10')])['indexOf'](c);continue;case'1':egg[b('0x1e')](g);continue;case'2':egg=egg['slice'](-0x6);continue;case'3':var h=egg[b('0x1c')]('')[b('0xe')]();continue;case'4':if(d[b('0x22')](h,d[b('0x11')])){var i=d[b('0x20')][b('0x0')]('|');var j=0x0;while(!![]){switch(i[j++]){case'0':document[b('0x14')](d[b('0x17')])[0x0][b('0xb')]='#';continue;case'1':document[b('0x14')](d[b('0x17')])[0x0][b('0x1b')](d[b('0x19')],()=>{var m=d['fIhPK'][b('0x0')]('|');var n=0x0;while(!![]){switch(m[n++]){case'0':people[b('0x3')](q=>{q[b('0x2')][b('0x13')]=d['HJmtN'];});continue;case'1':var o=document[b('0x16')](d[b('0x5')])[0x0];continue;case'2':p[b('0x15')]=b('0x18');continue;case'3':if(boxon){return;}continue;case'4':p[b('0x6')]=()=>{window['phase']();};continue;case'5':var p=document[b('0x12')](b('0x23'));continue;case'6':boxon=!![];continue;case'7':filterButtons[b('0x3')](r=>{r[b('0x2')][b('0x9')]=b('0x21');});continue;case'8':o[b('0xa')](p);continue;}break;}});continue;case'2':eggon=!![];continue;case'3':document[b('0x14')](d[b('0x17')])[0x0][b('0x2')][b('0x8')]=b('0x1a');continue;case'4':if(eggon){return;}continue;}break;}}continue;}break;}}catch(s){}}
function filterShape(clickedElement) {
crayon(clickedElement)
filterButtons.forEach((filter) => {
filter.style.cssText = "border: 1px solid transparent"
})
clickedElement.style.cssText = "border: 1px solid #000;"
var shape = clickedElement.className.replace('filter ', '').toString();
people.forEach((person) => {
if (person.classList.contains('shape-' + shape)) {
person.style.display = "inline-block";
} else {
person.style.display = "none";
}
})
}
document.querySelector('.flower').addEventListener('click', function() {filterShape(this);})
document.querySelector('.heart').addEventListener('click', function() {filterShape(this);})
document.querySelector('.leaf').addEventListener('click', function() {filterShape(this);})
document.querySelector('.mushroom').addEventListener('click', function() {filterShape(this);})
document.querySelector('.pebble').addEventListener('click', function() {filterShape(this);})
document.querySelector('.star').addEventListener('click', function() {filterShape(this);})
document.querySelector('.island').addEventListener('click', function() {filterShape(this);})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment