Compare commits
6 commits
108b8fe3f8
...
66febc0756
Author | SHA1 | Date | |
---|---|---|---|
|
66febc0756 | ||
|
452859fb0f | ||
|
8c25620c6b | ||
|
3cc9afc15f | ||
|
179fb9e527 | ||
|
79ae297121 |
8 changed files with 149 additions and 105 deletions
25
index.html
25
index.html
|
@ -70,6 +70,8 @@
|
|||
"P P . . ."
|
||||
"P P . E E"
|
||||
"P P . E E";
|
||||
|
||||
--logoChunkSize: calc(2em * 0.5 * var(--scale))
|
||||
}
|
||||
|
||||
.chunk {
|
||||
|
@ -99,6 +101,27 @@
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
#statusError {
|
||||
display: none;
|
||||
margin-top: 1em;
|
||||
font-size: calc(1vw + 1vh + 1vmin);
|
||||
line-height: 2;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#statusStack {
|
||||
display: none;
|
||||
margin-top: 1em;
|
||||
font-size: calc((1vw + 1vh + 1vmin) / 2.5);
|
||||
width: calc(100vw - 5em);
|
||||
padding: 1em;
|
||||
text-overflow: ellipsis;
|
||||
overflow-x: hidden;
|
||||
text-align: left;
|
||||
line-height: 2;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion) {
|
||||
#throbber {
|
||||
animation: none !important;
|
||||
|
@ -133,6 +156,8 @@
|
|||
<!-- it's a pseudographic, don't want screenreader read out nonsense -->
|
||||
<span aria-hidden="true" class="initial-text">(。>﹏<)</span>
|
||||
</div>
|
||||
<code id="statusError"></code>
|
||||
<pre id="statusStack"></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div id="app" class="hidden"></div>
|
||||
|
|
|
@ -348,12 +348,11 @@ const afterStoreSetup = async ({ store, i18n }) => {
|
|||
const server = (typeof overrides.target !== 'undefined') ? overrides.target : window.location.origin
|
||||
store.dispatch('setInstanceOption', { name: 'server', value: server })
|
||||
|
||||
document.querySelector('#status').textContent = i18n.global.t('splash.settings')
|
||||
await setConfig({ store })
|
||||
document.querySelector('#status').textContent = i18n.global.t('splash.theme')
|
||||
try {
|
||||
await store.dispatch('applyTheme').catch((e) => { console.error('Error setting theme', e) })
|
||||
} catch (e) {
|
||||
window.splashError(e)
|
||||
return Promise.reject(e)
|
||||
}
|
||||
|
||||
|
@ -361,7 +360,6 @@ const afterStoreSetup = async ({ store, i18n }) => {
|
|||
|
||||
// Now we can try getting the server settings and logging in
|
||||
// Most of these are preloaded into the index.html so blocking is minimized
|
||||
document.querySelector('#status').textContent = i18n.global.t('splash.instance')
|
||||
await Promise.all([
|
||||
checkOAuthToken({ store }),
|
||||
getInstancePanel({ store }),
|
||||
|
@ -408,7 +406,6 @@ const afterStoreSetup = async ({ store, i18n }) => {
|
|||
|
||||
// remove after vue 3.3
|
||||
app.config.unwrapInjectedRef = true
|
||||
document.querySelector('#status').textContent = i18n.global.t('splash.almost')
|
||||
|
||||
app.mount('#app')
|
||||
return app
|
||||
|
|
|
@ -1494,9 +1494,6 @@
|
|||
"splash": {
|
||||
"loading": "Loading...",
|
||||
"theme": "Applying theme, please wait warmly...",
|
||||
"instance": "Getting instance info...",
|
||||
"settings": "Applying settings...",
|
||||
"almost": "Reticulating splines...",
|
||||
"fun_1": "Drink more water",
|
||||
"fun_2": "Take it easy!",
|
||||
"fun_3": "Suya...",
|
||||
|
|
|
@ -68,6 +68,15 @@ const persistedStateOptions = {
|
|||
throbber.classList.add('dead')
|
||||
document.querySelector('#status').textContent = i18n.global.t('splash.error')
|
||||
console.error('PleromaFE failed to initialize: ', e)
|
||||
document.querySelector('#statusError').textContent = e
|
||||
document.querySelector('#statusStack').textContent = e.stack
|
||||
document.querySelector('#statusError').style = 'display: block'
|
||||
document.querySelector('#statusStack').style = 'display: block'
|
||||
}
|
||||
|
||||
window.splashError = e => splashError(i18n, e)
|
||||
window.splashUpdate = key => {
|
||||
document.querySelector('#status').textContent = i18n.global.t(key)
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
@ -563,8 +563,10 @@ const interfaceMod = {
|
|||
if (!forceRecompile && !themeDebug && await tryLoadCache()) {
|
||||
return commit('setThemeApplied')
|
||||
}
|
||||
window.splashUpdate('splash.theme')
|
||||
await dispatch('getThemeData')
|
||||
|
||||
try {
|
||||
const paletteIss = (() => {
|
||||
if (!state.paletteDataUsed) return null
|
||||
const result = {
|
||||
|
@ -667,8 +669,12 @@ const interfaceMod = {
|
|||
return applyTheme(
|
||||
rulesetArray.flat(),
|
||||
() => commit('setThemeApplied'),
|
||||
() => {},
|
||||
themeDebug
|
||||
)
|
||||
} catch (e) {
|
||||
window.splashError(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ export const tryLoadCache = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
export const applyTheme = (input, onFinish = (data) => {}, debug) => {
|
||||
export const applyTheme = (input, onEagerFinish = data => {}, onFinish = data => {}, debug) => {
|
||||
const eagerStyles = createStyleSheet(EAGER_STYLE_ID)
|
||||
const lazyStyles = createStyleSheet(LAZY_STYLE_ID)
|
||||
|
||||
|
@ -148,6 +148,7 @@ export const applyTheme = (input, onFinish = (data) => {}, debug) => {
|
|||
},
|
||||
onEagerFinished () {
|
||||
adoptStyleSheets([eagerStyles])
|
||||
onEagerFinish()
|
||||
},
|
||||
onLazyFinished () {
|
||||
adoptStyleSheets([eagerStyles, lazyStyles])
|
||||
|
|
|
@ -567,6 +567,7 @@ export const init = ({
|
|||
lazy,
|
||||
eager,
|
||||
staticVars,
|
||||
engineChecksum
|
||||
engineChecksum,
|
||||
themeChecksum: sum([lazy, eager])
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,13 +52,21 @@ Button:hover {
|
|||
}
|
||||
|
||||
Button:toggled {
|
||||
background: $blend(--bg 0.8 --accent)
|
||||
background: $blend(--bg 0.3 --accent)
|
||||
}
|
||||
|
||||
Button:pressed {
|
||||
background: $blend(--bg 0.8 --accent)
|
||||
}
|
||||
|
||||
Button:pressed:toggled {
|
||||
background: $blend(--bg 0.2 --accent)
|
||||
}
|
||||
|
||||
Button:toggled:hover {
|
||||
background: $blend(--bg 0.3 --accent)
|
||||
}
|
||||
|
||||
Input {
|
||||
shadow: --defaultInputBevel
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue