diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2024-10-03 19:44:12 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2024-10-03 19:44:12 +0000 |
| commit | 56a3bff267203017a704652117167569be0cd58a (patch) | |
| tree | 24d433ca48c796c8787e4620cf145e9d31c7d539 /src/App.js | |
| parent | 05c0b16a935c2799ece31845897d3a29d39e3eee (diff) | |
| parent | 51a8b20a920d1d32d9812664557db92ab9b40d4c (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.js | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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') } } } |
