Skip to content

Commit

Permalink
fix: adjust viewer height and bar loc
Browse files Browse the repository at this point in the history
  • Loading branch information
duydl committed Oct 30, 2023
1 parent 73f6d31 commit a2ab49d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/Viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import './Viewer.css'

const Viewer: React.FC<{ srcLink: string}> = ({ srcLink}) => {



return (
<>
<ButtonContainer srcLink={srcLink}/>
Expand Down Expand Up @@ -59,7 +57,10 @@ const ButtonContainer: React.FC<{ srcLink: string}> = ({ srcLink}) => {
<div
title="Drag to Move"
className={`button-container ${isDragging ? 'dragging' : ''}`}
style={{ transform: `translate(${position.x}px, ${position.y}px)` }}
style={{ left: '50%',
top: '50%',
transform: `translate(-50%, -50%) translate(${position.x}px, ${position.y}px)`,
position: 'absolute'}}
onMouseDown={handleMouseDown}
onMouseMove={handleMouseMove}
onMouseUp={handleMouseUp}
Expand Down
8 changes: 4 additions & 4 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ async function main() {
style: `
#logseq-calibre-annotation_lsp_main {
position: fixed ;
top: 0% ;
top: 3rem ;
left: ${100 - logseq.settings?.viewerWidth}% ;
width: ${logseq.settings?.viewerWidth}%;
height: 100% ;
height: calc(100% - 3rem) ;
z-index: 9;
}
#logseq-calibre-annotation-test_lsp_main {
position: fixed ;
top: 0% ;
top: 3rem ;
left: ${100 - logseq.settings?.viewerWidth}% ;
width: ${logseq.settings?.viewerWidth}% ;
height: 100% ;
height: calc(100% - 3rem) ;
z-index: 9;
}
Expand Down

0 comments on commit a2ab49d

Please sign in to comment.