feat(showcase): use manual track

This commit is contained in:
Haoyu Xu
2023-02-09 23:53:14 -05:00
parent 658e25cd31
commit 36afd6d786
5 changed files with 16 additions and 2 deletions

View File

@@ -7,7 +7,7 @@
<meta name="renderer" content="webkit">
<title>aklive2d</title>
<script async defer data-website-id="05ee2d3d-66e0-429b-89ba-db112743a8c2"
src="https://insights.halyul.dev/insights.js" data-do-not-track="true"></script>
src="https://insights.halyul.dev/insights.js" data-do-not-track="true" data-auto-track="false"></script>
</head>
<body style="background-image: url('./assets/background/operator_bg.png');">
<div id="app"></div>

View File

@@ -9,6 +9,7 @@ export default class EnvGenerator {
generate() {
return [
`VITE_LINK="${this.#operatorConfig.link}"`,
`VITE_TITLE="${this.#operatorConfig.title}"`,
`VITE_FILENAME=${this.#operatorConfig.filename.replace('#', '%23')}`,
`VITE_LOGO_FILENAME=${this.#operatorConfig.logo}`,

View File

@@ -55,7 +55,7 @@ export default function spinePlayer(el) {
entry.mixDuration = 0.3;
widget.animationState.addAnimation(0, "Idle", true, 0);
}
window.settings.loadViewport()
window.settings.success()
},
})
}

View File

@@ -37,6 +37,7 @@ export default class Settings {
#padBottom = this.#defaultPadBottom
#logoX = this.#defaultLogoX
#logoY = this.#defaultLogoY
#isInsightsInited = false
constructor(el, logoEl) {
this.#el = el
@@ -62,6 +63,17 @@ export default class Settings {
this.#insertHTML()
}
success() {
this.loadViewport()
this.insights(false)
}
insights(flag) {
if (this.#isInsightsInited) return
window.umami.trackView(`/${import.meta.env.VITE_LINK}${flag ? "?steam" : ""}`);
this.#isInsightsInited = true
}
setFPS(value) {
this.#fps = value
this.spinePlayer.setFps(value)

View File

@@ -5,6 +5,7 @@ window.wallpaperPropertyListener = {
}
},
applyUserProperties: function (properties) {
window.settings.insights(true)
if (properties.logo) {
window.settings.setLogoDisplay(!properties.logo.value)
}