aboutsummaryrefslogtreecommitdiff
path: root/src/App.js
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2024-10-03 19:44:12 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2024-10-03 19:44:12 +0000
commit56a3bff267203017a704652117167569be0cd58a (patch)
tree24d433ca48c796c8787e4620cf145e9d31c7d539 /src/App.js
parent05c0b16a935c2799ece31845897d3a29d39e3eee (diff)
parent51a8b20a920d1d32d9812664557db92ab9b40d4c (diff)
Merge branch 'splashscreen' into 'develop'
Splash screen See merge request pleroma/pleroma-fe!1940
Diffstat (limited to 'src/App.js')
-rw-r--r--src/App.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/App.js b/src/App.js
index b7eb2f72..e87108dd 100644
--- a/src/App.js
+++ b/src/App.js
@@ -44,16 +44,29 @@ export default {
data: () => ({
mobileActivePanel: 'timeline'
}),
+ watch: {
+ themeApplied (value) {
+ this.removeSplash()
+ }
+ },
created () {
// Load the locale from the storage
const val = this.$store.getters.mergedConfig.interfaceLanguage
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)
},
computed: {
+ themeApplied () {
+ return this.$store.state.interface.themeApplied
+ },
classes () {
return [
{
@@ -130,6 +143,15 @@ 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))
+ const splashscreenRoot = document.querySelector('#splash')
+ splashscreenRoot.addEventListener('transitionend', () => {
+ splashscreenRoot.remove()
+ })
+ splashscreenRoot.classList.add('hidden')
+ document.querySelector('#app').classList.remove('hidden')
}
}
}