Upload a photo and pick a glass. Add motion and a hover, then put it on your site. The photo never leaves your device.
Effect
Output
Engine
WebGL, on the visitor’s GPU · no server
Exporting…
02Export
Your photo, its settings and a small engine. It runs on the visitor’s GPU — no server, nothing uploaded.
Use it anywhere.
Free. No account, no limits. The engine loads from this site; the ZIP has a copy if you want to host it yourself.
Drop to open
\nGlass FX\n\n'+files.tag(PHOTO,'display:block;width:min(640px,92vw);aspect-ratio:'+ratioStr())+'\n'},
{name:'README.txt',data:`GLASS FX export\n\n${PHOTO} the photo, already cropped to your frame\nGlassFx.tsx React wrapper (React, Next.js, Lovable, Bolt, v0)\nHero.tsx example usage with your settings\nframer/GlassFx.tsx Framer code component\nprompt.txt prompt for AI builders\nindex.html plain HTML example\n${fx?'fx.js the engine, if you want to host it yourself (change the script src to your copy)\n':''}\nThe engine loads from ${SCRIPT}\nOpen index.html through a web server, not by double-clicking: browsers block the photo for WebGL on file:// pages.\n`}];
if(fx)list.push({name:'fx.js',data:fx});await save(makeZip(list),'glass-fx.zip');track('tool_exported',{action:'zip'})}catch(e){toast('Could not build the ZIP')}});
const MT_NOTE={drift:'The glass pattern wanders slowly, the photo floats with it.',slide:'The pattern glides sideways without end.',breathe:'The effect softly fades in and out.',
sweep:'A clear band of light sweeps across the photo.',orbit:'The pattern circles around. Centred effects orbit their centre.',shimmer:'A light heat-haze tremble.'};
GlassEngine.MOTION_MODES.forEach(([m,n])=>{const b=document.createElement('button');b.className='chip';b.dataset.m=m;b.textContent=n;$('mtModes').appendChild(b)});
$('mtModes').addEventListener('click',e=>{const b=e.target.closest('button');if(!b)return;S.motion.mode=b.dataset.m;syncAll(true);commit()});
$('swMotion').addEventListener('click',()=>{S.motion.on=!S.motion.on;syncAll(true);commit()});
function syncMotion(){const M=S.motion;$('swMotion').classList.toggle('on',M.on);$('mtBox').style.display=M.on?'flex':'none';$('mtNote').textContent=M.on?MT_NOTE[M.mode]:'Keeps the photo alive without any cursor.';
[...$('mtModes').children].forEach(b=>b.classList.toggle('on',b.dataset.m===M.mode));const box=$('mtSl');box.innerHTML='';
box.appendChild(slider('Speed',M.speed,null,.4,v=>M.speed=v));if(M.mode!=='slide')box.appendChild(slider('Amount',M.amount,null,.5,v=>M.amount=v))}
/* ---------- finish (applies to the whole picture) ---------- */
function syncPost(){const b=$('postSl');b.innerHTML='';const P=S.post;
[['Brightness','b','bi',.5],['Contrast','c','bi',.5],['Saturation','s','bi',.5],['Grain','g',null,0],['Vignette','v',null,0]].forEach(([n,k,kind,d])=>b.appendChild(slider(n,P[k],kind,d,v=>P[k]=v)))}
$('bPostRst').addEventListener('click',()=>{S.post={...POST0};syncAll(true);commit()});
/* ---------- panel tabs ---------- */
function syncTabs(){[...$('ptabs').children].forEach(b=>b.classList.toggle('on',b.dataset.p===S.ptab));
document.querySelectorAll('#pbody>[data-p]').forEach(x=>x.style.display=x.dataset.p===S.ptab?'':'none');if(!S.layers[0].on)$('secSet').style.display='none';requestAnimationFrame(scrollHint)}
$('ptabs').addEventListener('click',e=>{const b=e.target.closest('button');if(!b)return;S.ptab=b.dataset.p;$('pbody').scrollTop=0;syncTabs()});
function scrollHint(){const p=$('pbody'),more=p.scrollHeight-p.scrollTop-p.clientHeight>8,up=p.scrollTop>8;p.classList.toggle('more',more);p.classList.toggle('up',up)}
$('pbody').addEventListener('scroll',scrollHint,{passive:true});addEventListener('resize',scrollHint);
window.__glass={get src(){return srcCanvas},trail,S,engine,exportBlob,syncAll,layout,pick,undo,redo,HS,openSheet,embedCfg,files,makeZip};
syncHist();boot();
})();