From 8f63bbb64fa2860e73d8562de9d6c62629a8668f Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 13 Jan 2020 00:33:04 +0200 Subject: poll slot renamed, lightBg customization implemented --- src/components/side_drawer/side_drawer.vue | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/components/side_drawer/side_drawer.vue') diff --git a/src/components/side_drawer/side_drawer.vue b/src/components/side_drawer/side_drawer.vue index 3fba9058..6d75221f 100644 --- a/src/components/side_drawer/side_drawer.vue +++ b/src/components/side_drawer/side_drawer.vue @@ -290,6 +290,11 @@ &:hover { background-color: $fallback--lightBg; background-color: var(--lightBg, $fallback--lightBg); + color: $fallback--text; + color: var(--lightBgText, $fallback--text); + --faint: var(--lightBgFaintText, $fallback--faint); + --faintLink: var(--lightBgFaintLink, $fallback--faint); + --icon: var(--lightBgIcon, $fallback--icon); } } } -- cgit v1.2.3-70-g09d2 From 8a7f3fc16a511e6c5917c0e25cba1f6163659264 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 13 Jan 2020 20:40:16 +0200 Subject: selectedPost and selectedMenu support --- src/components/emoji_input/emoji_input.vue | 10 ++--- src/components/nav_panel/nav_panel.vue | 20 ++++----- src/components/selectable_list/selectable_list.vue | 10 ++--- src/components/side_drawer/side_drawer.vue | 10 ++--- src/components/status/status.vue | 10 ++--- src/components/style_switcher/style_switcher.vue | 46 +++++++++++++++++++ src/services/theme_data/theme_data.service.js | 52 ++++++++++++++++++++++ 7 files changed, 128 insertions(+), 30 deletions(-) (limited to 'src/components/side_drawer/side_drawer.vue') diff --git a/src/components/emoji_input/emoji_input.vue b/src/components/emoji_input/emoji_input.vue index dcf51ff9..46ed6f25 100644 --- a/src/components/emoji_input/emoji_input.vue +++ b/src/components/emoji_input/emoji_input.vue @@ -157,11 +157,11 @@ &.highlighted { background-color: $fallback--fg; - background-color: var(--lightBg, $fallback--fg); - color: var(--lightBgText, $fallback--text); - --faint: var(--lightBgFaintText, $fallback--faint); - --faintLink: var(--lightBgFaintLink, $fallback--faint); - --icon: var(--lightBgIcon, $fallback--icon); + background-color: var(--selectedMenu, $fallback--fg); + color: var(--selectedMenuText, $fallback--text); + --faint: var(--selectedMenuFaintText, $fallback--faint); + --faintLink: var(--selectedMenuFaintLink, $fallback--faint); + --icon: var(--selectedMenuIcon, $fallback--icon); } } } diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue index 0886bf8c..afc611ea 100644 --- a/src/components/nav_panel/nav_panel.vue +++ b/src/components/nav_panel/nav_panel.vue @@ -100,23 +100,23 @@ &:hover { background-color: $fallback--lightBg; - background-color: var(--lightBg, $fallback--lightBg); + background-color: var(--selectedMenu, $fallback--lightBg); color: $fallback--link; - color: var(--lightBgText, $fallback--link); - --faint: var(--lightBgFaintText, $fallback--faint); - --faintLink: var(--lightBgFaintLink, $fallback--faint); - --icon: var(--lightBgIcon, $fallback--icon); + color: var(--selectedMenuText, $fallback--link); + --faint: var(--selectedMenuFaintText, $fallback--faint); + --faintLink: var(--selectedMenuFaintLink, $fallback--faint); + --icon: var(--selectedMenuIcon, $fallback--icon); } &.router-link-active { font-weight: bolder; background-color: $fallback--lightBg; - background-color: var(--lightBg, $fallback--lightBg); + background-color: var(--selectedMenu, $fallback--lightBg); color: $fallback--text; - color: var(--lightBgText, $fallback--text); - --faint: var(--lightBgFaintText, $fallback--faint); - --faintLink: var(--lightBgFaintLink, $fallback--faint); - --icon: var(--lightBgIcon, $fallback--icon); + color: var(--selectedMenuText, $fallback--text); + --faint: var(--selectedMenuFaintText, $fallback--faint); + --faintLink: var(--selectedMenuFaintLink, $fallback--faint); + --icon: var(--selectedMenuIcon, $fallback--icon); &:hover { text-decoration: underline; diff --git a/src/components/selectable_list/selectable_list.vue b/src/components/selectable_list/selectable_list.vue index 416c9b6a..2d1e44a3 100644 --- a/src/components/selectable_list/selectable_list.vue +++ b/src/components/selectable_list/selectable_list.vue @@ -68,11 +68,11 @@ &-item-selected-inner { background-color: $fallback--lightBg; - background-color: var(--lightBg, $fallback--lightBg); - color: var(--lightBgText, $fallback--text); - --faint: var(--lightBgFaintText, $fallback--faint); - --faintLink: var(--lightBgFaintLink, $fallback--faint); - --icon: var(--lightBgIcon, $fallback--icon); + background-color: var(--selectedMenu, $fallback--lightBg); + color: var(--selectedMenuText, $fallback--text); + --faint: var(--selectedMenuFaintText, $fallback--faint); + --faintLink: var(--selectedMenuFaintLink, $fallback--faint); + --icon: var(--selectedMenuIcon, $fallback--icon); } &-header { diff --git a/src/components/side_drawer/side_drawer.vue b/src/components/side_drawer/side_drawer.vue index 6d75221f..3188fd59 100644 --- a/src/components/side_drawer/side_drawer.vue +++ b/src/components/side_drawer/side_drawer.vue @@ -289,12 +289,12 @@ &:hover { background-color: $fallback--lightBg; - background-color: var(--lightBg, $fallback--lightBg); + background-color: var(--selectedMenu, $fallback--lightBg); color: $fallback--text; - color: var(--lightBgText, $fallback--text); - --faint: var(--lightBgFaintText, $fallback--faint); - --faintLink: var(--lightBgFaintLink, $fallback--faint); - --icon: var(--lightBgIcon, $fallback--icon); + color: var(--selectedMenuText, $fallback--text); + --faint: var(--selectedMenuFaintText, $fallback--faint); + --faintLink: var(--selectedMenuFaintLink, $fallback--faint); + --icon: var(--selectedMenuIcon, $fallback--icon); } } } diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 72e9b25a..38d091ed 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -445,12 +445,12 @@ $status-margin: 0.75em; &_focused { background-color: $fallback--lightBg; - background-color: var(--lightBg, $fallback--lightBg); + background-color: var(--selectedPost, $fallback--lightBg); color: $fallback--text; - color: var(--lightBgText, $fallback--text); - --faint: var(--lightBgFaintText, $fallback--faint); - --faintLink: var(--lightBgFaintLink, $fallback--faint); - --icon: var(--lightBgIcon, $fallback--icon); + color: var(--selectedPostText, $fallback--text); + --faint: var(--selectedPostFaintText, $fallback--faint); + --faintLink: var(--selectedPostFaintLink, $fallback--faint); + --icon: var(--selectedPostIcon, $fallback--icon); } .timeline & { diff --git a/src/components/style_switcher/style_switcher.vue b/src/components/style_switcher/style_switcher.vue index f2fdfea2..613abd1f 100644 --- a/src/components/style_switcher/style_switcher.vue +++ b/src/components/style_switcher/style_switcher.vue @@ -465,6 +465,52 @@ /> +
+

{{ $t('settings.style.advanced_colors.selectedPost') }}

+ + + + + +
+
+

{{ $t('settings.style.advanced_colors.selectedMenu') }}

+ + + + + +
mixrgb(bg, text) }, + selectedPost: '--lightBg', + selectedPostFaintText: { + depends: ['lightBgFaintText'], + layer: 'lightBg', + textColor: true + }, + selectedPostFaintLink: { + depends: ['lightBgFaintLink'], + layer: 'lightBg', + textColor: 'preserve' + }, + selectedPostText: { + depends: ['lightBgText'], + layer: 'lightBg', + textColor: true + }, + selectedPostLink: { + depends: ['lightBgLink'], + layer: 'lightBg', + textColor: 'preserve' + }, + selectedPostIcon: { + depends: ['selectedPost', 'selectedPostText'], + color: (mod, bg, text) => mixrgb(bg, text) + }, + + selectedMenu: '--lightBg', + selectedMenuFaintText: { + depends: ['lightBgFaintText'], + layer: 'lightBg', + textColor: true + }, + selectedMenuFaintLink: { + depends: ['lightBgFaintLink'], + layer: 'lightBg', + textColor: 'preserve' + }, + selectedMenuText: { + depends: ['lightBgText'], + layer: 'lightBg', + textColor: true + }, + selectedMenuLink: { + depends: ['lightBgLink'], + layer: 'lightBg', + textColor: 'preserve' + }, + selectedMenuIcon: { + depends: ['selectedMenu', 'selectedMenuText'], + color: (mod, bg, text) => mixrgb(bg, text) + }, + lightText: { depends: ['text'], color: (mod, text) => brightness(20 * mod, text).rgb -- cgit v1.2.3-70-g09d2 From 53576df72aff5405ab30764e5cfcf2162bde37bc Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 24 Jan 2020 00:02:16 +0200 Subject: popover/selected menu improvements --- src/components/emoji_input/emoji_input.vue | 11 +++--- src/components/popper/popper.scss | 7 +++- src/components/side_drawer/side_drawer.vue | 7 +++- src/components/style_switcher/style_switcher.vue | 29 ++++++++++++++++ src/services/theme_data/pleromafe.js | 44 +++++++++++++++++++++--- 5 files changed, 87 insertions(+), 11 deletions(-) (limited to 'src/components/side_drawer/side_drawer.vue') diff --git a/src/components/emoji_input/emoji_input.vue b/src/components/emoji_input/emoji_input.vue index 46ed6f25..9c2501a9 100644 --- a/src/components/emoji_input/emoji_input.vue +++ b/src/components/emoji_input/emoji_input.vue @@ -109,10 +109,13 @@ box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5); box-shadow: var(--popupShadow); min-width: 75%; - background: $fallback--bg; - background: var(--bg, $fallback--bg); - color: $fallback--lightText; - color: var(--lightText, $fallback--lightText); + background-color: $fallback--bg; + background-color: var(--popover, $fallback--bg); + color: $fallback--link; + color: var(--popoverText, $fallback--link); + --faint: var(--popoverFaintText, $fallback--faint); + --faintLink: var(--popoverFaintLink, $fallback--faint); + --icon: var(--popoverIcon, $fallback--icon); } } diff --git a/src/components/popper/popper.scss b/src/components/popper/popper.scss index 9c2ce25f..e70b277d 100644 --- a/src/components/popper/popper.scss +++ b/src/components/popper/popper.scss @@ -9,7 +9,12 @@ border-radius: $fallback--btnRadius; border-radius: var(--btnRadius, $fallback--btnRadius); background-color: $fallback--bg; - background-color: var(--bg, $fallback--bg); + background-color: var(--popover, $fallback--bg); + color: $fallback--text; + color: var(--popoverText, $fallback--text); + --faint: var(--popoverFaintText, $fallback--faint); + --faintLink: var(--popoverFaintLink, $fallback--faint); + --icon: var(--popoverIcon, $fallback--icon); } .popover-arrow { diff --git a/src/components/side_drawer/side_drawer.vue b/src/components/side_drawer/side_drawer.vue index 3188fd59..a5b754d7 100644 --- a/src/components/side_drawer/side_drawer.vue +++ b/src/components/side_drawer/side_drawer.vue @@ -223,7 +223,12 @@ box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6); box-shadow: var(--panelShadow); background-color: $fallback--bg; - background-color: var(--bg, $fallback--bg); + background-color: var(--popover, $fallback--bg); + color: $fallback--link; + color: var(--popoverText, $fallback--link); + --faint: var(--popoverFaintText, $fallback--faint); + --faintLink: var(--popoverFaintLink, $fallback--faint); + --icon: var(--popoverIcon, $fallback--icon); .button-icon:before { width: 1.1em; diff --git a/src/components/style_switcher/style_switcher.vue b/src/components/style_switcher/style_switcher.vue index ff7f4710..1c39a806 100644 --- a/src/components/style_switcher/style_switcher.vue +++ b/src/components/style_switcher/style_switcher.vue @@ -554,6 +554,35 @@ />
+
+

{{ $t('settings.style.advanced_colors.popover') }}

+ + + + + + +

{{ $t('settings.style.advanced_colors.selectedPost') }}

mixrgb(bg, text) }, + popover: { + depends: ['bg'], + opacity: 'popover' + }, + popoverFaintText: { + depends: ['faint'], + layer: 'popover', + textColor: true + }, + popoverFaintLink: { + depends: ['faintLink'], + layer: 'popover', + textColor: 'preserve' + }, + popoverText: { + depends: ['text'], + layer: 'popover', + textColor: true + }, + popoverLink: { + depends: ['link'], + layer: 'popover', + textColor: 'preserve' + }, + popoverIcon: { + depends: ['popover', 'popoverText'], + color: (mod, bg, text) => mixrgb(bg, text) + }, + selectedPost: '--highlight', selectedPostFaintText: { depends: ['highlightFaintText'], @@ -170,28 +201,31 @@ export const SLOT_INHERITANCE = { color: (mod, bg, text) => mixrgb(bg, text) }, - selectedMenu: '--highlight', + selectedMenu: { + depends: ['popover'], + color: (mod, bg) => brightness(5 * mod, bg).rgb + }, selectedMenuFaintText: { depends: ['highlightFaintText'], - layer: 'highlight', + layer: 'selectedMenu', variant: 'selectedMenu', textColor: true }, selectedMenuFaintLink: { depends: ['highlightFaintLink'], - layer: 'highlight', + layer: 'selectedMenu', variant: 'selectedMenu', textColor: 'preserve' }, selectedMenuText: { depends: ['highlightText'], - layer: 'highlight', + layer: 'selectedMenu', variant: 'selectedMenu', textColor: true }, selectedMenuLink: { depends: ['highlightLink'], - layer: 'highlight', + layer: 'selectedMenu', variant: 'selectedMenu', textColor: 'preserve' }, -- cgit v1.2.3-70-g09d2 From b96993e4dd6b2d9197b430af404e8fa652888b51 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 24 Jan 2020 00:36:32 +0200 Subject: improved selectedMenu again --- src/components/emoji_input/emoji_input.vue | 12 +++-- src/components/emoji_picker/emoji_picker.scss | 9 ++++ src/components/nav_panel/nav_panel.vue | 2 + src/components/popper/popper.scss | 12 +++-- src/components/selectable_list/selectable_list.vue | 1 + src/components/side_drawer/side_drawer.vue | 12 +++-- src/components/status/status.vue | 1 + src/services/color_convert/color_convert.js | 2 +- src/services/theme_data/pleromafe.js | 63 +++++++++++++++++++++- src/services/theme_data/theme_data.service.js | 7 +-- static/themes/breezy-dark.json | 4 +- static/themes/breezy-light.json | 4 +- 12 files changed, 105 insertions(+), 24 deletions(-) (limited to 'src/components/side_drawer/side_drawer.vue') diff --git a/src/components/emoji_input/emoji_input.vue b/src/components/emoji_input/emoji_input.vue index 9c2501a9..94eae560 100644 --- a/src/components/emoji_input/emoji_input.vue +++ b/src/components/emoji_input/emoji_input.vue @@ -115,6 +115,7 @@ color: var(--popoverText, $fallback--link); --faint: var(--popoverFaintText, $fallback--faint); --faintLink: var(--popoverFaintLink, $fallback--faint); + --lightText: var(--popoverLightText, $fallback--lightText); --icon: var(--popoverIcon, $fallback--icon); } } @@ -160,11 +161,12 @@ &.highlighted { background-color: $fallback--fg; - background-color: var(--selectedMenu, $fallback--fg); - color: var(--selectedMenuText, $fallback--text); - --faint: var(--selectedMenuFaintText, $fallback--faint); - --faintLink: var(--selectedMenuFaintLink, $fallback--faint); - --icon: var(--selectedMenuIcon, $fallback--icon); + background-color: var(--selectedMenuPopover, $fallback--fg); + color: var(--selectedMenuPopoverText, $fallback--text); + --faint: var(--selectedMenuPopoverFaintText, $fallback--faint); + --faintLink: var(--selectedMenuPopoverFaintLink, $fallback--faint); + --lightText: var(--selectedMenuPopoverLightText, $fallback--lightText); + --icon: var(--selectedMenuPopoverIcon, $fallback--icon); } } } diff --git a/src/components/emoji_picker/emoji_picker.scss b/src/components/emoji_picker/emoji_picker.scss index 6608f393..8bd07e45 100644 --- a/src/components/emoji_picker/emoji_picker.scss +++ b/src/components/emoji_picker/emoji_picker.scss @@ -8,6 +8,15 @@ left: 0; margin: 0 !important; z-index: 1; + background-color: $fallback--bg; + background-color: var(--popover, $fallback--bg); + color: $fallback--link; + color: var(--popoverText, $fallback--link); + --lightText: var(--popoverLightText, $fallback--faint); + --faint: var(--popoverFaintText, $fallback--faint); + --faintLink: var(--popoverFaintLink, $fallback--faint); + --lightText: var(--popoverLightText, $fallback--lightText); + --icon: var(--popoverIcon, $fallback--icon); .keep-open, .too-many-emoji { diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue index afc611ea..a934a411 100644 --- a/src/components/nav_panel/nav_panel.vue +++ b/src/components/nav_panel/nav_panel.vue @@ -105,6 +105,7 @@ color: var(--selectedMenuText, $fallback--link); --faint: var(--selectedMenuFaintText, $fallback--faint); --faintLink: var(--selectedMenuFaintLink, $fallback--faint); + --lightText: var(--selectedMenuLightText, $fallback--lightText); --icon: var(--selectedMenuIcon, $fallback--icon); } @@ -116,6 +117,7 @@ color: var(--selectedMenuText, $fallback--text); --faint: var(--selectedMenuFaintText, $fallback--faint); --faintLink: var(--selectedMenuFaintLink, $fallback--faint); + --lightText: var(--selectedMenuLightText, $fallback--lightText); --icon: var(--selectedMenuIcon, $fallback--icon); &:hover { diff --git a/src/components/popper/popper.scss b/src/components/popper/popper.scss index e70b277d..591be37e 100644 --- a/src/components/popper/popper.scss +++ b/src/components/popper/popper.scss @@ -14,6 +14,7 @@ color: var(--popoverText, $fallback--text); --faint: var(--popoverFaintText, $fallback--faint); --faintLink: var(--popoverFaintLink, $fallback--faint); + --lightText: var(--popoverLightText, $fallback--lightText); --icon: var(--popoverIcon, $fallback--icon); } @@ -144,12 +145,13 @@ &:active, &:hover { background-color: $fallback--lightBg; - background-color: var(--selectedMenu, $fallback--lightBg); + background-color: var(--selectedMenuPopover, $fallback--lightBg); color: $fallback--link; - color: var(--selectedMenuText, $fallback--link); - --faint: var(--selectedMenuFaintText, $fallback--faint); - --faintLink: var(--selectedMenuFaintLink, $fallback--faint); - --icon: var(--selectedMenuIcon, $fallback--icon); + color: var(--selectedMenuPopoverText, $fallback--link); + --faint: var(--selectedMenuPopoverFaintText, $fallback--faint); + --faintLink: var(--selectedMenuPopoverFaintLink, $fallback--faint); + --lightText: var(--selectedMenuPopoverLightText, $fallback--lightText); + --icon: var(--selectedMenuPopoverIcon, $fallback--icon); } } } diff --git a/src/components/selectable_list/selectable_list.vue b/src/components/selectable_list/selectable_list.vue index 2d1e44a3..a9bb12a1 100644 --- a/src/components/selectable_list/selectable_list.vue +++ b/src/components/selectable_list/selectable_list.vue @@ -72,6 +72,7 @@ color: var(--selectedMenuText, $fallback--text); --faint: var(--selectedMenuFaintText, $fallback--faint); --faintLink: var(--selectedMenuFaintLink, $fallback--faint); + --lightText: var(--selectedMenuLightText, $fallback--lightText); --icon: var(--selectedMenuIcon, $fallback--icon); } diff --git a/src/components/side_drawer/side_drawer.vue b/src/components/side_drawer/side_drawer.vue index a5b754d7..25e4de01 100644 --- a/src/components/side_drawer/side_drawer.vue +++ b/src/components/side_drawer/side_drawer.vue @@ -228,6 +228,7 @@ color: var(--popoverText, $fallback--link); --faint: var(--popoverFaintText, $fallback--faint); --faintLink: var(--popoverFaintLink, $fallback--faint); + --lightText: var(--popoverLightText, $fallback--lightText); --icon: var(--popoverIcon, $fallback--icon); .button-icon:before { @@ -294,12 +295,13 @@ &:hover { background-color: $fallback--lightBg; - background-color: var(--selectedMenu, $fallback--lightBg); + background-color: var(--selectedMenuPopover, $fallback--lightBg); color: $fallback--text; - color: var(--selectedMenuText, $fallback--text); - --faint: var(--selectedMenuFaintText, $fallback--faint); - --faintLink: var(--selectedMenuFaintLink, $fallback--faint); - --icon: var(--selectedMenuIcon, $fallback--icon); + color: var(--selectedMenuPopoverText, $fallback--text); + --faint: var(--selectedMenuPopoverFaintText, $fallback--faint); + --faintLink: var(--selectedMenuPopoverFaintLink, $fallback--faint); + --lightText: var(--selectedMenuPopoverLightText, $fallback--lightText); + --icon: var(--selectedMenuPopoverIcon, $fallback--icon); } } } diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 38d091ed..1997e187 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -448,6 +448,7 @@ $status-margin: 0.75em; background-color: var(--selectedPost, $fallback--lightBg); color: $fallback--text; color: var(--selectedPostText, $fallback--text); + --lightText: var(--selectedPostLightText, $fallback--light); --faint: var(--selectedPostFaintText, $fallback--faint); --faintLink: var(--selectedPostFaintLink, $fallback--faint); --icon: var(--selectedPostIcon, $fallback--icon); diff --git a/src/services/color_convert/color_convert.js b/src/services/color_convert/color_convert.js index 93cb1ba6..0bf8f646 100644 --- a/src/services/color_convert/color_convert.js +++ b/src/services/color_convert/color_convert.js @@ -69,7 +69,7 @@ const srgbToLinear = (srgb) => { * @param {Object} srgb - sRGB color * @returns {Number} relative luminance */ -const relativeLuminance = (srgb) => { +export const relativeLuminance = (srgb) => { const { r, g, b } = srgbToLinear(srgb) return 0.2126 * r + 0.7152 * g + 0.0722 * b } diff --git a/src/services/theme_data/pleromafe.js b/src/services/theme_data/pleromafe.js index 484874d7..a40d08a6 100644 --- a/src/services/theme_data/pleromafe.js +++ b/src/services/theme_data/pleromafe.js @@ -117,6 +117,11 @@ export const SLOT_INHERITANCE = { depends: ['bg'], color: (mod, bg) => brightness(5 * mod, bg).rgb }, + highlightLightText: { + depends: ['lightText'], + layer: 'highlight', + textColor: true + }, highlightFaintText: { depends: ['faint'], layer: 'highlight', @@ -146,6 +151,11 @@ export const SLOT_INHERITANCE = { depends: ['bg'], opacity: 'popover' }, + popoverLightText: { + depends: ['lightText'], + layer: 'popover', + textColor: true + }, popoverFaintText: { depends: ['faint'], layer: 'popover', @@ -178,6 +188,12 @@ export const SLOT_INHERITANCE = { variant: 'selectedPost', textColor: true }, + selectedPostLightText: { + depends: ['highlightLightText'], + layer: 'highlight', + variant: 'selectedPost', + textColor: true + }, selectedPostFaintLink: { depends: ['highlightFaintLink'], layer: 'highlight', @@ -202,9 +218,15 @@ export const SLOT_INHERITANCE = { }, selectedMenu: { - depends: ['popover'], + depends: ['bg'], color: (mod, bg) => brightness(5 * mod, bg).rgb }, + selectedMenuLightText: { + depends: ['highlightLightText'], + layer: 'selectedMenu', + variant: 'selectedMenu', + textColor: true + }, selectedMenuFaintText: { depends: ['highlightFaintText'], layer: 'selectedMenu', @@ -234,6 +256,45 @@ export const SLOT_INHERITANCE = { color: (mod, bg, text) => mixrgb(bg, text) }, + selectedMenuPopover: { + depends: ['popover'], + color: (mod, bg) => brightness(5 * mod, bg).rgb + }, + selectedMenuPopoverLightText: { + depends: ['selectedMenuLightText'], + layer: 'selectedMenuPopover', + variant: 'selectedMenuPopover', + textColor: true + }, + selectedMenuPopoverFaintText: { + depends: ['selectedMenuFaintText'], + layer: 'selectedMenuPopover', + variant: 'selectedMenuPopover', + textColor: true + }, + selectedMenuPopoverFaintLink: { + depends: ['selectedMenuFaintLink'], + layer: 'selectedMenuPopover', + variant: 'selectedMenuPopover', + textColor: 'preserve' + }, + selectedMenuPopoverText: { + depends: ['selectedMenuText'], + layer: 'selectedMenuPopover', + variant: 'selectedMenuPopover', + textColor: true + }, + selectedMenuPopoverLink: { + depends: ['selectedMenuLink'], + layer: 'selectedMenuPopover', + variant: 'selectedMenuPopover', + textColor: 'preserve' + }, + selectedMenuPopoverIcon: { + depends: ['selectedMenuPopover', 'selectedMenuText'], + color: (mod, bg, text) => mixrgb(bg, text) + }, + lightText: { depends: ['text'], color: (mod, text) => brightness(20 * mod, text).rgb diff --git a/src/services/theme_data/theme_data.service.js b/src/services/theme_data/theme_data.service.js index ea28481b..c0861a4a 100644 --- a/src/services/theme_data/theme_data.service.js +++ b/src/services/theme_data/theme_data.service.js @@ -1,5 +1,5 @@ import { convert, brightness, contrastRatio } from 'chromatism' -import { alphaBlendLayers, getTextColor } from '../color_convert/color_convert.js' +import { alphaBlendLayers, getTextColor, relativeLuminance } from '../color_convert/color_convert.js' import { LAYERS, DEFAULT_OPACITY, SLOT_INHERITANCE } from './pleromafe.js' /* @@ -318,13 +318,14 @@ export const getColors = (sourceColors, sourceOpacity, mod) => SLOT_ORDERED.redu opacity ) ) + const isLightOnDark = relativeLuminance(bg) > 127 + const mod = isLightOnDark ? 1 : -1 + if (value.textColor === 'bw') { outputColor = contrastRatio(bg).rgb } else { let color = { ...colors[deps[0]] } if (value.color) { - const isLightOnDark = convert(bg).hsl.l < convert(color).hsl.l - const mod = isLightOnDark ? 1 : -1 color = value.color(mod, ...deps.map((dep) => ({ ...colors[dep] }))) } diff --git a/static/themes/breezy-dark.json b/static/themes/breezy-dark.json index c3bdcf65..236b94ad 100644 --- a/static/themes/breezy-dark.json +++ b/static/themes/breezy-dark.json @@ -114,8 +114,8 @@ "cGreen": "#27ae60", "cOrange": "#f67400", "btnPressed": "--accent", - "highlight": "--accent", - "selectedPost": "--bg,10" + "selectedMenu": "--accent", + "selectedMenuPopover": "--accent" }, "radii": { "btn": "2", diff --git a/static/themes/breezy-light.json b/static/themes/breezy-light.json index 478407c9..d3f74cec 100644 --- a/static/themes/breezy-light.json +++ b/static/themes/breezy-light.json @@ -117,8 +117,8 @@ "cGreen": "#27ae60", "cOrange": "#f67400", "btnPressed": "--accent", - "highlight": "--accent", - "selectedPost": "--bg,10" + "selectedMenu": "--accent", + "selectedMenuPopover": "--accent" }, "radii": { "btn": "2", -- cgit v1.2.3-70-g09d2 From 6bb75a3a6d8452a3e1b88085fe87cf27386f222c Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 21 Apr 2020 23:27:51 +0300 Subject: make relationships separate from users --- src/boot/after_store.js | 3 ++ src/components/account_actions/account_actions.js | 2 +- src/components/account_actions/account_actions.vue | 8 ++--- src/components/basic_user_card/basic_user_card.vue | 2 +- src/components/block_card/block_card.js | 5 ++- src/components/follow_button/follow_button.js | 14 ++++---- src/components/follow_card/follow_card.js | 3 ++ src/components/follow_card/follow_card.vue | 5 +-- src/components/mute_card/mute_card.js | 9 ++++-- src/components/notification/notification.js | 2 +- src/components/notification/notification.vue | 2 +- src/components/side_drawer/side_drawer.vue | 2 +- src/components/status/status.js | 15 +++++++-- src/components/status/status.vue | 2 +- src/components/user_card/user_card.js | 8 ++++- src/components/user_card/user_card.vue | 15 +++++---- src/components/user_panel/user_panel.vue | 2 +- src/components/user_profile/user_profile.vue | 2 +- src/components/user_settings/user_settings.js | 8 ++--- src/modules/users.js | 37 ++++++++-------------- src/services/api/api.service.js | 4 ++- .../entity_normalizer/entity_normalizer.service.js | 25 +++++++++------ .../follow_manipulate/follow_manipulate.js | 15 +++++---- .../notifications_fetcher.service.js | 1 - .../timeline_fetcher/timeline_fetcher.service.js | 2 ++ 25 files changed, 112 insertions(+), 81 deletions(-) (limited to 'src/components/side_drawer/side_drawer.vue') diff --git a/src/boot/after_store.js b/src/boot/after_store.js index d70e1058..1522d4f0 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -304,6 +304,9 @@ const afterStoreSetup = async ({ store, i18n }) => { getNodeInfo({ store }) ]) + // Start fetching things that don't need to block the UI + store.dispatch('fetchMutes') + const router = new VueRouter({ mode: 'history', routes: routes(store), diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js index 5d7ecf7e..0826c275 100644 --- a/src/components/account_actions/account_actions.js +++ b/src/components/account_actions/account_actions.js @@ -3,7 +3,7 @@ import Popover from '../popover/popover.vue' const AccountActions = { props: [ - 'user' + 'user', 'relationship' ], data () { return { } diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index 483783cf..744b77d5 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -9,16 +9,16 @@ class="account-tools-popover" >