Skip to content

Commit

Permalink
v2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mienaiyami committed Apr 9, 2022
1 parent eedfddd commit 62b2210
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mangareader",
"productName": "Manga Reader",
"version": "2.2.1",
"version": "2.2.2",
"description": "App to read manga on desktop",
"main": "./.webpack/main/index.js",
"author": {
Expand Down
26 changes: 19 additions & 7 deletions src/Components/Reader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Reader = () => {
if (readerRef.current && window.app.lastClick <= Date.now() - window.app.clickDelay) {
window.app.lastClick = Date.now();
let startTime: number, prevTime: number;
const anim = (timeStamp: DOMTimeStamp) => {
const anim = (timeStamp: number) => {
if (startTime === undefined) startTime = timeStamp;
const elapsed = timeStamp - startTime;
if (prevTime !== timeStamp && readerRef.current) {
Expand Down Expand Up @@ -128,17 +128,19 @@ const Reader = () => {
break;
case "d":
case "ArrowRight":
if (appSettings.readerSettings.readerTypeSelected === 1)
if (appSettings.readerSettings.readerTypeSelected === 1) {
openNextPageRef.current?.click();
}
break;
case "s":
case "ArrowDown":
scrollReader(1);
break;
case "a":
case "ArrowLeft":
if (appSettings.readerSettings.readerTypeSelected === 1)
if (appSettings.readerSettings.readerTypeSelected === 1) {
openPrevPageRef.current?.click();
}
break;
case "w":
case "ArrowUp":
Expand Down Expand Up @@ -182,7 +184,7 @@ const Reader = () => {
return;
}
setCurrentImageRow((init) => init - 1);
if (imgContRef.current) imgContRef.current.scrollTop = 0;
if (readerRef.current) readerRef.current.scrollTop = 0;
};
const openNextPage = () => {
if (currentImageRow >= imageRowCount) {
Expand All @@ -198,7 +200,7 @@ const Reader = () => {
return;
}
setCurrentImageRow((init) => init + 1);
if (imgContRef.current) imgContRef.current.scrollTop = 0;
if (readerRef.current) readerRef.current.scrollTop = 0;
};

const checkForImgsAndLoad = (link: string) => {
Expand Down Expand Up @@ -431,8 +433,18 @@ const Reader = () => {
(e.target as HTMLElement).tagName === "IMG"
) {
const clickPos = (e.clientX / e.currentTarget.offsetWidth) * 100;
if (clickPos <= 50) openPrevPage();
if (clickPos > 50) openNextPage();
if (clickPos <= 50) openPrevPageRef.current?.click();
if (clickPos > 50) openNextPageRef.current?.click();
}
if (
appSettings.readerSettings.readerTypeSelected === 0 &&
readerRef.current &&
(readerRef.current.scrollTop <= 300 ||
readerRef.current.scrollTop >= readerRef.current.scrollHeight - 300)
) {
const clickPos = (e.clientX / e.currentTarget.offsetWidth) * 100;
if (clickPos <= 50) openPrevChapterRef.current?.click();
if (clickPos > 50) openNextChapterRef.current?.click();
}
}}
style={{
Expand Down
7 changes: 5 additions & 2 deletions src/Components/ReaderSideList.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
faChevronRight,
faSort,
faSyncAlt,
faArrowLeft,
faArrowRight,
faBookmark,
faThumbtack,
} from "@fortawesome/free-solid-svg-icons";
import { faBookmark as farBookmark } from "@fortawesome/free-regular-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
Expand Down Expand Up @@ -226,7 +226,10 @@ const ReaderSideList = ({
setSideListPinned((init) => !init);
}}
>
<FontAwesomeIcon icon={faChevronRight} />
<FontAwesomeIcon
icon={faThumbtack}
style={{ transform: isSideListPinned ? "rotate(45deg)" : "" }}
/>
</div>
<div
className="reSizer"
Expand Down
14 changes: 14 additions & 0 deletions src/Components/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,20 @@ const Settings = (): ReactElement => {
</div>
</div> */}
</div>
<h1>Features</h1>
<div className="features">
<ul>
<li>you can make custom theme by editing theme.json.</li>
<li>you dont need to type whole word in search.</li>
<li>
you can open next/prev chapter in "infinite scrolling" mode by clicking on right/left
part of screen when on scroll 0 or 100%.
</li>
<li>you can bring side list by moving mouse to left of screen.</li>
<li>you can pin and resize of side list.</li>
<li>you can shrink home page tabs by clicking dividers.</li>
</ul>
</div>
<h1>Shortcut Keys</h1>
<div className="shortcutKey">
<table>
Expand Down
6 changes: 6 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,12 @@ body {
}
}
}
.features {
ul {
list-style-type: disc;
margin: 25px;
}
}
.shortcutKey {
padding: 20px;
display: grid;
Expand Down

0 comments on commit 62b2210

Please sign in to comment.