From cc4aaccf3834a18a32606ca175dc6bb910a78b60 Mon Sep 17 00:00:00 2001 From: tusooa Date: Wed, 27 Dec 2023 22:54:44 -0500 Subject: Implement indicator for groups --- src/components/user_avatar/user_avatar.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/components/user_avatar/user_avatar.vue') diff --git a/src/components/user_avatar/user_avatar.vue b/src/components/user_avatar/user_avatar.vue index 91c17611..3cbccec3 100644 --- a/src/components/user_avatar/user_avatar.vue +++ b/src/components/user_avatar/user_avatar.vue @@ -18,9 +18,14 @@ :class="{ '-compact': compact }" /> + @@ -79,7 +84,7 @@ height: 100%; } - .bot-indicator { + .actor-type-indicator { position: absolute; bottom: 0; right: 0; -- cgit v1.2.3-70-g09d2 From 17b25ef0e0eb261fbfd09be740a1cd8c0e3ad88b Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 12 Feb 2024 19:58:42 +0200 Subject: avatar shadows --- src/components/avatar.style.js | 20 ++++++++++++++++++++ src/components/notification.style.js | 3 ++- src/components/post.style.js | 3 ++- src/components/user_avatar/user_avatar.vue | 6 +++--- src/services/style_setter/style_setter.js | 3 ++- src/services/theme_data/theme_data_3.service.js | 19 +++++-------------- 6 files changed, 34 insertions(+), 20 deletions(-) create mode 100644 src/components/avatar.style.js (limited to 'src/components/user_avatar/user_avatar.vue') diff --git a/src/components/avatar.style.js b/src/components/avatar.style.js new file mode 100644 index 00000000..2262fd03 --- /dev/null +++ b/src/components/avatar.style.js @@ -0,0 +1,20 @@ +export default { + name: 'Avatar', + selector: '.Avatar', + defaultRules: [ + { + directives: { + background: '--bg', + opacity: 0, + shadow: [{ + x: 0, + y: 1, + blur: 8, + spread: 0, + color: '#000000', + alpha: 0.7 + }] + } + } + ] +} diff --git a/src/components/notification.style.js b/src/components/notification.style.js index 057b1c7a..0802da77 100644 --- a/src/components/notification.style.js +++ b/src/components/notification.style.js @@ -9,7 +9,8 @@ export default { 'Button', 'ButtonUnstyled', 'RichContent', - 'Input' + 'Input', + 'Avatar' ], defaultRules: [ { diff --git a/src/components/post.style.js b/src/components/post.style.js index 92ec230a..f4bd12a6 100644 --- a/src/components/post.style.js +++ b/src/components/post.style.js @@ -9,7 +9,8 @@ export default { 'Button', 'ButtonUnstyled', 'RichContent', - 'Input' + 'Input', + 'Avatar' ], defaultRules: [ { diff --git a/src/components/user_avatar/user_avatar.vue b/src/components/user_avatar/user_avatar.vue index 91c17611..2f2ba25a 100644 --- a/src/components/user_avatar/user_avatar.vue +++ b/src/components/user_avatar/user_avatar.vue @@ -30,9 +30,9 @@ @import "../../variables"; .Avatar { - --_avatarShadowBox: var(--avatarStatusShadow); - --_avatarShadowFilter: var(--avatarStatusShadowFilter); - --_avatarShadowInset: var(--avatarStatusShadowInset); + --_avatarShadowBox: var(--shadow); + --_avatarShadowFilter: var(--shadowFilter); + --_avatarShadowInset: var(--shadowInset); --_still-image-label-visibility: hidden; display: inline-block; diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index 7429f323..b86f241a 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -11,9 +11,9 @@ export const applyTheme = (input) => { const t0 = performance.now() const { rules, t3b } = generatePreset(input) const t1 = performance.now() + console.log('Themes 2 initialization took ' + (t1 - t0) + 'ms') const themes3 = init(sampleRules, t3b) const t2 = performance.now() - console.log('Themes 2 initialization took ' + (t1 - t0) + 'ms') console.log('Themes 3 initialization took ' + (t2 - t1) + 'ms') const head = document.head const body = document.body @@ -29,6 +29,7 @@ export const applyTheme = (input) => { // styleSheet.insertRule(`:root { ${rules.shadows} }`, 'index-max') styleSheet.insertRule(`:root { ${rules.fonts} }`, 'index-max') themes3.css.forEach(rule => { + console.log(rule) styleSheet.insertRule(rule, 'index-max') }) body.classList.remove('hidden') diff --git a/src/services/theme_data/theme_data_3.service.js b/src/services/theme_data/theme_data_3.service.js index 9cab6dd4..3210c678 100644 --- a/src/services/theme_data/theme_data_3.service.js +++ b/src/services/theme_data/theme_data_3.service.js @@ -26,20 +26,10 @@ import Border from 'src/components/border.style.js' import Post from 'src/components/post.style.js' import Notification from 'src/components/notification.style.js' import RichContent from 'src/components/rich_content.style.js' +import Avatar from 'src/components/avatar.style.js' const DEBUG = false -export const DEFAULT_SHADOWS = { - avatar: [{ - x: 0, - y: 1, - blur: 8, - spread: 0, - color: '#000000', - alpha: 0.7 - }] -} - const components = { Root, Text, @@ -59,7 +49,8 @@ const components = { Input, Post, Notification, - RichContent + RichContent, + Avatar } // "Unrolls" a tree structure of item: { parent: { ...item2, parent: { ...item3, parent: {...} } }} @@ -372,7 +363,7 @@ export const init = (extraRuleset, palette) => { // Normalizing states and variants to always include "normal" const states = { normal: '', ...originalStates } const variants = { normal: '', ...originalVariants } - const innerComponents = validInnerComponents.map(name => components[name]) + const innerComponents = (validInnerComponents).map(name => components[name]) // Optimization: we only really need combinations without "normal" because all states implicitly have it const permutationStateKeys = Object.keys(states).filter(s => s !== 'normal') @@ -448,7 +439,6 @@ export const init = (extraRuleset, palette) => { dynamicVars.inheritedBackground = lowerLevelBackground - // TODO properly provide "parent" text color? const intendedTextColor = convert(findColor(inheritedTextColor, dynamicVars)).rgb const textColor = newTextRule.directives.textAuto === 'no-auto' ? intendedTextColor @@ -495,6 +485,7 @@ export const init = (extraRuleset, palette) => { } else { computed[selector] = computed[selector] || {} + // TODO make background non-mandatory if (computedDirectives.background) { let inheritRule = null const variantRules = ruleset.filter(findRules({ component: component.name, variant: combination.variant, parent })) -- cgit v1.2.3-70-g09d2 From bcc50844096b47c0656ed3338de222055a749fb1 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 13 Feb 2024 02:09:43 +0200 Subject: add roundness, fix inputs --- src/App.scss | 27 ++++++----- src/components/autosuggest/autosuggest.vue | 10 ++--- src/components/avatar.style.js | 6 ++- src/components/button.style.js | 3 +- src/components/button_unstyled.style.js | 4 +- src/components/chat/chat.scss | 5 ++- src/components/emoji_input/emoji_input.vue | 19 +++----- src/components/input.style.js | 1 + src/components/link-preview/link-preview.vue | 6 +-- src/components/menu_item.style.js | 9 +++- src/components/mobile_nav/mobile_nav.vue | 4 +- .../moderation_tools/moderation_tools.vue | 14 +++--- src/components/nav_panel/nav_panel.vue | 12 ++--- src/components/navigation/navigation_pins.vue | 2 +- .../notifications/notification_filters.vue | 14 +++--- src/components/panel.style.js | 1 + src/components/popover.style.js | 1 + src/components/popover/popover.vue | 15 +++---- .../quick_filter_settings.vue | 12 ++--- .../quick_view_settings/quick_view_settings.vue | 10 ++--- src/components/root.style.js | 8 ---- .../settings_modal/tabs/profile_tab.scss | 3 +- src/components/shadow_control/shadow_control.vue | 6 +-- src/components/shout_panel/shout_panel.vue | 3 +- src/components/status/status.scss | 5 +-- src/components/status_popover/status_popover.vue | 5 +-- src/components/timeline/timeline.scss | 5 +-- src/components/user_avatar/user_avatar.vue | 14 +++--- src/components/user_card/user_card.scss | 3 +- src/components/user_list_menu/user_list_menu.vue | 2 +- src/panel.scss | 17 +++---- src/services/style_setter/style_setter.js | 2 +- src/services/theme_data/theme_data_3.service.js | 52 +++++++++++++++++----- 33 files changed, 150 insertions(+), 150 deletions(-) (limited to 'src/components/user_avatar/user_avatar.vue') diff --git a/src/App.scss b/src/App.scss index 6a634926..8efa1328 100644 --- a/src/App.scss +++ b/src/App.scss @@ -355,8 +355,7 @@ nav { user-select: none; color: var(--text); border: none; - border-radius: $fallback--btnRadius; - border-radius: var(--btnRadius, $fallback--btnRadius); + border-radius: var(--roundness); cursor: pointer; box-shadow: var(--shadow); font-size: 1em; @@ -380,6 +379,16 @@ nav { font-family: inherit; cursor: pointer; color: inherit; + + &:first-child { + border-top-right-radius: var(--roundness); + border-top-left-radius: var(--roundness); + } + + &:last-child { + border-bottom-right-radius: var(--roundness); + border-bottom-left-radius: var(--roundness); + } } .button-unstyled { @@ -423,8 +432,7 @@ textarea { --_padding: 0.5em; border: none; - border-radius: $fallback--inputRadius; - border-radius: var(--inputRadius, $fallback--inputRadius); + border-radius: var(--roundness); box-shadow: var(--shadow); font-family: sans-serif; font-family: var(--inputFont, sans-serif); @@ -511,8 +519,7 @@ textarea { transition: color 200ms; width: 1.1em; height: 1.1em; - border-radius: $fallback--checkboxRadius; - border-radius: var(--checkboxRadius, $fallback--checkboxRadius); + border-radius: var(--roundness); box-shadow: 0 0 2px black inset; box-shadow: var(--inputShadow); margin-right: 0.5em; @@ -562,7 +569,7 @@ option { li { border: 1px solid var(--border); - border-radius: var(--inputRadius); + border-radius: var(--roundness); padding: 0.5em; margin: 0.25em; } @@ -634,8 +641,7 @@ option { .alert { margin: 0 0.35em; padding: 0 0.25em; - border-radius: $fallback--tooltipRadius; - border-radius: var(--tooltipRadius, $fallback--tooltipRadius); + border-radius: var(--roundness); &.error { background-color: $fallback--alertError; @@ -682,8 +688,7 @@ option { padding: 0.5em; border: 1px solid $fallback--faint; border: 1px solid var(--faint, $fallback--faint); - border-radius: $fallback--inputRadius; - border-radius: var(--inputRadius, $fallback--inputRadius); + border-radius: var(--roundness); } .notice-dismissible { diff --git a/src/components/autosuggest/autosuggest.vue b/src/components/autosuggest/autosuggest.vue index 64cc11a4..7912db94 100644 --- a/src/components/autosuggest/autosuggest.vue +++ b/src/components/autosuggest/autosuggest.vue @@ -1,3 +1,4 @@ +