|
|
|
@ -93,7 +93,6 @@ const Reader = ({ url, loadingView }: Props) => { |
|
|
|
|
const node = |
|
|
|
|
iframe && iframe.contentWindow && iframe.contentWindow.document; |
|
|
|
|
// node && node.head && node.head.appendChild(new_style_element);
|
|
|
|
|
console.log(node); |
|
|
|
|
}; |
|
|
|
|
const onBookInfoChange = (book: Book) => { |
|
|
|
|
loadFont(); |
|
|
|
@ -168,6 +167,41 @@ const Reader = ({ url, loadingView }: Props) => { |
|
|
|
|
// setsettingicon(!settingicon);
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
const [isScrollHorizontal, setIsScrollHorizontal] = useState(true); |
|
|
|
|
const onClickDirection = (type: "Horizontal" | "Vertical") => { |
|
|
|
|
if (type === "Horizontal") { |
|
|
|
|
onBookOptionChange({ |
|
|
|
|
...bookOption, |
|
|
|
|
flow: "paginated", |
|
|
|
|
}); |
|
|
|
|
} else if (type === "Vertical") { |
|
|
|
|
onBookOptionChange({ |
|
|
|
|
...bookOption, |
|
|
|
|
flow: "scrolled-doc", |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
console.log(isScrollHorizontal)
|
|
|
|
|
|
|
|
|
|
const [viewType, setViewType] = useState({ |
|
|
|
|
spread: true, |
|
|
|
|
}); |
|
|
|
|
const onClickViewType = (isSpread: boolean) => { |
|
|
|
|
if (isSpread) { |
|
|
|
|
setViewType({ ...viewType, spread: true }); |
|
|
|
|
onBookOptionChange({ |
|
|
|
|
...bookOption, |
|
|
|
|
spread: "auto", |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
setViewType({ ...viewType, spread: false }); |
|
|
|
|
onBookOptionChange({ |
|
|
|
|
...bookOption, |
|
|
|
|
spread: "none", |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const [CountPage, setCountPage] = useState(0); |
|
|
|
|
const [isOpen, setIsOpen] = useState(false); |
|
|
|
|
|
|
|
|
@ -276,6 +310,10 @@ const Reader = ({ url, loadingView }: Props) => { |
|
|
|
|
</nav> |
|
|
|
|
|
|
|
|
|
<Footer |
|
|
|
|
bookOption={bookOption} |
|
|
|
|
onBookOptionChange={onBookOptionChange} |
|
|
|
|
onClickViewType={onClickViewType} |
|
|
|
|
onClickDirection={onClickDirection} |
|
|
|
|
CountPage={CountPage} |
|
|
|
|
title={currentLocation.chapterName} |
|
|
|
|
nowPage={currentLocation.currentPage} |
|
|
|
@ -342,6 +380,7 @@ interface Props { |
|
|
|
|
loadingView?: React.ReactNode; |
|
|
|
|
isOpen?: any; |
|
|
|
|
setIsOpen?: any; |
|
|
|
|
setIsScrollHorizontal?: any; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export default ReaderWrapper; |
|
|
|
|