0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-28 11:22:39 +00:00

Add a classname to recto configuration

Adding class name so that it can be toggled between 'recto' and 'verso'.  Verso being the normal left/right configuration, no styling is needed.  With recto, the first page is shifted to the second slot, or right side.
This commit is contained in:
Gazook89
2024-10-06 21:24:50 -05:00
parent 8115b1504e
commit 41f390b305
2 changed files with 5 additions and 1 deletions

View File

@@ -14,7 +14,7 @@
grid-template-rows: repeat(3, auto);
gap: 10px 10px;
justify-content: center;
& .page:first-child {
&.recto .page:first-child {
// sets first page on 'right' ('recto') of the preview, as if for a Cover page.
// todo: add a checkbox to toggle this setting
grid-column-start: 2;

View File

@@ -12,6 +12,7 @@ const ToolBar = ({ onZoomChange, currentPage, onPageChange, totalPages })=>{
const [zoomLevel, setZoomLevel] = useState(100);
const [pageNum, setPageNum] = useState(currentPage);
const [arrangement, setArrangement] = useState('single');
const [startOnRight, setStartOnRight] = useState(true);
const [toolsVisible, setToolsVisible] = useState(true);
const modes = ['single', 'facing', 'flow'];
@@ -31,8 +32,11 @@ const ToolBar = ({ onZoomChange, currentPage, onPageChange, totalPages })=>{
if(pagesContainer) {
modes.forEach((mode)=>pagesContainer.classList.remove(mode));
pagesContainer.classList.add(arrangement);
['recto', 'verso'].forEach((leaf)=>pagesContainer.classList.remove(leaf));
pagesContainer.classList.add(startOnRight ? 'recto' : 'verso');
}
}, [arrangement]);
}, [arrangement, startOnRight]);
const handleZoomButton = (zoom)=>{