Skip to content

Commit

Permalink
revert the v1.55 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
luizbills committed May 31, 2024
1 parent ff356bc commit e2e675d
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 98 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

126 changes: 63 additions & 63 deletions public/app.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
<div class="cm-container"></div>
</div>
<div class="game">
<div id="frame-overlay"></div>
<iframe id="frame" frameborder="0"></iframe>
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions public/litecanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
tappingInterval: 100,
tapEvents: true,
useMouse: false,
// auto detect mouse or touch
loop: NULL
};
settings = Object.assign(defaults, settings);
Expand Down Expand Up @@ -969,7 +968,7 @@
}
window.litecanvas = litecanvas;
})();
/*! litecanvas v0.34.0 | https://github.com/litecanvas/game-engine */
/*! litecanvas v0.34.1 | https://github.com/litecanvas/game-engine */

(()=>{var s=getScriptLoader=t=>(o,r)=>{t.setvar("LOADING",t.LOADING+1),script=document.createElement("script"),script.onload=()=>{r&&r(script),t.setvar("LOADING",t.LOADING-1)},script.onerror=()=>{r&&r(null)},script.src=o,document.head.appendChild(script)};var L=getImageLoader=t=>(o,r)=>{t.setvar("LOADING",t.LOADING+1);let d=new Image;d.onload=()=>{r&&r(d),t.setvar("LOADING",t.LOADING-1)},d.onerror=function(){r&&r(null)},d.src=o};var p=getFontLoader=t=>async(o,r,d)=>{let e=new FontFace(o,`url(${r})`);t.setvar("LOADING",t.LOADING+1),document.fonts.add(e),e.load().then(a=>{d&&d(a),t.setvar("LOADING",t.LOADING-1)}).catch(()=>{d&&d(null)})};window.pluginAssetLoader=u;function u(t,o){return t.setvar("LOADING",0),{loadScript:s(t,o),loadImage:L(t,o),loadFont:p(t,o)}}})();
/*! Asset Loader plugin for litecanvas v0.4.2 by Luiz Bills | MIT Licensed */
2 changes: 1 addition & 1 deletion public/sw.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const cacheName = "luizbills.litecanvas-editor-v1";
const version = "1.56.2";
const version = "1.57.0";

const precacheResources = [
"/",
Expand Down
26 changes: 0 additions & 26 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ const stopButton = $("#stop");
const shareButton = $("#share");
const copyButton = $("#copy");
const iframe = $("#frame");
const iframeOverlay = $("#frame-overlay");
const smallScreen = innerWidth < 1024;
const isMobile = navigator.userAgent.match(/android|iphone|ipad/i) !== null;
let library = null;
Expand All @@ -89,12 +88,6 @@ playButton.addEventListener("click", () => {
hide(playButton);
show(stopButton);
runCode();
if (smallScreen) {
iframe.focus();
hide(iframeOverlay);
} else {
show(iframeOverlay);
}
});

stopButton.addEventListener("click", stopGame);
Expand Down Expand Up @@ -220,25 +213,6 @@ window.codeEditor = new EditorView({
parent: $(".code .cm-container"),
});

window.addEventListener("click", (evt) => {
if (evt.target === iframe) return;
if (evt.target === playButton) return;

if (evt.target === iframeOverlay) {
hide(iframeOverlay);
iframe.focus();
return;
}

show(iframeOverlay);
});

window.addEventListener("blur", (evt) => {
if (document.body !== document.activeElement) {
show(iframeOverlay);
}
});

function compressString(str) {
return btoa(String.fromCharCode.apply(null, Array.from(pako.deflate(str))));
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
* @param {HTMLElement} el
*/
export function show(el) {
el.removeAttribute("hidden");
el.hidden = false;
el.style.display = "";
}

/**
* @param {HTMLElement} el
*/
export function hide(el) {
el.setAttribute("hidden", "");
el.hidden = true;
el.style.display = "none";
}

Expand Down

0 comments on commit e2e675d

Please sign in to comment.