mirror of
https://github.com/exoticorn/microw8.git
synced 2026-11-14 07:17:19 +01:00
Deploy exoticorn/microw8 to exoticorn/microw8:gh-pages
This commit is contained in:
commit
eebe4418bc
24 files changed
+1562
No files matched your search
@@ -0,0 +1 @@
|
||||
<!doctype html><html><head><meta charset="utf8"><title>MicroW8</title><link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@500&display=swap" rel="stylesheet"><style>body,canvas,html{margin:0;padding:0}html{background-color:#202024;color:#808070;font-family:Josefin Sans,Verdana,Arial Black,sans-serif}body,html{height:100%}body{display:grid;grid-template-rows:1fr 0fr}#uw8{position:absolute}#uw8 a{font-size:130%}#centered{align-self:center;justify-self:center}a{color:#303630}a:hover{color:#405040}#screen{background-color:#202428;border:4px solid #303040;box-shadow:5px 5px 20px #000;cursor:none;height:240px;image-rendering:pixelated;margin-bottom:8px;width:320px}#timer:before{background-color:red;border-radius:6px;content:"";display:inline-block;height:12px;margin-right:3px;width:12px}#message{margin-bottom:8px}.error{color:#e04030}button{background-color:#303440;border:1px solid #404040;border-radius:4px;color:#808070;font-family:inherit;padding:4px}button:hover{background-color:#202010}button:active{background-color:#504450}@media (min-width:680px) and (min-height:620px){#screen{height:480px;width:640px}}@media (min-width:1000px) and (min-height:800px){#screen{height:720px;width:960px}}@media (width:640px) and (height:480px){#screen{border:0;height:480px;margin:0;width:640px}body{overflow:hidden}}</style></head><body> <div id="uw8"> <a href="https://exoticorn.github.io/microw8">MicroW8</a> 0.1.1 </div> <div id="centered"> <canvas id="screen" width="320" height="240"> </canvas> <div id="timer" hidden></div> <div id="message"></div> <button id="cartButton" style="visibility:hidden">Load cart...</button> </div> <div id="footer"> <a href="http://unlicense.org/" ref="license">Unlicense</a> </div> </body><script type="module">function e(e){return e&&e.__esModule?e.default:e}function A(e,A){let t=e?`${e} bytes`:"Insert cart";A&&(t+=` - <span class="error">${A.replaceAll("<","<")}</span>`),document.getElementById("message").innerHTML=t}let t,a,n,r,B,o=document.getElementById("screen"),i=o.getContext("2d"),s=i.createImageData(320,240),l=e=>new Uint8Array(e),c=e=>new Uint32Array(e),F=0,Q=e=>{let A,t="keydown"==e.type;switch(e.code){case"ArrowUp":A=1;break;case"ArrowDown":A=2;break;case"ArrowLeft":A=4;break;case"ArrowRight":A=8;break;case"KeyZ":A=16;break;case"KeyX":A=32;break;case"KeyA":A=64;break;case"KeyS":A=128;break;case"KeyR":t&&f(n,!0);break;case"F9":t&&o.toBlob((e=>{E(e,".png")})),e.preventDefault();break;case"F10":t&&function(){if(r)return r.stop(),void(r=null);r=new MediaRecorder(o.captureStream(),{mimeType:"video/webm",videoBitsPerSecond:25e6});let e=[];r.ondataavailable=A=>{e.push(A.data)};let A=document.getElementById("timer");function t(){if(!B)return;let e=Math.floor((Date.now()-B)/1e3);A.innerText=Math.floor(e/60).toString().padStart(2,"0")+":"+(e%60).toString().padStart(2,"0"),setTimeout(t,1e3)}A.hidden=!1,A.innerText="00:00",r.onstop=()=>{A.hidden=!0,E(new Blob(e,{type:"video/webm"}),".webm")},r.start(),B=Date.now(),setTimeout(t,1e3)}(),e.preventDefault()}t?F|=A:F&=~A};async function f(r,B){a&&(a(),a=null);let Q=r.byteLength;if(A(Q),0==Q)return;n=r;let E=window.location.pathname;if(Q<=1024&&!B){let e="";for(let A of l(r))e+=String.fromCharCode(A);E+="#"+btoa(e),E!=window.location.pathname+window.location.hash&&history.pushState(null,null,E)}o.width=o.width;try{let B={initial:4};t||(B.maximum=4);let o,E=new WebAssembly.Memory({initial:4,maximum:t?16:4}),g=l(E.buffer),w={env:{memory:E}},I=e=>{if(o&&(!t||0!=l(e)[0])){g.set(l(e));let A=o.exports.load_uw8(e.byteLength);e=new ArrayBuffer(A),l(e).set(g.slice(0,A))}return e},d=async e=>(await WebAssembly.instantiate(e,w)).instance,h=async e=>d(I(await(await fetch(e)).arrayBuffer()));o=await h(e("data:application/wasm;base64,AGFzbQEAAAABFQRgAX8Bf2ACf38Bf2ADf39%2FAGAAAAIPAQNlbnYGbWVtb3J5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