From 930127348a786f186d9064deb727e85c082c0c56 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 14 Apr 2021 03:23:29 +0900 Subject: [PATCH 01/37] Tweak UI --- src/client/directives/index.ts | 2 ++ src/client/directives/sticky-container.ts | 15 +++++++++++++++ src/client/pages/user/index.timeline.vue | 14 +++++++++++--- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 src/client/directives/sticky-container.ts diff --git a/src/client/directives/index.ts b/src/client/directives/index.ts index 7b9d31a601..6513350e0d 100644 --- a/src/client/directives/index.ts +++ b/src/client/directives/index.ts @@ -7,6 +7,7 @@ import tooltip from './tooltip'; import hotkey from './hotkey'; import appear from './appear'; import anim from './anim'; +import stickyContainer from './sticky-container'; export default function(app: App) { app.directive('userPreview', userPreview); @@ -17,4 +18,5 @@ export default function(app: App) { app.directive('hotkey', hotkey); app.directive('appear', appear); app.directive('anim', anim); + app.directive('sticky-container', stickyContainer); } diff --git a/src/client/directives/sticky-container.ts b/src/client/directives/sticky-container.ts new file mode 100644 index 0000000000..db29ea64b7 --- /dev/null +++ b/src/client/directives/sticky-container.ts @@ -0,0 +1,15 @@ +import { Directive } from 'vue'; + +export default { + mounted(src, binding, vn) { + //const query = binding.value; + + const header = src.children[0]; + const currentStickyTop = getComputedStyle(src).getPropertyValue('--stickyTop'); + src.style.setProperty('--stickyTop', `${parseInt(currentStickyTop) + header.offsetHeight}px`); + header.style.setProperty('--stickyTop', currentStickyTop); + header.style.position = 'sticky'; + header.style.top = 'var(--stickyTop)'; + header.style.zIndex = '1'; + }, +} as Directive; diff --git a/src/client/pages/user/index.timeline.vue b/src/client/pages/user/index.timeline.vue index 1b7a96fff6..4941abdade 100644 --- a/src/client/pages/user/index.timeline.vue +++ b/src/client/pages/user/index.timeline.vue @@ -1,11 +1,11 @@ @@ -56,3 +56,11 @@ export default defineComponent({ }, }); + + From e404e5e2deb99f3057fe87d3c45cbf1986321a9f Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 14 Apr 2021 03:34:56 +0900 Subject: [PATCH 02/37] Tweak UI --- src/client/components/ui/folder.vue | 9 ++++----- src/client/directives/sticky-container.ts | 2 +- src/client/ui/universal.vue | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/components/ui/folder.vue b/src/client/components/ui/folder.vue index 523298f225..6a163130c2 100644 --- a/src/client/components/ui/folder.vue +++ b/src/client/components/ui/folder.vue @@ -98,11 +98,10 @@ export default defineComponent({ > header { display: flex; position: relative; - z-index: 2; - // TODO - // position: sticky; - // top: var(--stickyTopOffset); - // backdrop-filter: blur(20px); + z-index: 10; + position: sticky; + top: var(--stickyTop, 0px); + backdrop-filter: blur(20px); > .title { margin: 0; diff --git a/src/client/directives/sticky-container.ts b/src/client/directives/sticky-container.ts index db29ea64b7..60b442eba4 100644 --- a/src/client/directives/sticky-container.ts +++ b/src/client/directives/sticky-container.ts @@ -5,7 +5,7 @@ export default { //const query = binding.value; const header = src.children[0]; - const currentStickyTop = getComputedStyle(src).getPropertyValue('--stickyTop'); + const currentStickyTop = getComputedStyle(src).getPropertyValue('--stickyTop') || '0px'; src.style.setProperty('--stickyTop', `${parseInt(currentStickyTop) + header.offsetHeight}px`); header.style.setProperty('--stickyTop', currentStickyTop); header.style.position = 'sticky'; diff --git a/src/client/ui/universal.vue b/src/client/ui/universal.vue index 1387b02b2c..3e2ee28817 100644 --- a/src/client/ui/universal.vue +++ b/src/client/ui/universal.vue @@ -259,6 +259,7 @@ export default defineComponent({ > .contents { width: 100%; min-width: 0; + --stickyTop: #{$header-height}; &.withHeader { padding-top: $header-height; From 7fda726bbeda6260f47f773205f7bd522cad5a63 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 14 Apr 2021 14:12:29 +0900 Subject: [PATCH 03/37] Tweak UI --- src/client/components/notifications.vue | 1 + src/client/components/ui/folder.vue | 6 +++++- src/client/components/user-list.vue | 2 +- src/client/pages/explore.vue | 12 +++++++----- src/client/widgets/notifications.vue | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/client/components/notifications.vue b/src/client/components/notifications.vue index 01b3ae4396..baafa86f4d 100644 --- a/src/client/components/notifications.vue +++ b/src/client/components/notifications.vue @@ -1,5 +1,6 @@