|
|
|
@ -63,7 +63,7 @@ const Reader = ({ url, loadingView }: Props) => { |
|
|
|
|
resizeOnOrientationChange: true, |
|
|
|
|
spread: "auto", |
|
|
|
|
}); |
|
|
|
|
const [pPage, setpPage] = useState(0); |
|
|
|
|
// const [pPage, setpPage] = useState(0);
|
|
|
|
|
const [navControl, onNavToggle] = useMenu(navRef, 300); |
|
|
|
|
const [optionControl, onOptionToggle, emitEvent] = useMenu(optionRef, 300); |
|
|
|
|
const [learningControl, onLearningToggle] = useMenu(learningRef, 300); |
|
|
|
@ -93,7 +93,7 @@ const Reader = ({ url, loadingView }: Props) => { |
|
|
|
|
}`;
|
|
|
|
|
const node = |
|
|
|
|
iframe && iframe.contentWindow && iframe.contentWindow.document; |
|
|
|
|
// node && node.head && node.head.appendChild(new_style_element);
|
|
|
|
|
node && node.head && node.head.appendChild(new_style_element); |
|
|
|
|
}; |
|
|
|
|
const onBookInfoChange = (book: Book) => { |
|
|
|
|
loadFont(); |
|
|
|
@ -177,7 +177,7 @@ const Reader = ({ url, loadingView }: Props) => { |
|
|
|
|
// setsettingicon(!settingicon);
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
const [isScrollHorizontal, setIsScrollHorizontal] = useState(true); |
|
|
|
|
// const [isScrollHorizontal, setIsScrollHorizontal] = useState(true);
|
|
|
|
|
const onClickDirection = (type: "Horizontal" | "Vertical") => { |
|
|
|
|
if (type === "Horizontal") { |
|
|
|
|
onBookOptionChange({ |
|
|
|
@ -216,20 +216,20 @@ const Reader = ({ url, loadingView }: Props) => { |
|
|
|
|
const [CountPage, setCountPage] = useState(0); |
|
|
|
|
const [isOpen, setIsOpen] = useState(false); |
|
|
|
|
|
|
|
|
|
const [color, setcolor] = useState("light-white"); |
|
|
|
|
const [color, setcolor] = useState(1); |
|
|
|
|
const readyColors = [ |
|
|
|
|
{ name: "dark-white", bgColor: "#4e4e4e", color: "#fff" }, |
|
|
|
|
{ name: "light-white", bgColor: "#fff", color: "#292929" }, |
|
|
|
|
{ name: "dark-blue", bgColor: "#5858d3", color: "#fff" }, |
|
|
|
|
{ name: "dark-brown", bgColor: "#af622e", color: "#fff4e1" }, |
|
|
|
|
{ name: "light-brown", bgColor: "#fff4e1", color: "#af622e" }, |
|
|
|
|
{ name: "light-blue", bgColor: "#C3DDFF", color: "#5858df" }, |
|
|
|
|
{ id: 4, name: "dark-white", bgColor: "#4e4e4e", color: "#fff" }, |
|
|
|
|
{ id: 5, name: "dark-brown", bgColor: "#af622e", color: "#fff4e1" }, |
|
|
|
|
{ id: 6, name: "dark-blue", bgColor: "#5858d3", color: "#fff" }, |
|
|
|
|
{ id: 1, name: "light-white", bgColor: "#fff", color: "#4e4e4e" }, |
|
|
|
|
{ id: 2, name: "light-brown", bgColor: "#fff4e1", color: "#af622e" }, |
|
|
|
|
{ id: 3, name: "light-blue", bgColor: "#C3DDFF", color: "#5858df" }, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
const colorHandler = (color: any) => { |
|
|
|
|
let myColor = readyColors.filter((item) => item.name === color); |
|
|
|
|
return myColor[0].bgColor; |
|
|
|
|
}; |
|
|
|
|
// const colorHandler = (color: any) => {
|
|
|
|
|
// let myColor = readyColors.filter((item) => item.id === color);
|
|
|
|
|
// return myColor[0].bgColor;
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<> |
|
|
|
@ -250,11 +250,12 @@ const Reader = ({ url, loadingView }: Props) => { |
|
|
|
|
bookOption={bookOption} |
|
|
|
|
setBookOption={setBookOption} |
|
|
|
|
isOpen={isOpen} |
|
|
|
|
readyColors={readyColors} |
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
<nav |
|
|
|
|
style={{ |
|
|
|
|
backgroundColor: colorHandler(color), |
|
|
|
|
backgroundColor: readyColors.filter((item) => item.id === color)[0].bgColor, |
|
|
|
|
color: "green", |
|
|
|
|
display: "flex", |
|
|
|
|
justifyContent: "center", |
|
|
|
|