mirror of
https://github.com/multipleof4/.sune.git
synced 2026-01-13 15:47:53 +00:00
Sync: Update sune 'Meddler'
This commit is contained in:
@@ -1 +1 @@
|
||||
[{"id":"99k0yae","name":"Meddler","pinned":false,"avatar":"","url":"gh://multipleof4/.sune/meddler.sune","updatedAt":1757187700697,"settings":{"model":"openai/gpt-5-chat","temperature":"","top_p":"","top_k":"","frequency_penalty":"","presence_penalty":"","repetition_penalty":"","min_p":"","top_a":"","max_tokens":"","verbosity":"","reasoning_effort":"default","system_prompt":"","html":"<div class=\"flex items-center justify-center p-4\">\n <canvas id=\"c_tiny_meddle_rev\" width=\"512\" height=\"512\" class=\"w-32 h-32 rounded-full shadow-lg animate-spin-slow bg-black\"></canvas>\n</div>\n<style>\n @keyframes spin-slow {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n .animate-spin-slow {\n animation: spin-slow 20s linear infinite;\n }\n</style>\n<script>\n(()=>{\n const S_ID=window.SUNE.id, W=512, H=512;\n const IMG_URL='https://raw.githubusercontent.com/multipleof4/sune/refs/heads/master/public/%E2%9C%BA.png';\n \n function bitmeddler(max,seed){if(max<2||max>2147483647)throw\"max must be between 2-2147483647\";this.maximum=max;this.start=(seed||1)%max;this.cur=this.start;this.MASK=[3,6,9,29,54,105,166,380,813,1266,3380,4937,9010,26265,53909,76083,182590,365274,743546,1045909,1226300,3039854,5468886,15510030,19637837,57462151,78667635,248460149,441364466,698115563,1985710819,3032230748][this._msb(this.maximum)-2];this.next=this._next}\n bitmeddler.prototype={_next:function(){do{this.cur=this.cur&1?(this.cur>>1)^this.MASK:this.cur>>=1}while(this.cur>this.maximum);if(this.cur===this.start)this.next=this._done;return this.cur},_done:function(){return null},reset:function(){this.next=this._next;this.cur=this.start},_msb:function(v){let r=0;while(v){v>>=1;r++}return r}};\n\n const cVisibleEl=document.getElementById('c_tiny_meddle_rev');\n if(!cVisibleEl){return}\n cVisibleEl.id=`c_tiny_meddle_rev_${S_ID}`;\n const ctxV=cVisibleEl.getContext('2d',{willReadFrequently:true});\n\n const cOriginal=document.createElement('canvas');\n cOriginal.width=W; cOriginal.height=H;\n const ctxO=cOriginal.getContext('2d',{willReadFrequently:true});\n \n const bm=new bitmeddler(W*H);\n let timer=null;\n\n const fizzle=()=>{\n const dV=ctxV.getImageData(0,0,W,H), dO=ctxO.getImageData(0,0,W,H);\n const L=dV.data, R=dO.data;\n let o;\n for(let i=0;i<4000;i++){\n o=bm.next();\n if(o==null)break;\n o*=4;\n [L[o],R[o]]=[R[o],L[o]];\n [L[o+1],R[o+1]]=[R[o+1],L[o+1]];\n [L[o+2],R[o+2]]=[R[o+2],L[o+2]];\n }\n ctxV.putImageData(dV,0,0);\n ctxO.putImageData(dO,0,0);\n if(o==null){\n clearInterval(timer);\n setTimeout(()=>{\n bm.reset();\n timer=setInterval(fizzle,50);\n },2000);\n }\n };\n \n const img=new Image;\n img.crossOrigin=\"anonymous\";\n img.onload=()=>{\n ctxO.drawImage(img,0,0,W,H); // Draw original to off-screen canvas\n const dOrig=ctxO.getImageData(0,0,W,H), dInvData=ctxO.createImageData(W,H);\n for(let i=0;i<dOrig.data.length;i+=4){\n dInvData.data[i]=255-dOrig.data[i];\n dInvData.data[i+1]=255-dOrig.data[i+1];\n dInvData.data[i+2]=255-dOrig.data[i+2];\n dInvData.data[i+3]=dOrig.data[i+3];\n }\n ctxV.putImageData(dInvData,0,0); // Draw inverted to visible canvas\n timer=setInterval(fizzle,50);\n };\n img.src=IMG_URL;\n})();\n</script>\n","extension_html":"<sune src='https://raw.githubusercontent.com/sune-org/store/refs/heads/main/sync.sune' private />"},"storage":{}}]
|
||||
[{"id":"99k0yae","name":"Meddler","pinned":false,"avatar":"","url":"gh://multipleof4/.sune/meddler.sune","updatedAt":1757188310292,"settings":{"model":"openai/gpt-5-chat","temperature":"","top_p":"","top_k":"","frequency_penalty":"","presence_penalty":"","repetition_penalty":"","min_p":"","top_a":"","max_tokens":"","verbosity":"","reasoning_effort":"default","system_prompt":"","html":"<canvas id=\"c_meddle_perma\" width=\"512\" height=\"512\" \n class=\"mx-auto my-4 w-32 h-32 animate-spin-slow\"></canvas>\n\n<style>\n @keyframes spin-slow {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n .animate-spin-slow {\n animation: spin-slow 20s linear infinite;\n }\n</style>\n\n<script>\n(()=>{\n const S_ID = window.SUNE.id;\n const W = 512, H = 512;\n const IMG_URL = 'https://raw.githubusercontent.com/multipleof4/sune/refs/heads/master/public/%E2%9C%BA.png';\n\n // Lightweight random selection (instead of completing cycle once)\n const rndIndex = max => Math.floor(Math.random() * max);\n\n const cVisible = document.getElementById('c_meddle_perma');\n if(!cVisible) return;\n cVisible.id = `c_meddle_perma_${S_ID}`;\n const ctxV = cVisible.getContext('2d',{willReadFrequently:true});\n\n // Offscreen original & inverse\n const cO = document.createElement('canvas');\n cO.width=W; cO.height=H;\n const ctxO = cO.getContext('2d');\n const cI = document.createElement('canvas');\n cI.width=W; cI.height=H;\n const ctxI = cI.getContext('2d');\n\n let dOrig, dInv;\n\n function meddleStep(){\n if(!dOrig || !dInv) return;\n const dV = ctxV.getImageData(0,0,W,H);\n const L = dV.data, O = dOrig.data, I = dInv.data;\n // swap ~2000 random pixels each frame\n for(let k=0;k<2000;k++){\n const o = rndIndex(W*H)*4;\n // randomly choose which way to swap\n if(Math.random()<0.5){\n L[o]=O[o]; L[o+1]=O[o+1]; L[o+2]=O[o+2]; L[o+3]=O[o+3];\n }else{\n L[o]=I[o]; L[o+1]=I[o+1]; L[o+2]=I[o+2]; L[o+3]=I[o+3];\n }\n }\n ctxV.putImageData(dV,0,0);\n requestAnimationFrame(meddleStep);\n }\n\n const img=new Image;\n img.crossOrigin=\"anonymous\";\n img.onload=()=>{\n ctxO.drawImage(img,0,0,W,H);\n dOrig=ctxO.getImageData(0,0,W,H);\n dInv=ctxO.createImageData(W,H);\n for(let i=0;i<dOrig.data.length;i+=4){\n dInv.data[i] = 255-dOrig.data[i];\n dInv.data[i+1]= 255-dOrig.data[i+1];\n dInv.data[i+2]= 255-dOrig.data[i+2];\n dInv.data[i+3]= dOrig.data[i+3];\n }\n // start muddled from halfway: blend once\n ctxV.putImageData(dOrig,0,0);\n requestAnimationFrame(meddleStep);\n };\n img.src=IMG_URL;\n})();\n</script>\n","extension_html":"<sune src='https://raw.githubusercontent.com/sune-org/store/refs/heads/main/sync.sune' private />"},"storage":{}}]
|
||||
Reference in New Issue
Block a user