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