brutalism design

This commit is contained in:
2026-05-23 22:49:52 +06:00
parent d06892e990
commit 12ae0ae839
17 changed files with 497 additions and 158 deletions

View File

@@ -15,9 +15,7 @@ export function useChatScroll(target: TemplateRef<HTMLElement>, options?: MaybeR
end: false,
})
watch(arrivedState, () => {
console.log('arrived state', arrivedState)
})
let lastScrollHeight = 0
watch(el, (el) => {
if (!el)
@@ -31,14 +29,22 @@ export function useChatScroll(target: TemplateRef<HTMLElement>, options?: MaybeR
if (arrivedState.start) {
scrollToStart(true)
}
else {
const heightDiff = el.value!.scrollHeight - lastScrollHeight
el.value!.scrollTop += heightDiff
}
getArrivedState()
lastScrollHeight = el.value!.scrollHeight
}, {
childList: true,
subtree: true,
})
useEventListener(el, 'scroll', () => {
console.log('scroll', el.value!.scrollTop)
getArrivedState()
}, { passive: true })