Skip to content

Commit

Permalink
fix(reader): arrows always displayed in paginated and hidden in scrol…
Browse files Browse the repository at this point in the history
…l mode, arrows and zenMode displayed on hover (Fixes #2497 PR #2505)
  • Loading branch information
arthur-lemeur committed Sep 19, 2024
1 parent 0471c9b commit 232ee27
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 5 deletions.
17 changes: 15 additions & 2 deletions src/renderer/assets/styles/components/readerFooter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,25 @@
}
}

.arrows {
height: 300px;
width: 50px;
z-index: 1;

&:hover {
button {
opacity: 1 !important;
}
}
}

.arrows button {
width: 50px;
height: 50px;
height: 300px;
position: absolute;
top: calc(50dvh - 100px);
top: calc(50dvh - 220px);
z-index: 10;
transition: 200ms;

svg {
fill: var(--color-blue);
Expand Down
17 changes: 17 additions & 0 deletions src/renderer/assets/styles/reader-app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1048,13 +1048,30 @@ input[type="radio"] + label {
display: none;
}

.exitZen_container {
width: 150px;
height: 150px;
z-index: 10;
position: absolute;
top: 0;
right: 0;

&:hover {
.button_exitZen {
opacity: 1 !important;
}
}
}

.button_exitZen {
width: 25px;
height: 25px;
position: absolute;
right: 25px;
top: 12px;
z-index: 10;
transition: 200ms;


svg {
color: var(--color-blue);
Expand Down
1 change: 1 addition & 0 deletions src/renderer/assets/styles/reader-app.scss.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export declare const docked_left_pdf: string;
export declare const docked_right: string;
export declare const docked_right_pdf: string;
export declare const docked_right_scrollable: string;
export declare const exitZen_container: string;
export declare const focus_element: string;
export declare const go_to_page: string;
export declare const hasTtsAudio: string;
Expand Down
10 changes: 7 additions & 3 deletions src/renderer/reader/components/Reader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ class Reader extends React.Component<IProps, IState> {
const isAudioBook = isAudiobookFn(this.props.r2Publication);
const arrowDisabledNotEpub = isAudioBook || this.props.isPdf || this.props.isDivina;
// const isFXL = this.isFixedLayout();
// const isPaginated = this.props.readerConfig.paged;
const isPaginated = this.props.readerConfig.paged;

// console.log(arrowDisabledNotEpub, isFXL, isPaginated);
// epub non fxl (page) : false false true : true
Expand Down Expand Up @@ -788,10 +788,12 @@ class Reader extends React.Component<IProps, IState> {
disableRTLFlip={this.props.disableRTLFlip}
isRTLFlip={this.isRTLFlip}
/>
:
<button onClick={() => this.setState({ zenMode : false})} className={stylesReader.button_exitZen}>
:
<div className={stylesReader.exitZen_container}>
<button onClick={() => this.setState({ zenMode : false})} className={stylesReader.button_exitZen} style={{ opacity: isPaginated ? "1" : "0"}}>
<SVG ariaHidden svg={exitZenModeIcon} />
</button>
</div>
}

<div
Expand Down Expand Up @@ -850,6 +852,7 @@ class Reader extends React.Component<IProps, IState> {
}}
title={this.props.__("reader.svg.left")}
className={(this.state.settingsOpen || this.state.menuOpen) ? (this.props.readerConfig.readerDockingMode === "left" ? stylesReaderFooter.navigation_arrow_docked_left : stylesReaderFooter.navigation_arrow_left) : stylesReaderFooter.navigation_arrow_left}
style={{ opacity: isPaginated ? "1" : "0"}}
>
<SVG ariaHidden={true} svg={ArrowLeftIcon} />
</button>
Expand Down Expand Up @@ -913,6 +916,7 @@ class Reader extends React.Component<IProps, IState> {
}}
title={this.props.__("reader.svg.right")}
className={(this.state.settingsOpen || this.state.menuOpen) ? (this.props.readerConfig.readerDockingMode === "right" ? stylesReaderFooter.navigation_arrow_docked_right : stylesReaderFooter.navigation_arrow_right) : stylesReaderFooter.navigation_arrow_right}
style={{ opacity: isPaginated ? "1" : "0"}}
>
<SVG ariaHidden={true} svg={ArrowRightIcon} />
</button>
Expand Down

0 comments on commit 232ee27

Please sign in to comment.