1 line
985 B
JavaScript
1 line
985 B
JavaScript
import{d as l}from"./index-4bca499f.js";const i="/FlowOS/assets/org.gnome.Loupe-1c680d25.svg",g={config:{name:"Image Viewer",type:"process",icon:i,targetVer:"1.0.0-indev.0"},run:async t=>{if(Object.keys(t.data).length>0){const e=await t.loadLibrary("lib/WindowManager").then(a=>a.createWindow({title:"Image Viewer",icon:i,width:500,height:500},t)),o=t.fs,r=await t.loadLibrary("lib/MIMETypes"),d=await t.loadLibrary("lib/HTML"),n=async()=>{e.content.innerHTML="";const a=await o.readFile(t.data.path),c=`data:${r[t.data.path.split(".").at(-1)].type};base64,${encodeURIComponent(l.Buffer.from(a).toString("base64"))}`;new d("div").style({width:"100%",height:"100%",background:`url(${c})`,"background-size":"contain","background-position":"center","background-repeat":"no-repeat","aspect-ratio":"1 / 1"}).appendTo(e.content)};await n(),document.addEventListener("fs_update",()=>{n().catch(a=>console.error(a))});return}await t.kill(),await t.launch("apps/Files")}};export{g as default};
|