From 00df9c9c32832feea80d6cd6d66c69fabacfab42 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 16 Sep 2024 02:34:02 +0300 Subject: initial splashscreen implementation --- src/App.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/App.js') diff --git a/src/App.js b/src/App.js index b7eb2f72..6f140612 100644 --- a/src/App.js +++ b/src/App.js @@ -44,6 +44,13 @@ export default { data: () => ({ mobileActivePanel: 'timeline' }), + watch: { + themeApplied (value) { + document.querySelector('#app').classList.remove('hidden') + document.querySelector('#splash').className = 'hidden' + document.querySelector('#status').textContent = this.$t('splash.fun_' + Math.ceil(Math.random() * 4)) + } + }, created () { // Load the locale from the storage const val = this.$store.getters.mergedConfig.interfaceLanguage @@ -54,6 +61,9 @@ export default { window.removeEventListener('resize', this.updateMobileState) }, computed: { + themeApplied () { + return this.$store.state.interface.themeApplied + }, classes () { return [ { -- cgit v1.2.3-70-g09d2 From 2abde63afc9ecdd4f1faa070650236597fbbf116 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 16 Sep 2024 03:00:31 +0300 Subject: swap pleromatan_apology_fox location --- index.html | 1 + src/App.js | 2 +- src/assets/pleromatan_apology_fox.png | Bin 533320 -> 39 bytes static/pleromatan_apology_fox.png | Bin 40 -> 533320 bytes 4 files changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 120000 src/assets/pleromatan_apology_fox.png mode change 120000 => 100644 static/pleromatan_apology_fox.png (limited to 'src/App.js') diff --git a/index.html b/index.html index c6a12fc1..809318cf 100644 --- a/index.html +++ b/index.html @@ -22,6 +22,7 @@ font-family: sans-serif; color: #b9b9ba; position: absolute; + z-index: 99; " > Date: Mon, 16 Sep 2024 03:06:19 +0300 Subject: attemt to fix production --- index.html | 2 +- src/App.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/App.js') diff --git a/index.html b/index.html index 809318cf..474c0244 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@ font-family: sans-serif; color: #b9b9ba; position: absolute; - z-index: 99; + z-index: 999999; " > { + document.querySelector('#app').classList.remove('hidden') + document.querySelector('#splash').classList.add('hidden') + document.querySelector('#status').textContent = this.$t('splash.fun_' + Math.ceil(Math.random() * 4)) + }) } }, created () { -- cgit v1.2.3-70-g09d2 From 6c5fc53789538e393703ac1251d6cecdc9bb64bb Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 16 Sep 2024 03:36:17 +0300 Subject: fix production --- src/App.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/App.js') diff --git a/src/App.js b/src/App.js index e1ce8808..d2dd35c7 100644 --- a/src/App.js +++ b/src/App.js @@ -46,11 +46,7 @@ export default { }), watch: { themeApplied (value) { - this.$nextTick(() => { - document.querySelector('#app').classList.remove('hidden') - document.querySelector('#splash').classList.add('hidden') - document.querySelector('#status').textContent = this.$t('splash.fun_' + Math.ceil(Math.random() * 4)) - }) + this.removeSplash() } }, created () { @@ -59,6 +55,11 @@ export default { this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val }) window.addEventListener('resize', this.updateMobileState) }, + mounted () { + if (this.$store.state.interface.themeApplied) { + this.removeSplash() + } + }, unmounted () { window.removeEventListener('resize', this.updateMobileState) }, @@ -142,6 +143,11 @@ export default { updateMobileState () { this.$store.dispatch('setLayoutWidth', windowWidth()) this.$store.dispatch('setLayoutHeight', windowHeight()) + }, + removeSplash () { + document.querySelector('#status').textContent = this.$t('splash.fun_' + Math.ceil(Math.random() * 4)) + document.querySelector('#splash').classList.add('hidden') + document.querySelector('#app').classList.remove('hidden') } } } -- cgit v1.2.3-70-g09d2 From e004c4e087d4cf977a3fb713f5441c92028b83b6 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 18 Sep 2024 21:33:20 +0300 Subject: remove splash when it's done --- src/App.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/App.js') diff --git a/src/App.js b/src/App.js index d2dd35c7..e87108dd 100644 --- a/src/App.js +++ b/src/App.js @@ -146,7 +146,11 @@ export default { }, removeSplash () { document.querySelector('#status').textContent = this.$t('splash.fun_' + Math.ceil(Math.random() * 4)) - document.querySelector('#splash').classList.add('hidden') + const splashscreenRoot = document.querySelector('#splash') + splashscreenRoot.addEventListener('transitionend', () => { + splashscreenRoot.remove() + }) + splashscreenRoot.classList.add('hidden') document.querySelector('#app').classList.remove('hidden') } } -- cgit v1.2.3-70-g09d2