Factor in scroll with sticky note spawning

This commit is contained in:
Idrees Hassan
2025-08-16 21:16:32 -04:00
parent 9484e4d029
commit 9e95603322
3 changed files with 6 additions and 3 deletions

3
dist/birb.js vendored
View File

@@ -1105,7 +1105,8 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI
const site = window.location.href;
const stickyNote = new StickyNote(id, site, "");
const element = renderStickyNote(stickyNote);
centerElement(element);
element.style.left = `${window.innerWidth / 2 - element.offsetWidth / 2}px`;
element.style.top = `${window.scrollY + window.innerHeight / 2 - element.offsetHeight / 2}px`;
stickyNote.top = parseInt(element.style.top, 10);
stickyNote.left = parseInt(element.style.left, 10);
stickyNotes.push(stickyNote);