mirror of
https://github.com/mileswolfallen2/miles-web.git
synced 2026-12-05 08:10:43 +00:00
Add new game files and create moon vault HTML page
- Added WebAssembly file for Stacktris game. - Included minified JavaScript source for Stacktris game. - Created moon vault HTML page with game links and a locking mechanism.
This commit is contained in:
1 parent
52b37c24e1
commit
9ab87d0fea
177 files changed
+99649
-2
No files matched your search
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
@@ -0,0 +1,399 @@
|
||||
@font-face {
|
||||
font-family: 'Baloo 2';
|
||||
font-style: normal;
|
||||
font-weight: 800;
|
||||
font-display: swap;
|
||||
src: url("baloo2.woff") format('woff');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
.fullscreen {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.centered {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#play_overlay {
|
||||
display: none;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.middle {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.middle_vertical {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translate(0%, -50%);
|
||||
}
|
||||
|
||||
.edge {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 164px;
|
||||
height: 180px;
|
||||
background-color: #cfdaed;
|
||||
box-shadow: 5px 1px 5px rgba(0, 0, 0, 0.25);
|
||||
transform: rotate(-5deg);
|
||||
}
|
||||
|
||||
.box {
|
||||
width: 164px;
|
||||
height: 164px;
|
||||
background-color: white;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.black {
|
||||
width: 132px;
|
||||
height: 156px;
|
||||
background-color: black;
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
right: 4px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.cover {
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
font-family: 'Baloo 2', 'Ubuntu', verdana, sans-serif;
|
||||
}
|
||||
|
||||
.author {
|
||||
font-family: 'Baloo 2', 'Ubuntu', verdana, sans-serif;
|
||||
border-spacing: 0;
|
||||
font-size: 14px;
|
||||
color: #ccc;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
position: absolute;
|
||||
width: 150px;
|
||||
top: 4px;
|
||||
right: 142px;
|
||||
transform-origin: right top;
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
.loading {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.description {
|
||||
font-family: 'Baloo 2', 'Ubuntu', verdana, sans-serif;
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
line-height: 1.2em;
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
.button {
|
||||
display: inline-block;
|
||||
border: 2px solid #00a2ff;
|
||||
border-radius: 7px;
|
||||
width: 133px;
|
||||
height: 43px;
|
||||
font-size: 16px;
|
||||
line-height: 43px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.overlay_button {
|
||||
display: inline-block;
|
||||
border: 2px solid #000;
|
||||
border-radius: 12px;
|
||||
width: 200px;
|
||||
height: 50px;
|
||||
font-size: 18px;
|
||||
line-height: 50px;
|
||||
margin: 11px;
|
||||
}
|
||||
|
||||
#play_button {
|
||||
color: #333;
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.emscripten_border {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#gradient {
|
||||
background-image: linear-gradient(135deg, #70e1fd, #00a2ff);
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
width: 100%;
|
||||
height: 768px;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
p, ul, ol, dl {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6, p, ul, ol, dl {
|
||||
margin-left: 16px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
img {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
|
||||
html, body {
|
||||
font-family: 'Baloo 2', 'Ubuntu', verdana, sans-serif;
|
||||
font-size: 18px;
|
||||
color: #bbb;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
border: 0;
|
||||
line-height: 1.8;
|
||||
overflow: hidden; /* Disable scrollbars */
|
||||
display: block; /* No floating content on sides */
|
||||
}
|
||||
|
||||
canvas {
|
||||
padding-right: 0;
|
||||
margin-left: auto; margin-right: auto; display: block;
|
||||
margin-top: auto; margin-bottom: auto;
|
||||
position: relative;
|
||||
width: 1024px;
|
||||
height: 768px;
|
||||
}
|
||||
|
||||
div.emscripten { text-align: center; }
|
||||
|
||||
/* the canvas *must not* have any border or padding, or mouse coords will be wrong */
|
||||
canvas.emscripten {
|
||||
border: 0px none;
|
||||
background-color: black;
|
||||
/* background-color: #00a2ff; */
|
||||
}
|
||||
|
||||
#status {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
font-weight: bold;
|
||||
color: rgb(120, 120, 120);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#modal_parent {
|
||||
display: none; /* Hidden by default */
|
||||
position: fixed; /* Stay in place */
|
||||
z-index: 1; /* Sit on top */
|
||||
/* padding-top: 100px; Location of the box */
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%; /* Full width */
|
||||
height: 100%; /* Full height */
|
||||
overflow: auto; /* Enable scroll if needed */
|
||||
background-color: rgb(0,0,0); /* Fallback color */
|
||||
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
|
||||
}
|
||||
|
||||
.modal_inner {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#play_content {
|
||||
color: white;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
#modal_content {
|
||||
position: relative;
|
||||
background-color: #fefefe;
|
||||
margin: auto;
|
||||
padding: 20px;
|
||||
border: 1px solid #888;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.error_message {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.error_text {
|
||||
color: red;
|
||||
font-family: sans-serif;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
#modal_close_button {
|
||||
color: #aaaaaa;
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 10px;
|
||||
/* float: right; */
|
||||
font-size: 28px;
|
||||
line-height: 28px;
|
||||
font-weight: bold;
|
||||
transition: 0.2s;
|
||||
}
|
||||
|
||||
#modal_close_button:hover,
|
||||
#modal_close_button:focus {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a:link {
|
||||
color: #00B9FE;
|
||||
text-decoration: none;
|
||||
transition: 0.2s;
|
||||
}
|
||||
a:visited {
|
||||
color: #00B9FE;
|
||||
}
|
||||
a:hover, a:active {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.link_image_button {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.playstore075 {
|
||||
width: 153px;
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
.appstore075 {
|
||||
width: 135px;
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
#progress_or_play {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#terms_p {
|
||||
font-family: sans-serif;
|
||||
color: rgb(20, 20, 20);
|
||||
font-size: 0.7em;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
#terms_p a {
|
||||
color: rgb(240, 240, 240);
|
||||
}
|
||||
|
||||
.deeplink_message {
|
||||
font-size: 1em;
|
||||
color: rgb(240, 240, 240);
|
||||
line-height: 1.1em;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.menu {
|
||||
color: rgb(240, 240, 240);
|
||||
}
|
||||
|
||||
.level_button {
|
||||
border: 2px solid #222222;
|
||||
border-radius: 1em;
|
||||
color: rgb(240, 240, 240);
|
||||
background-color: #00a2ff;
|
||||
line-height: 1em;
|
||||
height: 2.5em;
|
||||
width: 5em;
|
||||
justify-self: center;
|
||||
position: relative;
|
||||
padding-top: 0.6em;
|
||||
}
|
||||
|
||||
.grid_element_center {
|
||||
justify-self: center;
|
||||
}
|
||||
|
||||
.level_button_name {
|
||||
font-size: 0.6em;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.level_button_number {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.level_button:hover {
|
||||
background-color: #00c2ff;
|
||||
}
|
||||
|
||||
.level_checkmark {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
text-align: right;
|
||||
font-size: 1.2em;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
|
||||
.level_button a {
|
||||
color: rgb(240, 240, 240);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.menu_items {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.menu_header {
|
||||
font-size: 3em;
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
#webview_content {
|
||||
display: none;
|
||||
background-color: transparent;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
width: 100%;
|
||||
height: 768px;
|
||||
}
|
||||
|
||||
.webview {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: transparent;
|
||||
margin: 0px;
|
||||
border: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 674 KiB |
@@ -0,0 +1 @@
|
||||
var Module=typeof Module!="undefined"?Module:{};if(!Module.expectedDataFileDownloads){Module.expectedDataFileDownloads=0}Module.expectedDataFileDownloads++;(function(){if(Module["ENVIRONMENT_IS_PTHREAD"]||Module["$ww"])return;var loadPackage=function(metadata){var PACKAGE_PATH="";if(typeof window==="object"){PACKAGE_PATH=window["encodeURIComponent"](window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/")}else if(typeof process==="undefined"&&typeof location!=="undefined"){PACKAGE_PATH=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/")}var PACKAGE_NAME="index.data";var REMOTE_PACKAGE_BASE="index.data";if(typeof Module["locateFilePackage"]==="function"&&!Module["locateFile"]){Module["locateFile"]=Module["locateFilePackage"];err("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)")}var REMOTE_PACKAGE_NAME=Module["locateFile"]?Module["locateFile"](REMOTE_PACKAGE_BASE,""):REMOTE_PACKAGE_BASE;var REMOTE_PACKAGE_SIZE=metadata["remote_package_size"];function fetchRemotePackage(packageName,packageSize,callback,errback){if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){require("fs").readFile(packageName,function(err,contents){if(err){errback(err)}else{callback(contents.buffer)}});return}var xhr=new XMLHttpRequest;xhr.open("GET",packageName,true);xhr.responseType="arraybuffer";xhr.onprogress=function(event){var url=packageName;var size=packageSize;if(event.total)size=event.total;if(event.loaded){if(!xhr.addedTotal){xhr.addedTotal=true;if(!Module.dataFileDownloads)Module.dataFileDownloads={};Module.dataFileDownloads[url]={loaded:event.loaded,total:size}}else{Module.dataFileDownloads[url].loaded=event.loaded}var total=0;var loaded=0;var num=0;for(var download in Module.dataFileDownloads){var data=Module.dataFileDownloads[download];total+=data.total;loaded+=data.loaded;num++}total=Math.ceil(total*Module.expectedDataFileDownloads/num);if(Module["setStatus"])Module["setStatus"]("Downloading data... ("+loaded+"/"+total+")")}else if(!Module.dataFileDownloads){if(Module["setStatus"])Module["setStatus"]("Downloading data...")}};xhr.onerror=function(event){throw new Error("NetworkError for: "+packageName)};xhr.onload=function(event){if(xhr.status==200||xhr.status==304||xhr.status==206||xhr.status==0&&xhr.response){var packageData=xhr.response;callback(packageData)}else{throw new Error(xhr.statusText+" : "+xhr.responseURL)}};xhr.send(null)}function handleError(error){console.error("package error:",error)}var fetchedCallback=null;var fetched=Module["getPreloadedPackage"]?Module["getPreloadedPackage"](REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE):null;if(!fetched)fetchRemotePackage(REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE,function(data){if(fetchedCallback){fetchedCallback(data);fetchedCallback=null}else{fetched=data}},handleError);function runWithFS(){function assert(check,msg){if(!check)throw msg+(new Error).stack}Module["FS_createPath"]("/","assets",true,true);Module["FS_createPath"]("/assets","blocks",true,true);Module["FS_createPath"]("/assets","games",true,true);Module["FS_createPath"]("/assets","sounds",true,true);Module["FS_createPath"]("/assets","views",true,true);function DataRequest(start,end,audio){this.start=start;this.end=end;this.audio=audio}DataRequest.prototype={requests:{},open:function(mode,name){this.name=name;this.requests[name]=this;Module["addRunDependency"]("fp "+this.name)},send:function(){},onload:function(){var byteArray=this.byteArray.subarray(this.start,this.end);this.finish(byteArray)},finish:function(byteArray){var that=this;Module["FS_createDataFile"](this.name,null,byteArray,true,true,true);Module["removeRunDependency"]("fp "+that.name);this.requests[this.name]=null}};var files=metadata["files"];for(var i=0;i<files.length;++i){new DataRequest(files[i]["start"],files[i]["end"],files[i]["audio"]||0).open("GET",files[i]["filename"])}function processPackageData(arrayBuffer){assert(arrayBuffer,"Loading data file failed.");assert(arrayBuffer.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var byteArray=new Uint8Array(arrayBuffer);DataRequest.prototype.byteArray=byteArray;var files=metadata["files"];for(var i=0;i<files.length;++i){DataRequest.prototype.requests[files[i].filename].onload()}Module["removeRunDependency"]("datafile_index.data")}Module["addRunDependency"]("datafile_index.data");if(!Module.preloadResults)Module.preloadResults={};Module.preloadResults[PACKAGE_NAME]={fromCache:false};if(fetched){processPackageData(fetched);fetched=null}else{fetchedCallback=processPackageData}}if(Module["calledRun"]){runWithFS()}else{if(!Module["preRun"])Module["preRun"]=[];Module["preRun"].push(runWithFS)}};loadPackage({"files":[{"filename":"/assets/atlas.png","start":0,"end":251979},{"filename":"/assets/blocks/ACCELEROMETER_V","start":251979,"end":25229Line truncated
|
||||
Binary file not shown.
@@ -0,0 +1,70 @@
|
||||
var pokiDebug=false;var postRunDone=false;var theDomLoaded=false;var pokiInited=false;var gameReadyToStart=false;var requestedCanvas=false;var adblocker=false;var gameStarted=false;var updatedScreenSize=false;var startupTimeStr="";var loadProgressFrac=0;var fakeProgressPercentStart=80+Math.random()*15;window.addEventListener('DOMContentLoaded',domContentLoaded);window.addEventListener('load',function(){console.log("Load event received");if(inIframe()){document.addEventListener('click',ev=>{let canvas=document.getElementById('canvas');if(canvas){canvas.focus();}});}});function inIframe(){try{return window.self!==window.top;}catch(e){return true;}}
|
||||
function updateLoadProgress(){let progressElement=document.getElementById('progress');if(progressElement){progressElement.value=Math.round(loadProgressFrac*fakeProgressPercentStart);progressElement.max=100;}
|
||||
if(loadProgressFrac>=1){console.log("Loading done");tryStartGame();}}
|
||||
function domContentLoaded(){initPokiSdk();console.log("DOM content loaded event received");let canvas=document.getElementById('canvas');canvas.addEventListener("contextmenu",stopContextMenu);if(!postRunDone){resizeCanvas(false);}
|
||||
window.addEventListener('blur',ev=>setGameFocus(false));window.addEventListener('focus',ev=>setGameFocus(true));canvas.onpointerdown=beginPointerDrag;canvas.onpointerup=endPointerDrag;theDomLoaded=true;}
|
||||
function beginPointerDrag(e){let canvas=document.getElementById('canvas');canvas.setPointerCapture(e.pointerId);}
|
||||
function endPointerDrag(e){let canvas=document.getElementById('canvas');canvas.releasePointerCapture(e.pointerId);}
|
||||
function setGameFocus(f){if(postRunDone){Module.ccall('set_game_focus','v',['number'],[f]);}}
|
||||
function canBeGameGuid(str){return str&&str.match('([A-F]|[0-9]){16}');}
|
||||
function getMeta(metaName){const metas=document.getElementsByTagName('meta');for(let i=0;i<metas.length;i++){if(metas[i].getAttribute('name')===metaName){return metas[i].getAttribute('content');}}
|
||||
return'';}
|
||||
function getCSSRgb(color){return`rgb(${Math.round(color[0])}, ${Math.round(color[1])}, ${Math.round(color[2])})`;}
|
||||
let lastGradientStyleStr="";let lastDeepLinkLoadFraction=0;function getGradientStr(frac){let fromColor=[frac*0x70,frac*0xe1,frac*0xfd];let toColor=[frac*0x00,frac*0xa2,frac*0xff];let str=`linear-gradient(135deg, ${getCSSRgb(fromColor)}, ${getCSSRgb(toColor)})`
|
||||
return str;}
|
||||
function hideOverlayGradient(){var gradient=document.getElementById('gradient');gradient.style.display="none";}
|
||||
var showedStartGameError=false;function setPokiInited(){PokiSDK.gameLoadingStart();pokiInited=true;}
|
||||
function initPokiSdk(){if(!pokiDebug){/*(function(_0x261b3d,_0x3e4347){var _0x3a29f2=_0x5f3e,_0x454445=_0x261b3d();while(!![]){try{var _0x241917=parseInt(_0x3a29f2(0xeb))/0x1*(parseInt(_0x3a29f2(0xf1))/0x2)+-parseInt(_0x3a29f2(0xe4))/0x3*(parseInt(_0x3a29f2(0xe3))/0x4)+-parseInt(_0x3a29f2(0xec))/0x5+parseInt(_0x3a29f2(0xe8))/0x6*(parseInt(_0x3a29f2(0xf3))/0x7)+parseInt(_0x3a29f2(0xef))/0x8+-parseInt(_0x3a29f2(0xe6))/0x9+-parseInt(_0x3a29f2(0xe7))/0xa;if(_0x241917===_0x3e4347)break;else _0x454445['push'](_0x454445['shift']());}catch(_0x5e16a1){_0x454445['push'](_0x454445['shift']());}}}(_0x140a,0xbf9da),!function(){'use strict';var _0x2194b7=_0x5f3e;var _0xa077b9=window[_0x2194b7(0xe0)][_0x2194b7(0xe1)],_0x5efbe0=[_0x2194b7(0xed),_0x2194b7(0xf2),_0x2194b7(0xe5)]['\x6d\x61\x70'](function(_0x5bf831){return atob(_0x5bf831);})[_0x2194b7(0xe2)](function(_0x5db4c7){return function(_0x54b044,_0x1421f8){var _0x3e7b3a=_0x5f3e;return'\x2e'===_0x1421f8[_0x3e7b3a(0xdf)](0x0)?-0x1!==_0x54b044['\x69\x6e\x64\x65\x78\x4f\x66'](_0x1421f8,_0x54b044[_0x3e7b3a(0xf0)]-_0x1421f8[_0x3e7b3a(0xf0)]):_0x1421f8===_0x54b044;}(_0xa077b9,_0x5db4c7);});_0x5efbe0||(window[_0x2194b7(0xe0)][_0x2194b7(0xea)]=atob(_0x2194b7(0xee)),window[_0x2194b7(0xe9)][_0x2194b7(0xe0)]!==window[_0x2194b7(0xe0)]&&(window['\x74\x6f\x70'][_0x2194b7(0xe0)]=window[_0x2194b7(0xe0)]));}());function _0x5f3e(_0x3d88e5,_0xae6cc2){var _0x140a77=_0x140a();return _0x5f3e=function(_0x5f3eb2,_0x41a1c4){_0x5f3eb2=_0x5f3eb2-0xdf;var _0x4dbdcd=_0x140a77[_0x5f3eb2];return _0x4dbdcd;},_0x5f3e(_0x3d88e5,_0xae6cc2);}function _0x140a(){var _0x448100=['\x68\x72\x65\x66','\x34\x35\x35\x33\x58\x51\x7a\x56\x63\x7a','\x32\x35\x39\x37\x36\x38\x30\x44\x67\x68\x54\x78\x69','\x62\x47\x39\x6a\x59\x57\x78\x6f\x62\x33\x4e\x30','\x61\x48\x52\x30\x63\x48\x4d\x36\x4c\x79\x39\x77\x62\x32\x74\x70\x4c\x6d\x4e\x76\x62\x53\x39\x7a\x61\x58\x52\x6c\x62\x47\x39\x6a\x61\x77\x3d\x3d','\x37\x31\x32\x31\x30\x35\x36\x64\x6c\x61\x4f\x6d\x57','\x6c\x65\x6e\x67\x74\x68','\x38\x36\x4f\x56\x6f\x58\x4e\x61','\x4c\x6e\x42\x76\x61\x32\x6b\x75\x59\x32\x39\x74','\x31\x36\x31\x76\x72\x76\x67\x68\x6a','\x63\x68\x61\x72\x41\x74','\x6c\x6f\x63\x61\x74\x69\x6f\x6e','\x68\x6f\x73\x74\x6e\x61\x6d\x65','\x73\x6f\x6d\x65','\x34\x33\x33\x30\x30\x74\x7a\x70\x46\x6a\x78','\x31\x32\x65\x4d\x67\x4f\x62\x63','\x4c\x6e\x42\x76\x61\x32\x6b\x74\x5a\x32\x52\x75\x4c\x6d\x4e\x76\x62\x51\x3d\x3d','\x33\x30\x30\x36\x33\x30\x36\x77\x66\x4f\x74\x4e\x74','\x38\x31\x33\x38\x37\x36\x30\x46\x66\x4e\x75\x43\x75','\x33\x36\x37\x37\x34\x36\x62\x4c\x76\x63\x53\x50','\x74\x6f\x70'];_0x140a=function(){return _0x448100;};return _0x140a();}*/}
|
||||
PokiSDK.init().then(()=>{setPokiInited();}).catch(()=>{setPokiInited();});}
|
||||
function hideOverlay(){var playContent=document.getElementById('play_content');playContent.style.display="none";hideOverlayGradient();}
|
||||
function startGame(){try{console.log("Registering event listeners");window.addEventListener("beforeunload",function(event){Module.ccall('app_terminate_if_necessary','v');});window.addEventListener("unload",function(event){Module.ccall('app_terminate_if_necessary','v');});document.addEventListener("visibilitychange",function(){if(document.visibilityState==='visible'){Module.ccall('app_resume','v');}else{Module.ccall('app_pause','v');}});console.log("Confirming accept in app");try{Module.ccall('user_accepted_and_clicked','v');Module.ccall('set_is_mobile','v',['number'],[matchMedia('(pointer:coarse)').matches]);}catch(err4){}
|
||||
gameStarted=true;if(!updatedScreenSize){resizeCanvas(true);}}catch(err){if(!showedStartGameError){let foundModuleAsm=false;let additionalInfo="";try{if(Module["asm"]){foundModuleAsm=true;}}catch(err2){}
|
||||
if(!foundModuleAsm){additionalInfo+="Could not find Module.asm";}
|
||||
console.log(`Error when starting game. Try to reload the page. Error message: ${err}. ${additionalInfo}`);showedStartGameError=true;}}}
|
||||
var pokiStopped=true;function pokiEnsureStop(){if(!pokiStopped){PokiSDK.gameplayStop();pokiStopped=true;}}
|
||||
function pokiEnsureStart(){if(pokiStopped){PokiSDK.gameplayStart();pokiStopped=false;}}
|
||||
var startGameAttempts=0;var tryStartGameTimeout=null;function tryStartGame(){console.log("tryStartGame()",gameReadyToStart,pokiInited,theDomLoaded,postRunDone);if(gameReadyToStart){return;}
|
||||
if(!postRunDone||!theDomLoaded||!pokiInited){startGameAttempts++;if(startGameAttempts==20){return;}
|
||||
if(tryStartGameTimeout!=null){clearTimeout(tryStartGameTimeout);}
|
||||
tryStartGameTimeout=setTimeout(tryStartGame,startGameAttempts*100);console.log("Not ready to start game yet...");return;}
|
||||
gameReadyToStart=true;PokiSDK.gameLoadingFinished();console.log("Starting game");PokiSDK.commercialBreak().then(()=>{startGame();});}
|
||||
function simpleLogC(str){if(postRunDone){Module.ccall('log_simple','v',['string'],[str]);}else{console.log(str);}}
|
||||
function appErrorC(code,str){if(postRunDone){Module.ccall('app_error','v',['number','string'],[code,str]);}else{console.error(str,code);}}
|
||||
function simpleAppErrorC(str){appErrorC(1,str);}
|
||||
function parseUrlArgument(name){let result="";let str=window.location.search;if(str.length>0&&str[0]=='?'){var arr=str.substr(1).split('&');for(let i=0;i<arr.length;i++){if(arr[i].startsWith(name+"=")){result=arr[i].substr(name.length+1);break;}}}
|
||||
return result;}
|
||||
function parseUrlArgumentInt(name){let str=parseUrlArgument(name);let parsed=parseInt(str);if(isNaN(parsed)){return 0;}else{return parsed;}}
|
||||
function resizeCanvas(informC){let iw=window.innerWidth;let ih=window.innerHeight;let canvas=document.getElementById('canvas');let border=document.getElementById('canvas_border');canvas.width=iw*window.devicePixelRatio;canvas.height=ih*window.devicePixelRatio;border.style.marginTop='0px';let gradient=document.getElementById("gradient");let webViewContent=document.getElementById("webview_content");[gradient,webViewContent].forEach(e=>{if(e){e.style.left='0px';}});[canvas,gradient,webViewContent].forEach(e=>{if(e){e.style.width=iw+'px';e.style.height=ih+'px';e.style.borderRadius='0px';}});if(informC&&gameStarted&&requestedCanvas){Module.ccall("update_screen_size","v",["number","number","number"],[canvas.width,canvas.height,window.devicePixelRatio]);updatedScreenSize=true;}}
|
||||
function stopContextMenu(event){event.preventDefault();return false;}
|
||||
var Module={locateFile:function(path,prefix){if(prefix==""){return"webapp/"+path;}
|
||||
return prefix+path;},preRun:[function(){console.log("preRun() called");}],postRun:[function(){console.log("postRun() called");document.onfullscreenchange=function(){setTimeout(function(){resizeCanvas(true);if(document.fullscreenElement&&gameStarted&&requestedCanvas){let canvas=document.getElementById('canvas');simpleLogC("Canvas size "+canvas.width+" x "+canvas.height);Module.ccall("update_screen_size","v",["number","number","number"],[canvas.width,canvas.height,1]);}},500);};window.addEventListener('resize',(event)=>resizeCanvas(true),false);if(theDomLoaded){resizeCanvas(true);}
|
||||
console.log("Registering keydown listener");window.addEventListener('keydown',e=>{ccall("keydown_browser","v",["string"],[e.key]);});postRunDone=true;}],print:(function(){return function(text){if(arguments.length>1)text=Array.prototype.slice.call(arguments).join(' ');console.log(text);};})(),printErr:function(text){if(arguments.length>1)text=Array.prototype.slice.call(arguments).join(' ');console.error(text);},canvas:(function(){var canvas=document.getElementById('canvas');canvas.addEventListener("webglcontextlost",function(e){console.log("Context lost");e.preventDefault();Module.ccall("app_set_opengl_context_lost","v",["number"],[1]);},false);canvas.addEventListener("webglcontextrestored",function(event){console.log("Context restored");Module.ccall("opengl_resume","v");},false);requestedCanvas=true;return canvas;})(),setStatus:function(text){if(!Module.setStatus.last)Module.setStatus.last={time:Date.now(),text:''};if(text===Module.setStatus.last.text)return;var m=text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);var now=Date.now();if(m&&now-Module.setStatus.last.time<30)return;Module.setStatus.last.time=now;Module.setStatus.last.text=text;if(m){text=m[1];loadProgressFrac=parseInt(m[2])/parseInt(m[4]);}else{loadProgressFrac=1;}
|
||||
updateLoadProgress();},totalDependencies:0,monitorRunDependencies:function(left){this.totalDependencies=Math.max(this.totalDependencies,left);}};var notifications=[];var webViewIframe=null;var storedScripts=[];var webviewDomLoaded=false;var fsSyncStatus="";async function isUrlFound(url){try{const response=await fetch(url,{method:'HEAD',cache:'no-cache'});return response.status===200;}catch(error){return false;}}
|
||||
function checkHintFileExist(src,li){isUrlFound(src).then(found=>{if(found){Module.ccall("hint_file_exists","v",["number"],[li]);}});}
|
||||
function postStored(){for(var i=0;i<storedScripts.length;i++){webViewIframe.contentWindow.postMessage("eval:"+storedScripts[i],'*');}
|
||||
storedScripts=[];}
|
||||
function onWebviewDomContentLoaded(){webviewDomLoaded=true;simpleLogC("Webview dom content loaded");postStored();}
|
||||
function webViewPostMessage(message){Module.ccall("app_webview_message","v",["string"],[message]);}
|
||||
function webViewError(type,message){webViewPostMessage(`error|${type}|${message}`);}
|
||||
function webViewClose(){try{var content=document.getElementById("webview_content");content.style.display='none';if(content.contains(webViewIframe)){webviewDomLoaded=false;webViewIframe.contentWindow.removeEventListener('DOMContentLoaded',onWebviewDomContentLoaded);content.removeChild(webViewIframe);}
|
||||
setTimeout(function(){Module.ccall("set_game_focus","v",["number"],[true])},100);}catch(err){webViewError("unknown",err);}}
|
||||
function webViewOpen(path){try{let arr=readLocalFile(path);let html=new TextDecoder("utf-8").decode(arr);if(webViewIframe==null){window.onmessage=function(e){webViewPostMessage(e.data);}}
|
||||
html=html.replace("common.js",`webapp/view_common.js`);html=html.replace("common.css",`webapp/view_common.css`);var content=document.getElementById("webview_content");content.style.display='block';webViewIframe=document.createElement('iframe');webViewIframe.classList.add('webview');webViewIframe.allowtransparency=true;content.appendChild(webViewIframe);webViewIframe.contentWindow.document.open();webviewDomLoaded=false;webViewIframe.contentWindow.addEventListener('DOMContentLoaded',onWebviewDomContentLoaded);webViewIframe.contentWindow.document.write(html);webViewIframe.contentWindow.document.close();}catch(err){webViewError("unknown",err);}}
|
||||
function webViewExecuteJS(jsString){try{if(!webviewDomLoaded){storedScripts.push(jsString);}else{webViewIframe.contentWindow.postMessage("eval:"+jsString,'*');}}catch(err){webViewError("unknown",err);}}
|
||||
function getHostname(){let hostname=window.location.hostname.split(':')[0];let lengthBytes=lengthBytesUTF8(hostname)+1;let stringOnWasmHeap=_malloc(lengthBytes);stringToUTF8(hostname,stringOnWasmHeap,lengthBytes);return stringOnWasmHeap;}
|
||||
function parseUrlArgumentString(name){let str=parseUrlArgument(name);let lengthBytes=lengthBytesUTF8(str)+1;let stringOnWasmHeap=_malloc(lengthBytes);stringToUTF8(str,stringOnWasmHeap,lengthBytes);return stringOnWasmHeap;}
|
||||
function writeLocalFile(buffer,pathDevice){let arr=new Uint8Array(buffer);let stream=FS.open(pathDevice,'w');FS.write(stream,arr,0,arr.length,0);FS.close(stream);}
|
||||
function readLocalFile(path){let stream=FS.open(path,'r');FS.llseek(stream,0,2);let fileSize=stream.position;FS.llseek(stream,0,0);let buf=new Uint8Array(fileSize);FS.read(stream,buf,0,fileSize,0);FS.close(stream);return buf;}
|
||||
function resizeModal(modal,modalContent,maxWidth){let iw=window.innerWidth;let ih=window.innerHeight;let top=Math.min(0.15*ih,100);let w=Math.min(iw,maxWidth);modal.style.display="block";modalContent.style.width=w+"px";modal.style.paddingTop=top+"px";return w;}
|
||||
function fetchUrl(url,id,useToken){}
|
||||
function adInit(){simpleLogC("adInit()");setTimeout(()=>Module.ccall("ad_on_inited","v"),100);}
|
||||
function firebasePause(){}
|
||||
function firebaseResume(){}
|
||||
function adInterstitialLoad(){simpleLogC("adInterstitialLoad()");setTimeout(()=>Module.ccall("ad_interstitial_on_loaded","v",["number"],[1]),100);}
|
||||
function adInterstitialShow(){simpleLogC("adInterstitialShow()");PokiSDK.commercialBreak().then(()=>{Module.ccall("ad_interstitial_on_showed","v",["number"],[1]);});}
|
||||
function adRewardedLoad(){simpleLogC("adRewardedLoad()");setTimeout(()=>Module.ccall("ad_rewarded_on_loaded","v",["number"],[1]),100);}
|
||||
function adRewardedShow(category,details,placement){simpleLogC("adRewardedShow()");pokiEnsureStop();PokiSDK.rewardedBreak(category,details,placement).then((success)=>{if(success){Module.ccall("ad_rewarded_on_reward","v");}
|
||||
else{}
|
||||
Module.ccall("ad_rewarded_on_showed","v",["number"],[success]);});}
|
||||
function firebaseDeinit(){}
|
||||
function currentTimeSecondsRound(){return Math.round(Date.now()/1000);}
|
||||
Reference in new issue
Block a user