fix(showcase): fixed an issue where viewport does not update correctly

This commit is contained in:
Haoyu Xu
2023-01-16 22:32:33 -05:00
parent 5404c1ff52
commit e40f1a18b2
7 changed files with 22 additions and 20 deletions

18
.env
View File

@@ -1,11 +1,11 @@
VITE_TITLE="Arknights: Ch'en/Chen the Holungday - 明日方舟:假日威龙陈" VITE_TITLE="Arknights: Skadi the Corrupting Heart - 明日方舟:浊心斯卡蒂"
VITE_FILENAME=dyn_illust_char_1013_chen2 VITE_FILENAME=dyn_illust_char_1012_skadi2
VITE_LOGO_FILENAME=logo_rhodes_override VITE_LOGO_FILENAME=logo_egir
VITE_FALLBACK_FILENAME=char_1013_chen2_2 VITE_FALLBACK_FILENAME=char_1012_skadi2_2
VITE_VIEWPORT_LEFT=0 VITE_VIEWPORT_LEFT=-5
VITE_VIEWPORT_RIGHT=0 VITE_VIEWPORT_RIGHT=-10
VITE_VIEWPORT_TOP=1 VITE_VIEWPORT_TOP=0
VITE_VIEWPORT_BOTTOM=1 VITE_VIEWPORT_BOTTOM=-12
VITE_INVERT_FILTER=false VITE_INVERT_FILTER=true
VITE_IMAGE_WIDTH=2048 VITE_IMAGE_WIDTH=2048
VITE_IMAGE_HEIGHT=2048 VITE_IMAGE_HEIGHT=2048

View File

@@ -43,6 +43,7 @@ const SHOWCASE_PUBLIC_FOLDER = path.join(__dirname, "public")
const SHOWCASE_PUBLIC_ASSSETS_FOLDER = path.join(SHOWCASE_PUBLIC_FOLDER, "assets") const SHOWCASE_PUBLIC_ASSSETS_FOLDER = path.join(SHOWCASE_PUBLIC_FOLDER, "assets")
const EXTRACTED_FOLDER = path.join(OPERATOR_SOURCE_FOLDER, OPERATOR_NAME, 'extracted') const EXTRACTED_FOLDER = path.join(OPERATOR_SOURCE_FOLDER, OPERATOR_NAME, 'extracted')
const OPERATOR_SHARE_FOLDER = path.join(OPERATOR_SOURCE_FOLDER, '_share') const OPERATOR_SHARE_FOLDER = path.join(OPERATOR_SOURCE_FOLDER, '_share')
rmdir(SHOWCASE_PUBLIC_FOLDER)
if (mode === 'NODE') { if (mode === 'NODE') {
switch (op) { switch (op) {
@@ -54,7 +55,6 @@ if (mode === 'NODE') {
} }
rmdir(OPERATOR_RELEASE_FOLDER) rmdir(OPERATOR_RELEASE_FOLDER)
rmdir(SHOWCASE_PUBLIC_FOLDER)
const projectJson = new ProjectJson(config, OPERATOR_NAME, __dirname, OPERATOR_SHARE_FOLDER) const projectJson = new ProjectJson(config, OPERATOR_NAME, __dirname, OPERATOR_SHARE_FOLDER)
projectJson.load().then((content) => { projectJson.load().then((content) => {

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

BIN
public/assets/logo_egir.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -33,11 +33,6 @@ export default class Settings {
#padRight = this.#defaultPadRight #padRight = this.#defaultPadRight
#padTop = this.#defaultPadTop #padTop = this.#defaultPadTop
#padBottom = this.#defaultPadBottom #padBottom = this.#defaultPadBottom
#hideLogo = this.#defaulthideLogo
#hidePositionSettings = true
#backgroundClearDisabled = true
#logoClearDisabled = true
#isPlaying = true
constructor(el, logoEl) { constructor(el, logoEl) {
this.#el = el this.#el = el
@@ -70,7 +65,6 @@ export default class Settings {
} }
setLogoDisplay(flag) { setLogoDisplay(flag) {
this.#hideLogo = flag
this.#logoEl.hidden = flag; this.#logoEl.hidden = flag;
} }
@@ -153,28 +147,36 @@ export default class Settings {
case "left": case "left":
this.#padLeft = value this.#padLeft = value
this.spinePlayer.updateViewport({ this.spinePlayer.updateViewport({
...this.#defaultViewport,
padLeft: `${value}%`, padLeft: `${value}%`,
padRight: `${this.#padRight}%`,
padTop: `${this.#padTop}%`,
padBottom: `${this.#padBottom}%`,
}) })
break; break;
case "right": case "right":
this.#padRight = value this.#padRight = value
this.spinePlayer.updateViewport({ this.spinePlayer.updateViewport({
...this.#defaultViewport, padLeft: `${this.#padLeft}%`,
padRight: `${value}%`, padRight: `${value}%`,
padTop: `${this.#padTop}%`,
padBottom: `${this.#padBottom}%`,
}) })
break; break;
case "top": case "top":
this.#padTop = value this.#padTop = value
this.spinePlayer.updateViewport({ this.spinePlayer.updateViewport({
...this.#defaultViewport, padLeft: `${this.#padLeft}%`,
padRight: `${this.#padRight}%`,
padTop: `${value}%`, padTop: `${value}%`,
padBottom: `${this.#padBottom}%`,
}) })
break; break;
case "bottom": case "bottom":
this.#padBottom = value this.#padBottom = value
this.spinePlayer.updateViewport({ this.spinePlayer.updateViewport({
...this.#defaultViewport, padLeft: `${this.#padLeft}%`,
padRight: `${this.#padRight}%`,
padTop: `${this.#padTop}%`,
padBottom: `${value}%`, padBottom: `${value}%`,
}) })
break; break;