mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-10 11:22:40 +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);
|
grid-template-rows: repeat(3, auto);
|
||||||
gap: 10px 10px;
|
gap: 10px 10px;
|
||||||
justify-content: center;
|
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.
|
// sets first page on 'right' ('recto') of the preview, as if for a Cover page.
|
||||||
// todo: add a checkbox to toggle this setting
|
// todo: add a checkbox to toggle this setting
|
||||||
grid-column-start: 2;
|
grid-column-start: 2;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const ToolBar = ({ onZoomChange, currentPage, onPageChange, totalPages })=>{
|
|||||||
const [zoomLevel, setZoomLevel] = useState(100);
|
const [zoomLevel, setZoomLevel] = useState(100);
|
||||||
const [pageNum, setPageNum] = useState(currentPage);
|
const [pageNum, setPageNum] = useState(currentPage);
|
||||||
const [arrangement, setArrangement] = useState('single');
|
const [arrangement, setArrangement] = useState('single');
|
||||||
|
const [startOnRight, setStartOnRight] = useState(true);
|
||||||
const [toolsVisible, setToolsVisible] = useState(true);
|
const [toolsVisible, setToolsVisible] = useState(true);
|
||||||
const modes = ['single', 'facing', 'flow'];
|
const modes = ['single', 'facing', 'flow'];
|
||||||
|
|
||||||
@@ -31,8 +32,11 @@ const ToolBar = ({ onZoomChange, currentPage, onPageChange, totalPages })=>{
|
|||||||
if(pagesContainer) {
|
if(pagesContainer) {
|
||||||
modes.forEach((mode)=>pagesContainer.classList.remove(mode));
|
modes.forEach((mode)=>pagesContainer.classList.remove(mode));
|
||||||
pagesContainer.classList.add(arrangement);
|
pagesContainer.classList.add(arrangement);
|
||||||
|
['recto', 'verso'].forEach((leaf)=>pagesContainer.classList.remove(leaf));
|
||||||
|
pagesContainer.classList.add(startOnRight ? 'recto' : 'verso');
|
||||||
}
|
}
|
||||||
}, [arrangement]);
|
}, [arrangement]);
|
||||||
|
}, [arrangement, startOnRight]);
|
||||||
|
|
||||||
|
|
||||||
const handleZoomButton = (zoom)=>{
|
const handleZoomButton = (zoom)=>{
|
||||||
|
|||||||
Reference in New Issue
Block a user