From 7fe0d86c32fbf9cdbc127c8096b22277250d0df5 Mon Sep 17 00:00:00 2001 From: Haoyu Xu Date: Fri, 30 Jun 2023 02:24:44 -0400 Subject: [PATCH] feat(showcase): open settings in browser by default --- .gh-pages-clear-rules | 2 +- index.html | 1 - src/components/settings.js | 13 +++++++++++-- src/index.js | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.gh-pages-clear-rules b/.gh-pages-clear-rules index bcf99c3..53f1cd5 100644 --- a/.gh-pages-clear-rules +++ b/.gh-pages-clear-rules @@ -2,4 +2,4 @@ !.git !CNAME !.nojekyll -!wallpaper_engine.js \ No newline at end of file +!project.json \ No newline at end of file diff --git a/index.html b/index.html index 8ba7a98..b05bfbb 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,5 @@
- \ No newline at end of file diff --git a/src/components/settings.js b/src/components/settings.js index 3cac66b..df07788 100644 --- a/src/components/settings.js +++ b/src/components/settings.js @@ -27,7 +27,6 @@ export default class Settings { x: 0, y: 0, } - #hidden = !((new URLSearchParams(window.location.search)).has("settings") || import.meta.env.MODE === 'development') #fps = this.#defaultFps #ratio = this.#defaultRatio #opacity = this.#defaultOpacity @@ -71,6 +70,16 @@ export default class Settings { this.loadViewport() this.insights(false, false) this.#updateOptions("animation_selection", this.spinePlayer.skeleton.data.animations.map(e => e.name)) + if ((new URLSearchParams(window.location.search)).has("settings") || import.meta.env.MODE === 'development') { + this.open() + } + fetch('/project.json').then(response => response.json()).then(data => { + if (data.aklive2d) { + this.open() + } + }).catch(e => { + console.log(e) + }) } insights(isWallpaperEngine, doNotTrack) { @@ -320,7 +329,7 @@ export default class Settings { #insertHTML() { this.#el.innerHTML = ` -
+
diff --git a/src/index.js b/src/index.js index b032e48..7c0466c 100644 --- a/src/index.js +++ b/src/index.js @@ -7,7 +7,7 @@ import Music from '@/components/music' document.querySelector('#app').innerHTML = ` -
+