📱 (note) same top for every note
This commit is contained in:
@@ -91,16 +91,17 @@ export const useNote = (containerClass: string) => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
const resizeContainer = () => {
|
const resizeContainer = () => {
|
||||||
const element = document.querySelector(
|
const container = document.querySelector(
|
||||||
`.${containerClass}`
|
`.${containerClass}`
|
||||||
) as HTMLElement | null
|
) as HTMLElement | null
|
||||||
if (!element) {
|
if (!container) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (isMobile.value) {
|
if (isMobile.value) {
|
||||||
element.style.height = `${(stackedNotes.value.length + 1) * 100}vh`
|
container.style.height = `${(stackedNotes.value.length + 1) * 100}vh`
|
||||||
} else {
|
} else {
|
||||||
element.style.width = `${NOTE_WIDTH * (stackedNotes.value.length + 1)}px`
|
container.style.width = `${NOTE_WIDTH *
|
||||||
|
(stackedNotes.value.length + 1)}px`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { NOTE_WIDTH } from '@/constants/note-width'
|
|||||||
import { useOverlay } from '@/hooks/useOverlay.hook'
|
import { useOverlay } from '@/hooks/useOverlay.hook'
|
||||||
|
|
||||||
const BOOKMARK_WIDTH = 2
|
const BOOKMARK_WIDTH = 2
|
||||||
const BOOKMARK_HEIGHT = 2.5
|
|
||||||
|
|
||||||
export const useNoteOverlay = (className: string, index: number) => {
|
export const useNoteOverlay = (className: string, index: number) => {
|
||||||
const { x, y, isMobile } = useOverlay()
|
const { x, y, isMobile } = useOverlay()
|
||||||
@@ -28,7 +27,7 @@ export const useNoteOverlay = (className: string, index: number) => {
|
|||||||
noteHeight.value = noteElement.clientHeight
|
noteHeight.value = noteElement.clientHeight
|
||||||
|
|
||||||
if (isMobile.value) {
|
if (isMobile.value) {
|
||||||
noteElement.style.top = `${(index + 1) * BOOKMARK_HEIGHT}rem`
|
noteElement.style.top = `0`
|
||||||
} else {
|
} else {
|
||||||
noteElement.style.left = `${(index + 1) * BOOKMARK_WIDTH}rem`
|
noteElement.style.left = `${(index + 1) * BOOKMARK_WIDTH}rem`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user