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:
@@ -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;
|
||||
|
||||
@@ -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)=>{
|
||||
|
||||
Reference in New Issue
Block a user