Deploy exoticorn/microw8 to exoticorn/microw8:gh-pages

This commit is contained in:
GitHub Actions committed 2025-01-22 19:26:28 +00:00
commit 4288aa9a72
27 files changed
+1637

No files matched your search

+1
View File
@@ -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;height:240px;image-rendering:pixelated;margin-bottom:8px;width:320px}#screen{cursor:none}#start{font-size:150%}#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.2.0-rc1 </div> <div id="centered"> <canvas class="screen" id="screen" width="320" height="240"> </canvas> <button class="screen" id="start" style="display:none">Click to start</button> <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}class t extends AudioWorkletNode{constructor(e){super(e,"apu",{outputChannelCount:[2]})}}let a=(...e)=>new Uint8Array(...e),A=(...e)=>new Uint32Array(...e);let r=function(r,s={}){s.setMessage||(s.setMessage=(e,t)=>{t&&console.log("error: "+t)});let n,B,o,i,l,d,c,u,f=r.getContext("2d"),F=f.createImageData(320,240),D=s.devkitMode,w=0,m=null==s.keyboardElement?r:s.keyboardElement;if(m){let e=e=>{let t,a="keydown"==e.type;switch(e.code){case"ArrowUp":t=1;break;case"ArrowDown":t=2;break;case"ArrowLeft":t=4;break;case"ArrowRight":t=8;break;case"KeyZ":t=16;break;case"KeyX":t=32;break;case"KeyA":t=64;break;case"KeyS":t=128;break;case"KeyR":a&&g(B,!0);break;case"F9":a&&r.toBlob((e=>{C(e,".png")})),e.preventDefault();break;case"F10":a&&function(){if(l)return l.stop(),l=null,c.disconnect(u),c=null,void(u=null);let e=r.captureStream();u=o.createMediaStreamDestination(),c=i,i.connect(u),e.addTrack(u.stream.getAudioTracks()[0]),l=new MediaRecorder(e,{mimeType:"video/webm",videoBitsPerSecond:25e6});let t=[];l.ondataavailable=e=>{t.push(e.data)};let a=s.timerElement;a&&(a.hidden=!1,a.innerText="00:00");function A(){if(d){if(a){let e=Math.floor((Date.now()-d)/1e3);a.innerText=Math.floor(e/60).toString().padStart(2,"0")+":"+(e%60).toString().padStart(2,"0")}setTimeout(A,1e3)}}l.onstop=()=>{a&&(a.hidden=!0),C(new Blob(t,{type:"video/webm"}),".webm")},l.start(),d=Date.now(),setTimeout(A,1e3)}(),e.preventDefault()}a?w|=t:w&=~t};m.onkeydown=e,m.onkeyup=e}async function g(l,d){n&&(n(),n=null),o=new AudioContext({sampleRate:44100});let c=!0,u=new AbortController;n=()=>{o.close(),c=!1,u.abort()};let m=l.byteLength;if(s.setMessage(m),0==m)return;await o.audioWorklet.addModule(e("data:application/javascript,let%20e%3D%28...e%29%3D%3Enew%20Uint8Array%28...e%29%3Bclass%20t%20extends%20AudioWorkletProcessor%7Bconstructor%28%29%7Bsuper%28%29%2Cthis.sampleIndex%3D0%2Cthis.port.onmessage%3Dt%3D%3E%7Bthis.memory%3FisNaN%28t.data%29%3Fe%28this.memory.buffer%2C80%2C32%29.set%28e%28t.data%29%29%3Athis.startTime%3Dt.data%3Athis.load%28t.data%5B0%5D%2Ct.data%5B1%5D%29%7D%7Dasync%20load%28e%2Ct%29%7Blet%20s%3Dnew%20WebAssembly.Memory%28%7Binitial%3A4%2Cmaximum%3A4%7D%29%2Ca%3D%7Benv%3A%7Bmemory%3As%7D%7D%3Bfor%28let%20e%20of%5B%22acos%22%2C%22asin%22%2C%22atan%22%2C%22atan2%22%2C%22cos%22%2C%22exp%22%2C%22log%22%2C%22sin%22%2C%22tan%22%2C%22pow%22%5D%29a.env%5Be%5D%3DMath%5Be%5D%3Bfor%28let%20e%3D9%3Be%3C64%3B%2B%2Be%29a.env%5B%22reserved%22%2Be%5D%3D%28%29%3D%3E%7B%7D%3Bfor%28let%20e%3D0%3Be%3C16%3B%2B%2Be%29a.env%5B%22g_reserved%22%2Be%5D%3D0%3Blet%20r%3Dasync%20e%3D%3E%28await%20WebAssembly.instantiate%28e%2Ca%29%29.instance%2Ci%3Dawait%20r%28e%29%3Bfor%28let%20e%20in%20i.exports%29a.env%5Be%5D%3Di.exports%5Be%5D%3Blet%20n%3Dawait%20r%28t%29%3Bthis.memory%3Ds%2Cthis.snd%3Dn.exports.snd%7C%7Ci.exports.gesSnd%2Cthis.port.postMessage%282%29%7Dprocess%28e%2Ct%2Cs%29%7Bif%28this.snd%26%26this.startTime%29%7Bnew%20Uint32Array%28this.memory.buffer%29%5B16%5D%3DDate.now%28%29-this.startTime%3Blet%20e%3Dt%5B0%5D%2Cs%3Dthis.sampleIndex%2Ca%3De%5B0Line truncated