Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
troyeguo committed Nov 4, 2023
1 parent c3152ad commit 1822874
Show file tree
Hide file tree
Showing 36 changed files with 527 additions and 225 deletions.
1 change: 1 addition & 0 deletions public/assets/styles/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ body {
.booklist-shelf-list,
.lang-setting-dropdown,
.delete-tag-container,
.add-dialog-shelf-list-option,
.setting-subtitle,
.book-subcontent-name {
color: rgba(235, 235, 235, 1);
Expand Down
2 changes: 1 addition & 1 deletion public/lib/kookit/kookit.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/assets/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"Night Mode": "Night Mode",
"Turn on Bionic Reading": "Turn on Bionic Reading",
"This process is inreversible, and will completely overwrite your current library, make sure you know what you're doing before proceeding": "This process is inreversible, and will completely overwrite your current library, make sure you know what you're doing before proceeding",
"Lemmatize words when looking up in a dictionary": "查询单词前将词性还原",
"Lemmatize words when looking up in a dictionary": "Lemmatize words when looking up in a dictionary",
"To reduce the different forms of a word to one single form, for example, reducing builds, building or built to build, reducing cats to cat, reducing fastest to fast": "To reduce the different forms of a word to one single form, for example, reducing builds, building or built to build, reducing cats to cat, reducing fastest to fast",
"Export All Books": "Export All Books",
"Export All Notes": "Export All Notes",
Expand Down Expand Up @@ -179,7 +179,7 @@
"Turn Off Successfully": "Turn Off Successfully",
"Turn off touch screen mode": "Turn off touch screen mode(preventing accidentally touch)",
"Use built-in font": "Use built-in font",
"Setting": "Setting",
"Setting": "Settings",
"Turn on touch screen mode": "Turn on touch screen mode",
"Auto open last-read book": "Auto open last-read book",
"About Project": "About Project",
Expand Down
1 change: 0 additions & 1 deletion src/assets/lotties/loading.json

This file was deleted.

Binary file modified src/assets/styles/fonts/icomoon.eot
Binary file not shown.
1 change: 1 addition & 0 deletions src/assets/styles/fonts/icomoon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/styles/fonts/icomoon.ttf
Binary file not shown.
Binary file modified src/assets/styles/fonts/icomoon.woff
Binary file not shown.
13 changes: 8 additions & 5 deletions src/assets/styles/style.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@font-face {
font-family: 'icomoon';
src: url('fonts/icomoon.eot?i48bgd');
src: url('fonts/icomoon.eot?i48bgd#iefix') format('embedded-opentype'),
url('fonts/icomoon.ttf?i48bgd') format('truetype'),
url('fonts/icomoon.woff?i48bgd') format('woff'),
url('fonts/icomoon.svg?i48bgd#icomoon') format('svg');
src: url('fonts/icomoon.eot?3o4448');
src: url('fonts/icomoon.eot?3o4448#iefix') format('embedded-opentype'),
url('fonts/icomoon.ttf?3o4448') format('truetype'),
url('fonts/icomoon.woff?3o4448') format('woff'),
url('fonts/icomoon.svg?3o4448#icomoon') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
Expand All @@ -25,6 +25,9 @@
-moz-osx-font-smoothing: grayscale;
}

.icon-archive:before {
content: "\e951";
}
.icon-browser:before {
content: "\e950";
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/bookCardItem/bookCardItem.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
overflow: hidden;
position: relative;
}

.book-selected-icon {
opacity: 0.5;
}
@keyframes fade-in {
0% {
opacity: 0;
Expand Down
33 changes: 29 additions & 4 deletions src/components/bookCardItem/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class BookCardItem extends React.Component<BookCardProps, BookCardState> {
left: 0,
top: 0,
direction: "horizontal",
isHover: false,
};
}

Expand Down Expand Up @@ -134,6 +135,12 @@ class BookCardItem extends React.Component<BookCardProps, BookCardState> {
onClick={() => {
this.handleJump();
}}
onMouseEnter={() => {
this.setState({ isHover: true });
}}
onMouseLeave={() => {
this.setState({ isHover: false });
}}
style={
StorageUtil.getReaderConfig("isDisableCrop") === "yes"
? {
Expand Down Expand Up @@ -164,9 +171,9 @@ class BookCardItem extends React.Component<BookCardProps, BookCardState> {
</div>
) : (
<img
src={this.props.book.cover}
data-src={this.props.book.cover}
alt=""
className="book-item-image"
className="lazy-image book-item-image"
style={
this.state.direction === "horizontal" ||
StorageUtil.getReaderConfig("isDisableCrop") === "yes"
Expand All @@ -186,10 +193,28 @@ class BookCardItem extends React.Component<BookCardProps, BookCardState> {
></img>
)}
</div>
{this.props.isSelectBook ? (
{this.props.isSelectBook || this.state.isHover ? (
<span
className="icon-message book-selected-icon"
style={this.props.isSelected ? {} : { color: "#eee" }}
onMouseEnter={() => {
this.setState({ isHover: true });
}}
onClick={() => {
if (this.props.isSelectBook) {
this.props.handleSelectedBooks(
this.props.isSelected
? this.props.selectedBooks.filter(
(item) => item !== this.props.book.key
)
: [...this.props.selectedBooks, this.props.book.key]
);
} else {
this.props.handleSelectBook(true);
this.props.handleSelectedBooks([this.props.book.key]);
}
this.setState({ isHover: false });
}}
style={this.props.isSelected ? { opacity: 1 } : { color: "#eee" }}
></span>
) : null}

Expand Down
2 changes: 2 additions & 0 deletions src/components/bookCardItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
handleReadingBook,
handleDragItem,
handleDeleteDialog,
handleSelectBook,
handleSelectedBooks,
} from "../../store/actions";
import { withTranslation } from "react-i18next";
Expand All @@ -25,6 +26,7 @@ const actionCreator = {
handleReadingBook,
handleActionDialog,
handleDragItem,
handleSelectBook,
handleDeleteDialog,
handleSelectedBooks,
};
Expand Down
3 changes: 2 additions & 1 deletion src/components/bookCardItem/interface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface BookCardProps extends RouteComponentProps<any> {
dragItem: string;
selectedBooks: string[];
mode: string;

handleSelectBook: (isSelectBook: boolean) => void;
handleReadingBook: (book: BookModel) => void;
handleActionDialog: (isShowActionDialog: boolean) => void;
t: (title: string) => string;
Expand All @@ -20,6 +20,7 @@ export interface BookCardProps extends RouteComponentProps<any> {
}
export interface BookCardState {
isFavorite: boolean;
isHover: boolean;
left: number;
top: number;
direction: string;
Expand Down
43 changes: 38 additions & 5 deletions src/components/bookCoverItem/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class BookCoverItem extends React.Component<BookCoverProps, BookCoverState> {
top: 0,
direction: "horizontal",
desc: "",
isHover: false,
};
}

Expand Down Expand Up @@ -178,6 +179,12 @@ class BookCoverItem extends React.Component<BookCoverProps, BookCoverState> {
onClick={() => {
this.handleJump();
}}
onMouseEnter={() => {
this.setState({ isHover: true });
}}
onMouseLeave={() => {
this.setState({ isHover: false });
}}
style={
StorageUtil.getReaderConfig("isDisableCrop") === "yes"
? {
Expand Down Expand Up @@ -211,15 +218,15 @@ class BookCoverItem extends React.Component<BookCoverProps, BookCoverState> {
</div>
) : (
<img
src={this.props.book.cover}
data-src={this.props.book.cover}
alt=""
style={
this.state.direction === "horizontal" ||
StorageUtil.getReaderConfig("isDisableCrop") === "yes"
? { width: "100%" }
: { height: "100%" }
}
className="book-item-image"
className="lazy-image book-item-image"
onLoad={(res: any) => {
if (
res.target.naturalHeight / res.target.naturalWidth >
Expand All @@ -232,13 +239,39 @@ class BookCoverItem extends React.Component<BookCoverProps, BookCoverState> {
}}
/>
)}
{this.props.isSelectBook ? (
{this.props.isSelectBook || this.state.isHover ? (
<span
className="icon-message book-selected-icon"
onMouseEnter={() => {
this.setState({ isHover: true });
}}
onClick={() => {
if (this.props.isSelectBook) {
this.props.handleSelectedBooks(
this.props.isSelected
? this.props.selectedBooks.filter(
(item) => item !== this.props.book.key
)
: [...this.props.selectedBooks, this.props.book.key]
);
} else {
this.props.handleSelectBook(true);
this.props.handleSelectedBooks([this.props.book.key]);
}
this.setState({ isHover: false });
}}
style={
this.props.isSelected
? { right: "274px", top: "30px" }
: { right: "274px", top: "30px", color: "#eee" }
? {
right: "274px",
top: "30px",
opacity: 1,
}
: {
right: "274px",
top: "30px",
color: "#eee",
}
}
></span>
) : null}
Expand Down
2 changes: 2 additions & 0 deletions src/components/bookCoverItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
handleDragItem,
handleDeleteDialog,
handleSelectedBooks,
handleSelectBook,
} from "../../store/actions";
import BookCoverItem from "./component";
import { stateType } from "../../store";
Expand All @@ -27,6 +28,7 @@ const actionCreator = {
handleActionDialog,
handleDragItem,
handleDeleteDialog,
handleSelectBook,
handleSelectedBooks,
};
export default connect(
Expand Down
4 changes: 4 additions & 0 deletions src/components/bookCoverItem/interface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export interface BookCoverProps extends RouteComponentProps<any> {
isSelectBook: boolean;
isSelected: boolean;
selectedBooks: string[];
handleSelectBook: (isSelectBook: boolean) => void;

handleReadingBook: (book: BookModel) => void;
handleActionDialog: (isShowActionDialog: boolean) => void;
t: (title: string) => string;
Expand All @@ -20,6 +22,8 @@ export interface BookCoverProps extends RouteComponentProps<any> {
handleDeleteDialog: (isShow: boolean) => void;
}
export interface BookCoverState {
isHover: boolean;

isFavorite: boolean;
left: number;
top: number;
Expand Down
39 changes: 35 additions & 4 deletions src/components/bookListItem/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class BookListItem extends React.Component<BookItemProps, BookItemState> {
direction: "horizontal",
left: 0,
top: 0,
isHover: false,
};
}
componentDidMount() {
Expand Down Expand Up @@ -177,6 +178,12 @@ class BookListItem extends React.Component<BookItemProps, BookItemState> {
this.handleJump();
}}
style={{ height: "65px" }}
onMouseEnter={() => {
this.setState({ isHover: true });
}}
onMouseLeave={() => {
this.setState({ isHover: false });
}}
>
<div className="book-item-image" style={{ height: "65px" }}>
<EmptyCover
Expand All @@ -194,11 +201,17 @@ class BookListItem extends React.Component<BookItemProps, BookItemState> {
onClick={() => {
this.handleJump();
}}
onMouseEnter={() => {
this.setState({ isHover: true });
}}
onMouseLeave={() => {
this.setState({ isHover: false });
}}
>
<img
src={this.props.book.cover}
data-src={this.props.book.cover}
alt=""
className="book-item-image"
className="lazy-image book-item-image"
style={{ width: "100%" }}
onLoad={(res: any) => {
if (
Expand All @@ -213,12 +226,30 @@ class BookListItem extends React.Component<BookItemProps, BookItemState> {
/>
</div>
)}
{this.props.isSelectBook ? (
{this.props.isSelectBook || this.state.isHover ? (
<span
className="icon-message book-selected-icon"
onMouseEnter={() => {
this.setState({ isHover: true });
}}
onClick={() => {
if (this.props.isSelectBook) {
this.props.handleSelectedBooks(
this.props.isSelected
? this.props.selectedBooks.filter(
(item) => item !== this.props.book.key
)
: [...this.props.selectedBooks, this.props.book.key]
);
} else {
this.props.handleSelectBook(true);
this.props.handleSelectedBooks([this.props.book.key]);
}
this.setState({ isHover: false });
}}
style={
this.props.isSelected
? { left: "20px", bottom: "5px" }
? { left: "20px", bottom: "5px", opacity: 1 }
: { left: "20px", bottom: "5px", color: "#eee" }
}
></span>
Expand Down
2 changes: 2 additions & 0 deletions src/components/bookListItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
handleDragItem,
handleFetchBooks,
handleSelectedBooks,
handleSelectBook,
handleActionDialog,
} from "../../store/actions";
import { withTranslation } from "react-i18next";
Expand All @@ -32,6 +33,7 @@ const actionCreator = {
handleAddDialog,
handleActionDialog,
handleDragItem,
handleSelectBook,
handleFetchBooks,
handleSelectedBooks,
};
Expand Down
4 changes: 4 additions & 0 deletions src/components/bookListItem/interface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export interface BookItemProps extends RouteComponentProps<any> {
isSelectBook: boolean;
isSelected: boolean;
selectedBooks: string[];
handleSelectBook: (isSelectBook: boolean) => void;

handleReadingBook: (book: BookModel) => void;
handleEditDialog: (isShow: boolean) => void;
handleDeleteDialog: (isShow: boolean) => void;
Expand All @@ -24,6 +26,8 @@ export interface BookItemProps extends RouteComponentProps<any> {
handleSelectedBooks: (selectedBooks: string[]) => void;
}
export interface BookItemState {
isHover: boolean;

isDeleteDialog: boolean;
isFavorite: boolean;
direction: string;
Expand Down
1 change: 1 addition & 0 deletions src/components/dialogs/actionDialog/actionDialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
overflow: hidden;
text-overflow: ellipsis;
padding-left: 10px;
border-radius: 3px;
}

.action-name {
Expand Down
Loading

0 comments on commit 1822874

Please sign in to comment.