Skip to content

Commit

Permalink
release: 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstoik1 committed Jan 29, 2021
2 parents 1aafe26 + 3928927 commit 387f426
Show file tree
Hide file tree
Showing 10 changed files with 134 additions and 210 deletions.
69 changes: 34 additions & 35 deletions dist/demo/assets/demo.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/demo/assets/director.css

Large diffs are not rendered by default.

73 changes: 36 additions & 37 deletions dist/demo/assets/director.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/demo/assets/vue.min.js

Large diffs are not rendered by default.

109 changes: 54 additions & 55 deletions dist/js-mate-poe.min.js

Large diffs are not rendered by default.

28 changes: 2 additions & 26 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ docker_sig := "/opt/righteous-sandbox.version"
find "{{ dist_dir }}" \( -name "*.br" -o -name '*.gz' \) -type f -delete

# If releasing, redo Gzip/Brotli files.
[ -z "{{ RELEASE }}" ] || just _build-encode
[ -z "{{ RELEASE }}" ] || channelz -p "{{ dist_dir }}"

just _fix-chmod "{{ dist_dir }}"
just _fix-chown "{{ dist_dir }}"
Expand Down Expand Up @@ -168,30 +168,6 @@ release VERSION="": _only-docker
just _build-js-header "{{ demo_dir }}/assets/director.min.js"


# Run static encoding.
@_build-encode:
# Tackle Brotli.
just _info "Encoding Brotli."
find "{{ dist_dir }}" \( \
-name '*.css' -o \
-name '*.html' -o \
-name '*.js' \
\) \
-type f \
-print0 | \
parallel -0 brotli -q 11

# Tackle Gzip.
just _info "Encoding Gzip."
find "{{ dist_dir }}" \( \
-name '*.css' -o \
-name '*.html' -o \
-name '*.js' \
\) \
-type f \
-print0 | \
parallel -0 gzip -k -9


# JS build task(s).
@_build-js:
Expand All @@ -206,7 +182,7 @@ release VERSION="": _only-docker
@_build-js-css:
# JS-Mate-Poe CE.
[ -f "{{ tmp_dir }}/js-mate-poe-ce.css" ] || just _die "Missing js-mate-poe-ce.css."
cp -a "{{ src_dir }}/skel/css.js-mate-poe.mjs" "{{ tmp_dir }}/css.tmp"
cp "{{ src_dir }}/skel/css.js-mate-poe.mjs" "{{ tmp_dir }}/css.tmp"
echo "export const PoeCss = '$( cat "{{ tmp_dir }}/js-mate-poe-ce.css" )';" >> "{{ tmp_dir }}/css.tmp"
mv "{{ tmp_dir }}/css.tmp" "{{ src_dir }}/js/js-mate-poe-ce/poe_css.mjs"
just _fix-chown "{{ src_dir }}/js/js-mate-poe-ce/poe_css.mjs"
Expand Down
2 changes: 1 addition & 1 deletion src/js/core/def.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export const LogMsg = {
WarnAudio: 'Hint: try clicking Poe with your mouse.',
Name: 'JS Mate Poe',
URL: 'https://github.com/Blobfolio/js-mate-poe/',
Version: '1.3.0',
Version: '1.3.1',
};

/**
Expand Down
49 changes: 1 addition & 48 deletions src/js/js-mate-poe-ce/app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,7 @@ const Poe = {
}

// Set up the CSS.
await Promise.all([
Poe.initEvents(),
Poe.initImage(),
]);
await Poe.initEvents();

Universe.start();
requestAnimationFrame(Poe.tick);
Expand Down Expand Up @@ -248,50 +245,6 @@ const Poe = {
return Promise.resolve();
},

/**
* Init Image
*
* We can produce a clearer sprite image for high-res displays using
* the canvas.
*
* @return {!Promise} Promise.
*/
async initImage() {
if (1 !== window.devicePixelRatio && 0 === Poe._src.indexOf('data:')) {
/** @const {!HTMLCanvasElement} */
const canvas = /** @type {!HTMLCanvasElement} */ (document.createElement('CANVAS'));
canvas.width = 2 * SpriteInfo.Width;
canvas.height = 2 * SpriteInfo.Height;

/** @const {!CanvasRenderingContext2D} */
const ctx = /** @type {!CanvasRenderingContext2D} */ (canvas.getContext('2d'));
ctx.imageSmoothingEnabled = false;

/** @const {!Image} */
const image = new Image();

/** @const {!Promise} */
const imagePromise = new Promise((resolve, reject) => {
image.onload = resolve;
image.onerror = reject;
});

// Load the image.
image.src = Poe._src;
await imagePromise;

// Draw it.
ctx.drawImage(image, 0, 0, 2 * SpriteInfo.Width, 2 * SpriteInfo.Height);

// Get the blob.
Poe._src = URL.createObjectURL(await new Promise((resolve) => {
canvas.toBlob(blob => resolve(blob));
}));
}

return Promise.resolve();
},



// -----------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions src/js/js-mate-poe-ce/poe_ce.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export class PoeCe extends HTMLElement {
* Set State
*
* @param {!Object} state State.
* @return {boolean} True.
* @return {void} Nothing.
*/
set state(state) {
let changed = false;
Expand Down Expand Up @@ -208,7 +208,5 @@ export class PoeCe extends HTMLElement {
if (changed) {
this.render();
}

return true;
}
}
2 changes: 1 addition & 1 deletion src/skel/header.min.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* JS Mate Poe
*
* @version 1.3.0
* @version 1.3.1
* @see {https://github.com/Blobfolio/js-mate-poe}
*/

0 comments on commit 387f426

Please sign in to comment.