Skip to content

Commit

Permalink
updated rt-gac to v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ponali committed Feb 15, 2024
1 parent ca70fdb commit f994d7b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions files/jsart/demos/rt-gac.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(()=>{
if(x+y==0){
if(!window.rtGac){
alert("Real-time Glitchart compilation -- created by @Ponali\n/!\\ CRT coloring effect may lag.\n\nChangelog:\nv1.0.1: Added 3 experiences.");
window.rtGac={expA:0,expB:0,crt:0,change:0};
alert("Real-time Glitchart compilation -- created by @Ponali\n/!\\ Some filters may lag.\n\nChangelog:\nv1.0.2: Added \"projector\" filter (blurs x-axis)\nv1.0.1: Added 3 experiences.");
window.rtGac={expA:0,expB:0,crt:0,proj:0,change:0};
};
if(window.rtGac.change<t){
window.rtGac.change=t+5000;
Expand All @@ -12,6 +12,7 @@
window.rtGac.expB=Math.floor(Math.random()*10);
};
window.rtGac.crt=Math.random()>=0.8;
window.rtGac.proj=Math.random()>=0.8;
};
};
function getExp(a){
Expand All @@ -31,9 +32,7 @@
};
if(window.rtGac.crt){x=Math.floor(x+(Math.random()*2)-1);};
let a=(getExp(window.rtGac.expA)&0xffffff)^(getExp(window.rtGac.expB)&0xffffff);
if(window.rtGac.crt){
return (()=>{ let out = a;function getRgb(val){return [(0xff0000&val)/0x10000,(0xff00&val)/0x100,0xff&val];};function getVal(rgb){return (rgb[0]*0x10000)+(rgb[1]*0x100)+rgb[2];};return getVal(getRgb(out).map((a)=>{return ((a/255)**2)*255}).map((a)=>{return Math.floor(a)})); })();
} else {
return a;
}
if(window.rtGac.crt){a = (()=>{ let out = a;function getRgb(val){return [(0xff0000&val)/0x10000,(0xff00&val)/0x100,0xff&val];};function getVal(rgb){return (rgb[0]*0x10000)+(rgb[1]*0x100)+rgb[2];};return getVal(getRgb(out).map((a)=>{return ((a/255)**2)*255}).map((a)=>{return Math.floor(a)})); })();}
if(window.rtGac.proj){a=((cb)=>{function getRGB(val){return [(val&0xff0000)/0x10000,(val&0xff00)/0x100,val&0xff];};function getVal(rgb){return rgb[0]*0x10000+rgb[1]*0x100+rgb[2]};if(!window.rtGac.projRam||typeof(window.rtGac.projRam)!="object"){window.rtGac.projRam=[0,0,0];};let ca=getRGB((cb)%0xffffff&0xffffff);window.rtGac.projRam=window.rtGac.projRam.map((a,i)=>{if(!a){return 1;};return a+((ca[i]-a)/(2+(Math.sin(t/700)*2)+Math.random()*5))});return getVal(window.rtGac.projRam.map((a)=>{return Math.floor(a)}));})(a);}
return a;
})()

0 comments on commit f994d7b

Please sign in to comment.