From a190389f3c9f44072465560dce7203e9ce328f2c Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 4 Mar 2024 18:24:29 +0200 Subject: [PATCH 01/10] panels/statuses are looking really good now even with transparency --- src/components/conversation/conversation.vue | 12 ++- src/components/notification/notification.scss | 5 + src/components/panel.style.js | 1 + src/components/panel_header.style.js | 1 + src/components/status/post.style.js | 6 +- src/components/timeline/timeline.scss | 4 + src/components/user_card/user_card.scss | 8 -- src/components/user_card/user_card.vue | 5 +- src/components/user_panel/user_panel.vue | 13 ++- src/components/user_profile/user_profile.vue | 96 ++++++++++--------- src/panel.scss | 10 ++ src/services/theme_data/theme2_to_theme3.js | 3 + 12 files changed, 97 insertions(+), 67 deletions(-) diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue index 64aa13515..d3ebf791a 100644 --- a/src/components/conversation/conversation.vue +++ b/src/components/conversation/conversation.vue @@ -28,7 +28,10 @@ class="rightside-button" /> -
+
diff --git a/src/components/notification/notification.scss b/src/components/notification/notification.scss index ad05a2f38..2dbced099 100644 --- a/src/components/notification/notification.scss +++ b/src/components/notification/notification.scss @@ -5,6 +5,11 @@ word-wrap: break-word; word-break: break-word; + &.Status { + /* stylelint-disable-next-line declaration-no-important */ + background-color: transparent !important; + } + --emoji-size: 14px; &:hover { diff --git a/src/components/panel.style.js b/src/components/panel.style.js index d7459549a..ad16c18ff 100644 --- a/src/components/panel.style.js +++ b/src/components/panel.style.js @@ -23,6 +23,7 @@ export default { defaultRules: [ { directives: { + backgroundNoCssColor: 'yes', background: '--bg', roundness: 3, blur: '5px', diff --git a/src/components/panel_header.style.js b/src/components/panel_header.style.js index 56879fba0..32464bc50 100644 --- a/src/components/panel_header.style.js +++ b/src/components/panel_header.style.js @@ -15,6 +15,7 @@ export default { { component: 'PanelHeader', directives: { + backgroundNoCssColor: 'yes', background: '--fg', shadow: [] } diff --git a/src/components/status/post.style.js b/src/components/status/post.style.js index 673f72e0d..8dce527ec 100644 --- a/src/components/status/post.style.js +++ b/src/components/status/post.style.js @@ -20,15 +20,13 @@ export default { defaultRules: [ { directives: { - background: '--bg', - opacity: 0 + background: '--bg' } }, { state: ['selected'], directives: { - background: '--inheritedBackground, 10', - opacity: 1 + background: '--inheritedBackground, 10' } } ] diff --git a/src/components/timeline/timeline.scss b/src/components/timeline/timeline.scss index 7f886dc36..fccf28f47 100644 --- a/src/components/timeline/timeline.scss +++ b/src/components/timeline/timeline.scss @@ -1,6 +1,10 @@ @import "../../variables"; .Timeline { + .timeline-body { + background: none; + } + .alert-badge { font-size: 0.75em; line-height: 1; diff --git a/src/components/user_card/user_card.scss b/src/components/user_card/user_card.scss index 6dba34994..bf0ed5c23 100644 --- a/src/components/user_card/user_card.scss +++ b/src/components/user_card/user_card.scss @@ -21,14 +21,6 @@ position: relative; } - .panel-body { - word-wrap: break-word; - border-bottom-right-radius: inherit; - border-bottom-left-radius: inherit; - // create new stacking context - position: relative; - } - .background-image { position: absolute; top: 0; diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 0f627f62f..70c4f67df 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -282,10 +282,7 @@ />
-
+
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index 011f32da6..2d8b33e76 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -4,52 +4,54 @@ v-if="user" class="user-profile panel panel-default" > - - - + - {{ $t('user_card.birthday', { birthday: formattedBirthday }) }} - -
-
+
{{ error }} diff --git a/src/panel.scss b/src/panel.scss index 5df9fee41..083397654 100644 --- a/src/panel.scss +++ b/src/panel.scss @@ -1,5 +1,8 @@ /* stylelint-disable no-descending-specificity */ .panel { + --__panel-background: var(--background); + --__panel-backdrop-filter: var(--backdrop-filter); + position: relative; display: flex; flex-direction: column; @@ -28,6 +31,8 @@ .panel-body { padding: var(--panel-body-padding, 0); + background: var(--background); + backdrop-filter: var(--__panel-backdrop-filter); &:empty::before { content: "¯\\_(ツ)_/¯"; // Could use words but it'd require translations @@ -50,6 +55,7 @@ --__panel-heading-height: 3.2em; --__panel-heading-height-inner: calc(var(--__panel-heading-height) - 2 * var(--panel-heading-height-padding, 0)); + backdrop-filter: var(--__panel-backdrop-filter); position: relative; box-sizing: border-box; display: grid; @@ -131,6 +137,9 @@ border-radius: var(--roundness) var(--roundness) 0 0; border-width: 0 0 1px; align-items: start; + background-image: + linear-gradient(to bottom, var(--background), var(--background)), + linear-gradient(to bottom, var(--__panel-background), var(--__panel-background)); &::after { background-color: var(--background); @@ -186,5 +195,6 @@ border-width: 1px 0 0; border-style: solid; border-color: var(--border); + background-color: var(--__panel-background); } /* stylelint-enable no-descending-specificity */ diff --git a/src/services/theme_data/theme2_to_theme3.js b/src/services/theme_data/theme2_to_theme3.js index 8c623c698..75c823143 100644 --- a/src/services/theme_data/theme2_to_theme3.js +++ b/src/services/theme_data/theme2_to_theme3.js @@ -202,6 +202,9 @@ export const convertTheme2To3 = (data) => { newRules.push({ ...rule, component: 'Tab' }) newRules.push({ ...rule, component: 'Tab', state: ['active'], directives: { opacity: 0 } }) } + if (rule.component === 'Panel') { + newRules.push({ ...rule, component: 'Post' }) + } }) return newRules } From 545c875a857c129207624b4251cd7cdae1c24c67 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 4 Mar 2024 19:03:29 +0200 Subject: [PATCH 02/10] process chunks strictly sequentially to avoid overloading the event queue --- src/services/style_setter/style_setter.js | 26 ++++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index 69619a500..d875f0f0f 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -50,15 +50,25 @@ export const applyTheme = async (input) => { // Optimization - instead of processing all lazy rules in one go, process them in small chunks // so that UI can do other things and be somewhat responsive while less important rules are being // processed - chunk(themes3.lazy, 5).forEach(chunk => { - setTimeout(() => { - Promise.all(chunk.map(x => x())).then(result => { - getCssRules(result.filter(x => x), themes3.staticVars).forEach(rule => { - styleSheet.insertRule(rule, 'index-max') - }) + let counter = 0 + const chunks = chunk(themes3.lazy, 200) + // let t0 = performance.now() + const processChunk = () => { + const chunk = chunks[counter] + Promise.all(chunk.map(x => x())).then(result => { + getCssRules(result.filter(x => x), themes3.staticVars).forEach(rule => { + styleSheet.insertRule(rule, 'index-max') }) - }, 200) - }) + // const t1 = performance.now() + // console.debug('Chunk ' + counter + ' took ' + (t1 - t0) + 'ms') + // t0 = t1 + counter += 1 + if (counter < chunks.length) { + setTimeout(processChunk, 0) + } + }) + } + setTimeout(processChunk, 0) return Promise.resolve() } From 7238b218f9a0aa60a74eb49a3581aa25e0f1d3f2 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 4 Mar 2024 19:10:23 +0200 Subject: [PATCH 03/10] fix badgeNotification for themes2 --- src/services/theme_data/theme2_to_theme3.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/services/theme_data/theme2_to_theme3.js b/src/services/theme_data/theme2_to_theme3.js index 75c823143..e150369f2 100644 --- a/src/services/theme_data/theme2_to_theme3.js +++ b/src/services/theme_data/theme2_to_theme3.js @@ -126,7 +126,6 @@ export const convertTheme2To3 = (data) => { data.colors.link = data.colors.link || data.colors.accent const generateRoot = () => { const directives = {} - console.log(data.colors) basePaletteKeys.forEach(key => { directives['--' + key] = 'color | ' + convert(data.colors[key]).hex }) return { component: 'Root', @@ -506,7 +505,6 @@ export const convertTheme2To3 = (data) => { { ...newRule, component: 'Tab' }, { ...newRule, component: 'ScrollbarElement' } ] - console.log(newRule) if (newRule.state?.indexOf('toggled') >= 0) { rules.push({ ...newRule, state: [...newRule.state, 'focused'] }) rules.push({ ...newRule, state: [...newRule.state, 'hover'] }) @@ -516,6 +514,12 @@ export const convertTheme2To3 = (data) => { rules.push({ ...newRule, state: [...newRule.state, 'focused'] }) } return rules + } else if (newRule.component === 'Badge') { + if (newRule.variant === 'notification') { + return [newRule, { component: 'Root', directives: { '--badgeNotification': 'color | ' + newRule.directives.background } }] + } else { + return [newRule] + } } else if (newRule.component === 'TopBar') { return [newRule, { ...newRule, parent: { component: 'MobileDrawer' }, component: 'PanelHeader' }] } else { From 50a9c077fbf6d403caa4c383e5502eeda47f2ef8 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 4 Mar 2024 19:24:18 +0200 Subject: [PATCH 04/10] fix new chat window --- src/components/chat_new/chat_new.scss | 5 ---- src/components/chat_new/chat_new.vue | 43 ++++++++++++++------------- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/src/components/chat_new/chat_new.scss b/src/components/chat_new/chat_new.scss index b145ecf9a..b84e0beba 100644 --- a/src/components/chat_new/chat_new.scss +++ b/src/components/chat_new/chat_new.scss @@ -16,11 +16,6 @@ padding-bottom: 0.7rem; } - .basic-user-card:hover { - cursor: pointer; - background-color: var(--selectedPost, $fallback--lightBg); - } - .go-back-button { text-align: center; line-height: 1; diff --git a/src/components/chat_new/chat_new.vue b/src/components/chat_new/chat_new.vue index 34c85a279..5a872b66d 100644 --- a/src/components/chat_new/chat_new.vue +++ b/src/components/chat_new/chat_new.vue @@ -16,28 +16,29 @@ />
-
-