matrix-by-lmx 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of matrix-by-lmx might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.svg +1 -0
  2. package/package.json +1 -1
package/index.svg CHANGED
@@ -12,4 +12,5 @@
12
12
  (function(){var names={home:"New Tab",games:"Games",apps:"Apps",tools:"Utilities",settings:"Settings"},all=[],blobUrl="",player=document.getElementById("player"),frame=document.getElementById("frame"),proxy="https://31i1-3tig0-2ri9g3i02g423g12d1.vercel.app";function show(v){document.querySelectorAll(".view").forEach(function(x){x.classList.toggle("on",x.id===v)});document.querySelectorAll(".nav").forEach(function(x){x.classList.toggle("on",x.dataset.v===v)});document.getElementById("title").textContent=names[v]}document.querySelectorAll("[data-v]").forEach(function(x){x.onclick=function(){show(x.dataset.v)}});document.querySelectorAll("[data-go]").forEach(function(x){x.onclick=function(){show(x.dataset.go)}});function open(t,u){document.getElementById("pt").textContent=t;frame.src=u;player.classList.add("on")}async function openGame(g){document.getElementById("pt").textContent=g.name+" · Loading";player.classList.add("on");try{var url=g.url.replace("{HTML_URL}","https://cdn.jsdelivr.net/gh/bubbls/ugs-singlefile/UGS-Files"),r=await fetch(url),html=await r.text(),base=new URL(".",url).href;html=/<head[\s>]/i.test(html)?html.replace(/<head([^>]*)>/i,"<head$1><base href=\""+base+"\">"):"<base href=\""+base+"\">"+html;if(blobUrl)URL.revokeObjectURL(blobUrl);blobUrl=URL.createObjectURL(new Blob([html],{type:"text/html"}));frame.src=blobUrl;document.getElementById("pt").textContent=g.name}catch(e){document.getElementById("pt").textContent="Could not load "+g.name;frame.src="about:blank"}}document.getElementById("close").onclick=function(){player.classList.remove("on");frame.src="about:blank";if(blobUrl){URL.revokeObjectURL(blobUrl);blobUrl=""}};document.getElementById("reload").onclick=function(){var u=frame.src;frame.src="about:blank";setTimeout(function(){frame.src=u},20)};document.getElementById("search").onsubmit=function(e){e.preventDefault();var q=document.getElementById("q").value.trim();if(!q)return;document.getElementById("msg").textContent="Opening search inside Matrix…";open(q,"https://html.duckduckgo.com/html/?q="+encodeURIComponent(q))};
13
13
  var apps=[["YouTube","yt"],["Twitch","tw"],["ChatGPT","ai"],["Discord","dc"],["Instagram","ig"],["TikTok","tk"],["GitHub","gh"]],ag=document.getElementById("apps-grid");apps.forEach(function(a){var b=document.createElement("button");b.className="card";b.innerHTML="<small>PROXIED WEB APP</small><strong>"+a[0]+"</strong><span>Open through Matrix proxy ↗</span>";b.onclick=function(){open(a[0],proxy+"/browse?a="+a[1])};ag.appendChild(b)});
14
14
  function render(){var q=document.getElementById("game-search").value.toLowerCase(),list=all.filter(function(g){return g.name.toLowerCase().includes(q)}).slice(0,160),grid=document.getElementById("game-grid");grid.innerHTML="";list.forEach(function(g){var b=document.createElement("button");b.className="card";b.innerHTML="<small>COMMUNITY / HTML5</small><strong></strong><span>Launch inside Matrix ↗</span>";b.querySelector("strong").textContent=g.name;b.onclick=function(){openGame(g)};grid.appendChild(b)});document.getElementById("count").textContent=list.length+" shown / "+all.length}fetch("https://cdn.jsdelivr.net/gh/TongSherbet/storage/ugs.json").then(function(r){return r.json()}).then(function(d){all=d.filter(function(g){return g.name&&g.url});render()}).catch(function(){document.getElementById("count").textContent="Catalog unavailable"});document.getElementById("game-search").oninput=render;setInterval(function(){document.getElementById("clock").textContent=new Date().toLocaleTimeString()},1000);document.getElementById("edit").onclick=function(){var b=document.querySelector("foreignObject body");b.contentEditable=b.contentEditable==="true"?"false":"true"};document.getElementById("reset").onclick=function(){show("home")};
15
+ document.getElementById("search").onsubmit=function(e){e.preventDefault();var q=document.getElementById("q").value.trim();if(!q)return;document.getElementById("msg").textContent="Opening search inside Matrix…";open(q,proxy+"/browse?url="+encodeURIComponent("https://html.duckduckgo.com/html/?q="+encodeURIComponent(q)))};
15
16
  })();]]></script></body></html></foreignObject></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matrix-by-lmx",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Self-contained Matrix web workspace packaged as an XHTML-in-SVG app",
5
5
  "license": "ISC",
6
6
  "main": "index.svg",