Attempt to split column scrolling

This commit is contained in:
Essem 2023-06-01 16:21:06 -05:00
parent 71ca665aba
commit 6c447c94e8
3 changed files with 8 additions and 14 deletions

View file

@ -219,6 +219,7 @@ import { getAccountFromId } from "@/scripts/get-account-from-id";
const rootEl = document.createElement("div"); const rootEl = document.createElement("div");
rootEl.id = MISSKEY_MOUNT_DIV_ID; rootEl.id = MISSKEY_MOUNT_DIV_ID;
rootEl.style.height = "100%";
document.body.appendChild(rootEl); document.body.appendChild(rootEl);
return rootEl; return rootEl;
})(); })();

View file

@ -111,6 +111,7 @@ html._themeChanging_ {
html, body { html, body {
margin: 0; margin: 0;
padding: 0; padding: 0;
height: 100%;
} }
.swiper-slide { .swiper-slide {

View file

@ -20,7 +20,7 @@
</MkStickyContainer> </MkStickyContainer>
<div v-if="isDesktop" ref="widgetsEl" class="widgets"> <div v-if="isDesktop" ref="widgetsEl" class="widgets">
<XWidgets @mounted="attachSticky" /> <XWidgets />
</div> </div>
<button <button
@ -380,17 +380,6 @@ const onContextmenu = (ev: MouseEvent) => {
); );
}; };
const attachSticky = (el: any) => {
const sticky = new StickySidebar(widgetsEl);
window.addEventListener(
"scroll",
() => {
sticky.calc(window.scrollY);
},
{ passive: true }
);
};
function top() { function top() {
window.scroll({ top: 0, behavior: "smooth" }); window.scroll({ top: 0, behavior: "smooth" });
} }
@ -451,7 +440,7 @@ console.log(mainRouter.currentRoute.value.name);
$widgets-hide-threshold: 1090px; $widgets-hide-threshold: 1090px;
// 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/ // 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
min-height: calc(var(--vh, 1vh) * 100); height: 100%;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
@ -534,7 +523,7 @@ console.log(mainRouter.currentRoute.value.name);
width: 750px; width: 750px;
background: var(--panel); background: var(--panel);
border-radius: 0; border-radius: 0;
overflow: clip; overflow: auto;
--margin: 12px; --margin: 12px;
background: var(--bg); background: var(--bg);
} }
@ -554,6 +543,7 @@ console.log(mainRouter.currentRoute.value.name);
> .contents { > .contents {
width: 100%; width: 100%;
min-width: 0; min-width: 0;
overflow: auto;
$widgets-hide-threshold: 1090px; $widgets-hide-threshold: 1090px;
@media (max-width: $widgets-hide-threshold) { @media (max-width: $widgets-hide-threshold) {
padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
@ -563,7 +553,9 @@ console.log(mainRouter.currentRoute.value.name);
> .widgets { > .widgets {
padding: 0 var(--margin); padding: 0 var(--margin);
width: 300px; width: 300px;
flex: 0 0 auto;
box-sizing: content-box; box-sizing: content-box;
overflow: auto;
@media (max-width: $widgets-hide-threshold) { @media (max-width: $widgets-hide-threshold) {
display: none; display: none;