Spaces:
Build error
Build error
Download drop/view.html from autobahn247365/ghost: direct link, hf CLI and curl.
- Browser
- Download file 1.94 kB
-
https://huggingface.co/spaces/autobahn247365/ghost/resolve/main/drop/view.html
- Command line
-
hf download hf://spaces/autobahn247365/ghost/drop/view.html
-
curl -L -o view.html https://huggingface.co/spaces/autobahn247365/ghost/resolve/main/drop/view.html
1.94 kB
| <html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"> | |
| <title>👻</title> | |
| <style>body{margin:0;background:#05070d;color:#e8f0ff;font:16px system-ui;display:flex;align-items:center;justify-content:center;min-height:100vh;user-select:none;-webkit-user-select:none} | |
| canvas{max-width:96vw;border-radius:12px}#note{position:fixed;bottom:10px;width:100%;text-align:center;font-size:12px;opacity:.5}</style></head> | |
| <body oncontextmenu="return false"><canvas id="c"></canvas><div id="note"></div> | |
| <script> | |
| const unb=t=>Uint8Array.from(atob(t.replace(/-/g,'+').replace(/_/g,'/')+'==='.slice((t.length+3)%4)),c=>c.charCodeAt(0)); | |
| const note=document.getElementById('note'); | |
| function paint(lines,col){ | |
| const c=document.getElementById('c'),x=c.getContext('2d'),W=Math.min(900,innerWidth*0.96),lh=30; | |
| x.font='22px system-ui';const wrapped=[]; | |
| lines.forEach(L=>{let w='';L.split(' ').forEach(t=>{if(x.measureText(w+t).width>W-40){wrapped.push(w);w=''}w+=t+' '});wrapped.push(w)}); | |
| c.width=W;c.height=wrapped.length*lh+40;x.fillStyle='#0b1222';x.fillRect(0,0,c.width,c.height); | |
| x.font='22px system-ui';x.fillStyle=col;wrapped.forEach((w,i)=>x.fillText(w,20,40+i*lh)); | |
| } | |
| (async()=>{ | |
| const [id,iv,ct]=location.hash.slice(1).split('.'); | |
| if(!id){paint(['Nothing here.'],'#888');return} | |
| history.replaceState(null,'',location.pathname); | |
| const r=await fetch('../api/key/'+id); | |
| if(!r.ok){paint(['👻 Ghosted.','This drop is gone.'],'#ff3b3b');return} | |
| const {key}=await r.json(); | |
| const k=await crypto.subtle.importKey('raw',await crypto.subtle.digest('SHA-256',unb(key)),'AES-GCM',false,['decrypt']); | |
| try{const pt=new TextDecoder().decode(await crypto.subtle.decrypt({name:'AES-GCM',iv:unb(iv)},k,unb(ct))); | |
| paint(pt.split('\n'),'#e8f0ff');note.textContent='seen through the mirror · can vanish any time'; | |
| }catch(e){paint(['Broken mirror.'],'#ff3b3b')} | |
| })(); | |
| </script></body></html> | |