diff --git a/web/dist/js/115.90d.js b/web/dist/js/115.90d.js deleted file mode 100644 index d168d2b..0000000 --- a/web/dist/js/115.90d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(()=>{var J=(h,w)=>()=>(w||h((w={exports:{}}).exports,w),w.exports);var G=(h,w,i)=>new Promise((n,p)=>{var s=r=>{try{d(i.next(r))}catch(T){p(T)}},b=r=>{try{d(i.throw(r))}catch(T){p(T)}},d=r=>r.done?n(r.value):Promise.resolve(r.value).then(s,b);d((i=i.apply(h,w)).next())});var O=J(V=>{(self.webpackChunkcreate_wasm_app=self.webpackChunkcreate_wasm_app||[]).push([[115],{35:(h,w,i)=>{i.a(h,(n,p)=>G(V,null,function*(){try{i.d(w,{Pd:()=>b.Pd,bL:()=>b.bL});var s=i(914),b=i(889),d=n([s]);s=(d.then?(yield d)():d)[0],(0,b.oT)(s),p()}catch(r){p(r)}}))},889:(h,w,i)=>{i.d(w,{KM:()=>Z,Or:()=>I,Pd:()=>x,a2:()=>Y,bL:()=>A,iX:()=>$,mI:()=>k,oT:()=>p,ug:()=>L}),h=i.hmd(h);let n;function p(t){n=t}const s=new Array(128).fill(void 0);s.push(void 0,null,!0,!1);function b(t){return s[t]}let d=s.length;function r(t){t<132||(s[t]=d,d=t)}function T(t){const e=b(t);return r(t),e}const C=typeof TextDecoder=="undefined"?(0,h.require)("util").TextDecoder:TextDecoder;let B=new C("utf-8",{ignoreBOM:!0,fatal:!0});B.decode();let M=null;function S(){return(M===null||M.byteLength===0)&&(M=new Uint8Array(n.memory.buffer)),M}function l(t,e){return t=t>>>0,B.decode(S().subarray(t,t+e))}let a=null;function v(){return(a===null||a.byteLength===0)&&(a=new Int32Array(n.memory.buffer)),a}function m(t){d===s.length&&s.push(s.length+1);const e=d;return d=s[e],s[e]=t,e}let u=0;const E=typeof TextEncoder=="undefined"?(0,h.require)("util").TextEncoder:TextEncoder;let j=new E("utf-8");const X=typeof j.encodeInto=="function"?function(t,e){return j.encodeInto(t,e)}:function(t,e){const o=j.encode(t);return e.set(o),{read:t.length,written:o.length}};function N(t,e,o){if(o===void 0){const y=j.encode(t),z=e(y.length,1)>>>0;return S().subarray(z,z+y.length).set(y),u=y.length,z}let c=t.length,f=e(c,1)>>>0;const F=S();let g=0;for(;g127)break;F[f+g]=y}if(g!==c){g!==0&&(t=t.slice(g)),f=o(f,c,c=g+t.length*3,1)>>>0;const y=S().subarray(f+g,f+c),z=X(t,y);g+=z.written}return u=g,f}function H(t){return()=>{throw new Error(`${t} is not defined`)}}const A=Object.freeze({Dead:0,0:"Dead",Alive:1,1:"Alive"});class x{static __wrap(e){e=e>>>0;const o=Object.create(x.prototype);return o.__wbg_ptr=e,o}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,e}free(){const e=this.__destroy_into_raw();n.__wbg_universe_free(e)}tick(){n.universe_tick(this.__wbg_ptr)}set_width(e){n.universe_set_width(this.__wbg_ptr,e)}width(){return n.universe_width(this.__wbg_ptr)>>>0}set_height(e){n.universe_set_height(this.__wbg_ptr,e)}height(){return n.universe_height(this.__wbg_ptr)>>>0}set_speed(e){n.universe_set_speed(this.__wbg_ptr,e)}cells(){return n.universe_cells(this.__wbg_ptr)}toggle_cell(e,o){n.universe_toggle_cell(this.__wbg_ptr,e,o)}reset(){n.universe_reset(this.__wbg_ptr)}random(){n.universe_random(this.__wbg_ptr)}static new(e,o){const c=n.universe_new(e,o);return x.__wrap(c)}resize(e,o){n.universe_resize(this.__wbg_ptr,e,o)}render(){let e,o;try{const F=n.__wbindgen_add_to_stack_pointer(-16);n.universe_render(F,this.__wbg_ptr);var c=v()[F/4+0],f=v()[F/4+1];return e=c,o=f,l(c,f)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,o,1)}}}function Y(){const t=new Error;return m(t)}function Z(t,e){const o=b(e).stack,c=N(o,n.__wbindgen_malloc,n.__wbindgen_realloc),f=u;v()[t/4+1]=f,v()[t/4+0]=c}function $(t,e){let o,c;try{o=t,c=e,console.error(l(t,e))}finally{n.__wbindgen_free(o,c,1)}}function L(t){T(t)}const k=typeof Math.random=="function"?Math.random:H("Math.random");function I(t,e){throw new Error(l(t,e))}},115:(h,w,i)=>{i.a(h,(n,p)=>G(V,null,function*(){try{i.r(w);var s=i(35),b=i(914),d=n([s,b]);[s,b]=d.then?(yield d)():d;const r=10,T="#e5e5e5",C="#FFFFFF",B="#000000",M=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),S=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0);let l=Math.floor(M/(r+1)),a=Math.floor(S/(r+1));const v=s.Pd.new(l,a);window.addEventListener("resize",t=>{const e=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),o=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0);Math.floor(e/(r+1))==l&&Math.floor(o/(r+1))==a||(l=Math.floor(e/(r+1)),a=Math.floor(o/(r+1)),v.resize(l,a),m.height=a*(r+1)+1,m.width=l*(r+1)+1,x())});const m=document.getElementById("game-of-life-canvas");m.height=a*(r+1)+1,m.width=l*(r+1)+1;const u=m.getContext("2d");let E=null;const j=()=>{L(),I(),v.tick(),E=requestAnimationFrame(j)},X=()=>E===null,N=document.getElementById("play-pause"),H=document.getElementById("play-pause-icon"),A=()=>{H.className="bi bi-pause-fill",j()},x=()=>{H.className="bi bi-play-fill",L(),I(),cancelAnimationFrame(E),E=null};N.addEventListener("click",t=>{X()?A():x()}),document.getElementById("reset").addEventListener("click",t=>{v.reset(),x(),L(),I()}),document.getElementById("random").addEventListener("click",t=>{v.random(),L(),I()}),document.getElementById("speed").addEventListener("input",t=>{v.set_speed(t.target.value)}),m.addEventListener("click",t=>{const e=m.getBoundingClientRect(),o=m.width/e.width,c=m.height/e.height,f=(t.clientX-e.left)*o,F=(t.clientY-e.top)*c,g=Math.min(Math.floor(F/(r+1)),a-1),y=Math.min(Math.floor(f/(r+1)),l-1);v.toggle_cell(g,y),L(),I()});const L=()=>{u.beginPath(),u.strokeStyle=T;for(let t=0;t<=l;t++)u.moveTo(t*(r+1)+1,0),u.lineTo(t*(r+1)+1,(r+1)*a+1);for(let t=0;t<=a;t++)u.moveTo(0,t*(r+1)+1),u.lineTo((r+1)*l+1,t*(r+1)+1);u.stroke()},k=(t,e)=>t*l+e,I=()=>{const t=v.cells(),e=new Uint8Array(b.memory.buffer,t,l*a);u.beginPath();for(let o=0;o{var n=i(889);h.exports=i.v(w,h.id,"70c7a3d4af60d9e17b97",{"./wasm_game_of_life_bg.js":{__wbg_new_abda76e883ba8a5f:n.a2,__wbg_stack_658279fe44541cf6:n.KM,__wbg_error_f851667af71bcfc6:n.iX,__wbindgen_object_drop_ref:n.ug,__wbg_random_5f61cd0d6777a993:n.mI,__wbindgen_throw:n.Or}})}}])});O();})(); diff --git a/web/dist/js/115.e39.js b/web/dist/js/115.e39.js new file mode 100644 index 0000000..233ea11 --- /dev/null +++ b/web/dist/js/115.e39.js @@ -0,0 +1 @@ +"use strict";(()=>{var q=(d,w)=>()=>(w||d((w={exports:{}}).exports,w),w.exports);var G=(d,w,c)=>new Promise((n,y)=>{var s=o=>{try{a(c.next(o))}catch(j){y(j)}},g=o=>{try{a(c.throw(o))}catch(j){y(j)}},a=o=>o.done?n(o.value):Promise.resolve(o.value).then(s,g);a((c=c.apply(d,w)).next())});var J=q(V=>{(self.webpackChunkcreate_wasm_app=self.webpackChunkcreate_wasm_app||[]).push([[115],{35:(d,w,c)=>{c.a(d,(n,y)=>G(V,null,function*(){try{c.d(w,{Pd:()=>g.Pd,bL:()=>g.bL});var s=c(914),g=c(889),a=n([s]);s=(a.then?(yield a)():a)[0],(0,g.oT)(s),y()}catch(o){y(o)}}))},889:(d,w,c)=>{c.d(w,{KM:()=>Z,Or:()=>z,Pd:()=>k,a2:()=>Y,bL:()=>A,iX:()=>$,mI:()=>N,oT:()=>y,ug:()=>x}),d=c.hmd(d);let n;function y(e){n=e}const s=new Array(128).fill(void 0);s.push(void 0,null,!0,!1);function g(e){return s[e]}let a=s.length;function o(e){e<132||(s[e]=a,a=e)}function j(e){const t=g(e);return o(e),t}const B=typeof TextDecoder=="undefined"?(0,d.require)("util").TextDecoder:TextDecoder;let C=new B("utf-8",{ignoreBOM:!0,fatal:!0});C.decode();let T=null;function F(){return(T===null||T.byteLength===0)&&(T=new Uint8Array(n.memory.buffer)),T}function l(e,t){return e=e>>>0,C.decode(F().subarray(e,e+t))}let u=null;function b(){return(u===null||u.byteLength===0)&&(u=new Int32Array(n.memory.buffer)),u}function p(e){a===s.length&&s.push(s.length+1);const t=a;return a=s[t],s[t]=e,t}let h=0;const S=typeof TextEncoder=="undefined"?(0,d.require)("util").TextEncoder:TextEncoder;let L=new S("utf-8");const H=typeof L.encodeInto=="function"?function(e,t){return L.encodeInto(e,t)}:function(e,t){const r=L.encode(e);return t.set(r),{read:e.length,written:r.length}};function X(e,t,r){if(r===void 0){const v=L.encode(e),M=t(v.length,1)>>>0;return F().subarray(M,M+v.length).set(v),h=v.length,M}let i=e.length,m=t(i,1)>>>0;const I=F();let f=0;for(;f127)break;I[m+f]=v}if(f!==i){f!==0&&(e=e.slice(f)),m=r(m,i,i=f+e.length*3,1)>>>0;const v=F().subarray(m+f,m+i),M=H(e,v);f+=M.written}return h=f,m}function E(e){return()=>{throw new Error(`${e} is not defined`)}}const A=Object.freeze({Dead:0,0:"Dead",Alive:1,1:"Alive"});class k{static __wrap(t){t=t>>>0;const r=Object.create(k.prototype);return r.__wbg_ptr=t,r}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t}free(){const t=this.__destroy_into_raw();n.__wbg_universe_free(t)}tick(){n.universe_tick(this.__wbg_ptr)}set_width(t){n.universe_set_width(this.__wbg_ptr,t)}width(){return n.universe_width(this.__wbg_ptr)>>>0}set_height(t){n.universe_set_height(this.__wbg_ptr,t)}height(){return n.universe_height(this.__wbg_ptr)>>>0}set_speed(t){n.universe_set_speed(this.__wbg_ptr,t)}cells(){return n.universe_cells(this.__wbg_ptr)}toggle_cell(t,r){n.universe_toggle_cell(this.__wbg_ptr,t,r)}reset(){n.universe_reset(this.__wbg_ptr)}random(){n.universe_random(this.__wbg_ptr)}static new(t,r){const i=n.universe_new(t,r);return k.__wrap(i)}resize(t,r){n.universe_resize(this.__wbg_ptr,t,r)}render(){let t,r;try{const I=n.__wbindgen_add_to_stack_pointer(-16);n.universe_render(I,this.__wbg_ptr);var i=b()[I/4+0],m=b()[I/4+1];return t=i,r=m,l(i,m)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(t,r,1)}}}function Y(){const e=new Error;return p(e)}function Z(e,t){const r=g(t).stack,i=X(r,n.__wbindgen_malloc,n.__wbindgen_realloc),m=h;b()[e/4+1]=m,b()[e/4+0]=i}function $(e,t){let r,i;try{r=e,i=t,console.error(l(e,t))}finally{n.__wbindgen_free(r,i,1)}}function x(e){j(e)}const N=typeof Math.random=="function"?Math.random:E("Math.random");function z(e,t){throw new Error(l(e,t))}},115:(d,w,c)=>{c.a(d,(n,y)=>G(V,null,function*(){try{c.r(w);var s=c(35),g=c(914),a=n([s,g]);[s,g]=a.then?(yield a)():a;const o=10,j="#e5e5e5",B="#FFFFFF",C="#000000";window.mobileCheck=function(){let e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e};const T=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),F=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0);let l=Math.floor(T/(o+1)),u=Math.floor(F/(o+1));const b=s.Pd.new(l,u);window.addEventListener("resize",e=>{const t=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),r=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0);window.mobileCheck()||(l=Math.floor(t/(o+1)),u=Math.floor(r/(o+1)),b.resize(l,u),p.height=u*(o+1)+1,p.width=l*(o+1)+1,k())});const p=document.getElementById("game-of-life-canvas");p.height=u*(o+1)+1,p.width=l*(o+1)+1;const h=p.getContext("2d");let S=null;const L=()=>{x(),z(),b.tick(),S=requestAnimationFrame(L)},H=()=>S===null,X=document.getElementById("play-pause"),E=document.getElementById("play-pause-icon"),A=()=>{E.className="bi bi-pause-fill",L()},k=()=>{E.className="bi bi-play-fill",x(),z(),cancelAnimationFrame(S),S=null};X.addEventListener("click",e=>{H()?A():k()}),document.getElementById("reset").addEventListener("click",e=>{b.reset(),k(),x(),z()}),document.getElementById("random").addEventListener("click",e=>{b.random(),x(),z()}),document.getElementById("speed").addEventListener("input",e=>{b.set_speed(e.target.value)}),p.addEventListener("click",e=>{const t=p.getBoundingClientRect(),r=p.width/t.width,i=p.height/t.height,m=(e.clientX-t.left)*r,I=(e.clientY-t.top)*i,f=Math.min(Math.floor(I/(o+1)),u-1),v=Math.min(Math.floor(m/(o+1)),l-1);b.toggle_cell(f,v),x(),z()});const x=()=>{h.beginPath(),h.strokeStyle=j;for(let e=0;e<=l;e++)h.moveTo(e*(o+1)+1,0),h.lineTo(e*(o+1)+1,(o+1)*u+1);for(let e=0;e<=u;e++)h.moveTo(0,e*(o+1)+1),h.lineTo((o+1)*l+1,e*(o+1)+1);h.stroke()},N=(e,t)=>e*l+t,z=()=>{const e=b.cells(),t=new Uint8Array(g.memory.buffer,e,l*u);h.beginPath();for(let r=0;r{var n=c(889);d.exports=c.v(w,d.id,"70c7a3d4af60d9e17b97",{"./wasm_game_of_life_bg.js":{__wbg_new_abda76e883ba8a5f:n.a2,__wbg_stack_658279fe44541cf6:n.KM,__wbg_error_f851667af71bcfc6:n.iX,__wbindgen_object_drop_ref:n.ug,__wbg_random_5f61cd0d6777a993:n.mI,__wbindgen_throw:n.Or}})}}])});J();})(); diff --git a/web/dist/js/app.js b/web/dist/js/app.js index 3445e18..dd13769 100644 --- a/web/dist/js/app.js +++ b/web/dist/js/app.js @@ -1,2 +1,2 @@ -(()=>{(()=>{"use strict";var g={},y={};function t(e){var o=y[e];if(o!==void 0)return o.exports;var a=y[e]={id:e,loaded:!1,exports:{}};return g[e](a,a.exports,t),a.loaded=!0,a.exports}t.m=g,(()=>{var e=typeof Symbol=="function"?Symbol("webpack queues"):"__webpack_queues__",o=typeof Symbol=="function"?Symbol("webpack exports"):"__webpack_exports__",a=typeof Symbol=="function"?Symbol("webpack error"):"__webpack_error__",s=n=>{n&&n.d<1&&(n.d=1,n.forEach(r=>r.r--),n.forEach(r=>r.r--?r.r++:r()))},p=n=>n.map(r=>{if(r!==null&&typeof r=="object"){if(r[e])return r;if(r.then){var l=[];l.d=0,r.then(c=>{i[o]=c,s(l)},c=>{i[a]=c,s(l)});var i={};return i[e]=c=>c(l),i}}var u={};return u[e]=c=>{},u[o]=r,u});t.a=(n,r,l)=>{var i;l&&((i=[]).d=-1);var u=new Set,c=n.exports,f,m,w,v=new Promise((b,d)=>{w=d,m=b});v[o]=c,v[e]=b=>(i&&b(i),u.forEach(b),v.catch(d=>{})),n.exports=v,r(b=>{f=p(b);var d,k=()=>f.map(_=>{if(_[a])throw _[a];return _[o]}),S=new Promise(_=>{d=()=>_(k),d.r=0;var x=h=>h!==i&&!u.has(h)&&(u.add(h),h&&!h.d&&(d.r++,h.push(d)));f.map(h=>h[e](x))});return d.r?S:k()},b=>(b?w(v[a]=b):m(c),s(i))),i&&i.d<0&&(i.d=0)}})(),t.d=(e,o)=>{for(var a in o)t.o(o,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:o[a]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce((o,a)=>(t.f[a](e,o),o),[])),t.u=e=>"js/"+e+".90d.js",t.miniCssF=e=>{},t.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(e){if(typeof window=="object")return window}}(),t.hmd=e=>(e=Object.create(e),e.children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={},o="create-wasm-app:";t.l=(a,s,p,n)=>{if(e[a]){e[a].push(s);return}var r,l;if(p!==void 0)for(var i=document.getElementsByTagName("script"),u=0;u{r.onerror=r.onload=null,clearTimeout(m);var b=e[a];if(delete e[a],r.parentNode&&r.parentNode.removeChild(r),b&&b.forEach(d=>d(v)),w)return w(v)},m=setTimeout(f.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=f.bind(null,r.onerror),r.onload=f.bind(null,r.onload),l&&document.head.appendChild(r)}})(),t.r=e=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.v=(e,o,a,s)=>{var p=fetch(t.p+""+a+".module.wasm");return typeof WebAssembly.instantiateStreaming=="function"?WebAssembly.instantiateStreaming(p,s).then(n=>Object.assign(e,n.instance.exports)):p.then(n=>n.arrayBuffer()).then(n=>WebAssembly.instantiate(n,s)).then(n=>Object.assign(e,n.instance.exports))},(()=>{var e;t.g.importScripts&&(e=t.g.location+"");var o=t.g.document;if(!e&&o&&(o.currentScript&&(e=o.currentScript.src),!e)){var a=o.getElementsByTagName("script");if(a.length)for(var s=a.length-1;s>-1&&!e;)e=a[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t.p=e+"../"})(),(()=>{var e={143:0};t.f.j=(s,p)=>{var n=t.o(e,s)?e[s]:void 0;if(n!==0)if(n)p.push(n[2]);else{var r=new Promise((c,f)=>n=e[s]=[c,f]);p.push(n[2]=r);var l=t.p+t.u(s),i=new Error,u=c=>{if(t.o(e,s)&&(n=e[s],n!==0&&(e[s]=void 0),n)){var f=c&&(c.type==="load"?"missing":c.type),m=c&&c.target&&c.target.src;i.message="Loading chunk "+s+` failed. +(()=>{(()=>{"use strict";var g={},y={};function t(e){var o=y[e];if(o!==void 0)return o.exports;var a=y[e]={id:e,loaded:!1,exports:{}};return g[e](a,a.exports,t),a.loaded=!0,a.exports}t.m=g,(()=>{var e=typeof Symbol=="function"?Symbol("webpack queues"):"__webpack_queues__",o=typeof Symbol=="function"?Symbol("webpack exports"):"__webpack_exports__",a=typeof Symbol=="function"?Symbol("webpack error"):"__webpack_error__",s=n=>{n&&n.d<1&&(n.d=1,n.forEach(r=>r.r--),n.forEach(r=>r.r--?r.r++:r()))},p=n=>n.map(r=>{if(r!==null&&typeof r=="object"){if(r[e])return r;if(r.then){var l=[];l.d=0,r.then(c=>{i[o]=c,s(l)},c=>{i[a]=c,s(l)});var i={};return i[e]=c=>c(l),i}}var u={};return u[e]=c=>{},u[o]=r,u});t.a=(n,r,l)=>{var i;l&&((i=[]).d=-1);var u=new Set,c=n.exports,f,m,w,v=new Promise((b,d)=>{w=d,m=b});v[o]=c,v[e]=b=>(i&&b(i),u.forEach(b),v.catch(d=>{})),n.exports=v,r(b=>{f=p(b);var d,k=()=>f.map(_=>{if(_[a])throw _[a];return _[o]}),S=new Promise(_=>{d=()=>_(k),d.r=0;var x=h=>h!==i&&!u.has(h)&&(u.add(h),h&&!h.d&&(d.r++,h.push(d)));f.map(h=>h[e](x))});return d.r?S:k()},b=>(b?w(v[a]=b):m(c),s(i))),i&&i.d<0&&(i.d=0)}})(),t.d=(e,o)=>{for(var a in o)t.o(o,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:o[a]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce((o,a)=>(t.f[a](e,o),o),[])),t.u=e=>"js/"+e+".e39.js",t.miniCssF=e=>{},t.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(e){if(typeof window=="object")return window}}(),t.hmd=e=>(e=Object.create(e),e.children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={},o="create-wasm-app:";t.l=(a,s,p,n)=>{if(e[a]){e[a].push(s);return}var r,l;if(p!==void 0)for(var i=document.getElementsByTagName("script"),u=0;u{r.onerror=r.onload=null,clearTimeout(m);var b=e[a];if(delete e[a],r.parentNode&&r.parentNode.removeChild(r),b&&b.forEach(d=>d(v)),w)return w(v)},m=setTimeout(f.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=f.bind(null,r.onerror),r.onload=f.bind(null,r.onload),l&&document.head.appendChild(r)}})(),t.r=e=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.v=(e,o,a,s)=>{var p=fetch(t.p+""+a+".module.wasm");return typeof WebAssembly.instantiateStreaming=="function"?WebAssembly.instantiateStreaming(p,s).then(n=>Object.assign(e,n.instance.exports)):p.then(n=>n.arrayBuffer()).then(n=>WebAssembly.instantiate(n,s)).then(n=>Object.assign(e,n.instance.exports))},(()=>{var e;t.g.importScripts&&(e=t.g.location+"");var o=t.g.document;if(!e&&o&&(o.currentScript&&(e=o.currentScript.src),!e)){var a=o.getElementsByTagName("script");if(a.length)for(var s=a.length-1;s>-1&&!e;)e=a[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t.p=e+"../"})(),(()=>{var e={143:0};t.f.j=(s,p)=>{var n=t.o(e,s)?e[s]:void 0;if(n!==0)if(n)p.push(n[2]);else{var r=new Promise((c,f)=>n=e[s]=[c,f]);p.push(n[2]=r);var l=t.p+t.u(s),i=new Error,u=c=>{if(t.o(e,s)&&(n=e[s],n!==0&&(e[s]=void 0),n)){var f=c&&(c.type==="load"?"missing":c.type),m=c&&c.target&&c.target.src;i.message="Loading chunk "+s+` failed. (`+f+": "+m+")",i.name="ChunkLoadError",i.type=f,i.request=m,n[1](i)}};t.l(l,u,"chunk-"+s,s)}};var o=(s,p)=>{var[n,r,l]=p,i,u,c=0;if(n.some(m=>e[m]!==0)){for(i in r)t.o(r,i)&&(t.m[i]=r[i]);if(l)var f=l(t)}for(s&&s(p);cconsole.error("Error importing `life.js`:",e))})();})(); diff --git a/web/src/js/life.js b/web/src/js/life.js index 30cf468..9e1132e 100644 --- a/web/src/js/life.js +++ b/web/src/js/life.js @@ -6,6 +6,22 @@ const GRID_COLOR = "#e5e5e5"; const DEAD_COLOR = "#FFFFFF"; const ALIVE_COLOR = "#000000"; +window.mobileCheck = function () { + let check = false; + (function (a) { + if ( + /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test( + a + ) || + /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test( + a.substr(0, 4) + ) + ) + check = true; + })(navigator.userAgent || navigator.vendor || window.opera); + return check; +}; + // Construct the universe, and get its width and height. const vw = Math.max( document.documentElement.clientWidth || 0, @@ -30,10 +46,7 @@ window.addEventListener("resize", (event) => { ); // Weird bug on mobile where the resize event is fired twice - if ( - Math.floor(vw / (CELL_SIZE + 1)) == width && - Math.floor(vh / (CELL_SIZE + 1)) == height - ) { + if (window.mobileCheck()) { return; }