From 26d7d1620e2c0cef34dcd67c39e30466ba1610c0 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Thu, 16 Apr 2020 14:23:48 -0700 Subject: [PATCH] Sticky scroll (#377) * Uses scroll-snap-type: y proximity to behave sticky when resizing windows * Puts js back --- assets/components/LogViewer.vue | 4 ++++ assets/components/ScrollableView.vue | 1 + assets/styles.scss | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/components/LogViewer.vue b/assets/components/LogViewer.vue index 7cf73908..9d8efea1 100644 --- a/assets/components/LogViewer.vue +++ b/assets/components/LogViewer.vue @@ -68,6 +68,10 @@ export default { & > li { word-wrap: break-word; line-height: 130%; + &:last-child { + scroll-snap-align: end; + scroll-margin-block-end: 5rem; + } } &.small { diff --git a/assets/components/ScrollableView.vue b/assets/components/ScrollableView.vue index 2d117388..40add5c4 100644 --- a/assets/components/ScrollableView.vue +++ b/assets/components/ScrollableView.vue @@ -80,6 +80,7 @@ section { main { flex: 1; overflow: auto; + scroll-snap-type: y proximity; } .scroll-bar-notification { diff --git a/assets/styles.scss b/assets/styles.scss index dc0ad7e5..71ca73b8 100644 --- a/assets/styles.scss +++ b/assets/styles.scss @@ -22,6 +22,7 @@ h1.title { html { overflow-x: unset; overflow-y: unset; + scroll-snap-type: y proximity; } html.has-custom-scrollbars { @@ -55,7 +56,7 @@ html.has-custom-scrollbars { } .is-settings-control { - + background: rgba(0, 0, 0, 0.4); color: #fff; border-color: transparent;