Adjust "MobileReaderProgressBar" styling

In case the current page is the first one, there will be now no visible progress shown anymore. The progress slider will now be exactly at the start of the progress bar.
This commit is contained in:
schroda
2024-12-27 17:01:34 +01:00
parent 3ae0207bed
commit 052625a013
3 changed files with 94 additions and 43 deletions

View File

@@ -37,14 +37,14 @@ export const ReaderProgressBarCurrentPageSlot = ({
position: 'absolute',
cursor: isDragging ? 'grabbing' : 'grab',
...applyStyles(getProgressBarPositionInfo(progressBarPosition).isHorizontal, {
left: `${(Math.max(0, currentPagesIndex) / pagesLength) * 100}%`,
width: `calc(100% / ${pagesLength})`,
left: `${(Math.max(0, currentPagesIndex - 1) / (pagesLength - 1)) * 100}%`,
width: `calc(100% / ${pagesLength - 1})`,
height: '100%',
}),
...applyStyles(getProgressBarPositionInfo(progressBarPosition).isVertical, {
top: `${(Math.max(0, currentPagesIndex) / pagesLength) * 100}%`,
top: `${(Math.max(0, currentPagesIndex - 1) / pagesLength - 1) * 100}%`,
width: '100%',
height: `calc(100% / ${pagesLength})`,
height: `calc(100% / ${pagesLength - 1})`,
}),
...boxProps?.sx,
}}