|
|
@ -93,7 +93,6 @@ const Reader = ({ url, loadingView }: Props) => { |
|
|
|
const node = |
|
|
|
const node = |
|
|
|
iframe && iframe.contentWindow && iframe.contentWindow.document; |
|
|
|
iframe && iframe.contentWindow && iframe.contentWindow.document; |
|
|
|
// node && node.head && node.head.appendChild(new_style_element);
|
|
|
|
// node && node.head && node.head.appendChild(new_style_element);
|
|
|
|
console.log(node); |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
const onBookInfoChange = (book: Book) => { |
|
|
|
const onBookInfoChange = (book: Book) => { |
|
|
|
loadFont(); |
|
|
|
loadFont(); |
|
|
@ -168,6 +167,41 @@ const Reader = ({ url, loadingView }: Props) => { |
|
|
|
// setsettingicon(!settingicon);
|
|
|
|
// 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 [CountPage, setCountPage] = useState(0); |
|
|
|
const [isOpen, setIsOpen] = useState(false); |
|
|
|
const [isOpen, setIsOpen] = useState(false); |
|
|
|
|
|
|
|
|
|
|
@ -276,6 +310,10 @@ const Reader = ({ url, loadingView }: Props) => { |
|
|
|
</nav> |
|
|
|
</nav> |
|
|
|
|
|
|
|
|
|
|
|
<Footer |
|
|
|
<Footer |
|
|
|
|
|
|
|
bookOption={bookOption} |
|
|
|
|
|
|
|
onBookOptionChange={onBookOptionChange} |
|
|
|
|
|
|
|
onClickViewType={onClickViewType} |
|
|
|
|
|
|
|
onClickDirection={onClickDirection} |
|
|
|
CountPage={CountPage} |
|
|
|
CountPage={CountPage} |
|
|
|
title={currentLocation.chapterName} |
|
|
|
title={currentLocation.chapterName} |
|
|
|
nowPage={currentLocation.currentPage} |
|
|
|
nowPage={currentLocation.currentPage} |
|
|
@ -342,6 +380,7 @@ interface Props { |
|
|
|
loadingView?: React.ReactNode; |
|
|
|
loadingView?: React.ReactNode; |
|
|
|
isOpen?: any; |
|
|
|
isOpen?: any; |
|
|
|
setIsOpen?: any; |
|
|
|
setIsOpen?: any; |
|
|
|
|
|
|
|
setIsScrollHorizontal?: any; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export default ReaderWrapper; |
|
|
|
export default ReaderWrapper; |
|
|
|