Skip to content

Instantly share code, notes, and snippets.

@Osmiogrzesznik
Last active October 13, 2023 22:55
Show Gist options
  • Save Osmiogrzesznik/5783be425086e8481c893ea41e77a7cc to your computer and use it in GitHub Desktop.
Save Osmiogrzesznik/5783be425086e8481c893ea41e77a7cc to your computer and use it in GitHub Desktop.
fallsApart
javascript:void%20function(){function%20b(b,c){var%20d=Math.floor,e=Math.ceil;return%20b=e(b),c=d(c),d(Math.random()*(c-b+1))+b}async%20function%20c(b){say(%22ftextnodes%22,b),3==b.nodeType%3Fawait%20e(b):0,a=af(b);!(b.offsetHeight*b.offsetWidth)||4e3%3Ctns.length||(a.length%3Fb.offsetWidth%3C.7*k.offsetWidth%3Fg.push(b):0:g.push(b),a.length%3Fa.flatMap(c):0)}async%20function%20e(b){if(b.nodeValue.trim().length%26%26b.textContent.trim().length)if(words=b.nodeValue.trim().split(%22%20%22),2%3Ewords.length){var%20c=document.createElement(%22span%22);c.innerHTML=b.textContent,b.parentNode.insertBefore(c,b),b.parentNode.removeChild(b),g.push(c)}else%20words.forEach(c=%3E{var%20d=document.createElement(%22span%22);d.innerHTML=c+%22%20%22,b.parentNode.insertBefore(d,b),g.push(d)}),b.parentNode.removeChild(b)}async%20function%20f(){m=!0,k=document.body,say(%22d%22,k);let%20b=await%20c(k);styles=`%20%20%20%20.leaff{border:1px%20solid%20redlposition:relative;left:0;top:0;transition-duration:5s;transition-timing-function:cubic-bezier(%200.5,%200.01,%200.7,%200);%20%20%20%20}`;var%20d=document.createElement(%22style%22);d.innerText=styles,document.head.appendChild(d),g=g.filter(b=%3Eb.textContent.trim().length),g.forEach(b=%3Eb.classList.add(%22leaff%22)),doMess()}say=b=%3Eb,r=b=%3E(1-Math.random()*b).toFixed(2),mx=4,mxwh=100,transfact=2,rotfact=10,anl=3,persp=400,af=(b,c)=%3EArray.from(b.childNodes,c),arf=(b,c)=%3EArray.from({length:b},c),q=(b,c,d=1)=%3Earf(b,b=%3Er(d)).join(c),qcl=(...b)=%3Econsole.log(q(...b)),g=[],j=[],tns=[];wow=c=%3E{c%26%26(hasChildren=c.children%26%26c.children.length,isBig=c.offsetHeight*c.offsetWidth%3Emxwh,hasChildren%26%26isBig||(h=c.offsetHeight*c.offsetWidth+1,h/=1e4,c.parentElement.style.background=%22transparent%22,xs=c.style,xs.zIndex=%2210%22,xs.display=%22inline-block%22,xs.whiteSpace=%22pre-wrap%22,gg=b(-5,5),xs.color=%22transparent%22,xs.transform=%22perspective(%22+persp+%22px)%20translate3d(%22+[-100*gg,%22-200%22,%220%22].join(%22px,%22)+%22px)%20rotate3d(%22+[b(-2,2),b(-2,2),b(-2,2),b(-360,360)]+%22deg)%22,j.push(c),c.ontransitionend=b=%3Eb,g=g.filter(function(b){return%20b!==c}),g=g.filter(function(b){return%20b!==c})))},doMess=()=%3E{setTimeout(c=%3E{g.forEach(b=%3E{b.onmouseenter=b.ontouchstart=c=%3E{say(%22touched%22,b),wow(b)}}),setInterval(c=%3E{for(say(%22interval%22),i=0;i%3Cmx;i++)setTimeout(c=%3Ewow(g[b(0,g.length-1)]),b(250))},250)},30)};var%20g,j,k,l,m=!1;window.ontouchend=window.ontouchcancel=function(b){return%20l%26%26l%3CDate.now()-2e3%3Fvoid(m||setTimeout(f,250)):void(l=0)},window.ontouchstart=function(b){l=Date.now()}}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment