Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mug committed Oct 2, 2022
1 parent e259a27 commit 9ffc39a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
31 changes: 28 additions & 3 deletions src/Chapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class SinglePageReader extends React.Component {
const page = this.props.page;
const pages = this.props.pages;

return (
return ([
pages.map((full_img, idx) => {
const displayed = (idx != page && !this.isLongStrip()) ? "d-none" : "";

Expand All @@ -90,8 +90,30 @@ class SinglePageReader extends React.Component {
page={idx}
/>
)
})
)
}),
IntArray(this.props.lpages - pages.length).map((idx) => {
const pid = pages.length + idx;
const displayed = (pid != page && !this.isLongStrip()) ? "d-none" : "";

//TODO: Center this
return (
<div
page={pid}
className={`m-5 d-flex align-items-center justify-content-center ${displayed}`}
style={{
height: "5vh",
width: "5vh",
color: "#fff",
textShadow: "0 0 7px rgba(0,0,0,0.5)"
}}
>
<span className="fas fa-circle-notch fa-spin" style={{opacity: "0.5", fontSize: "7em"}} />
<span className="loading-page-number" style={{fontSize: "2em"}}></span>
</div>
)
}),
this.isLongStrip() ? (<p>End</p>) : (<React.Fragment></React.Fragment>)
])
}
/*scrollEvent(e) {
var visible = null;
Expand Down Expand Up @@ -298,6 +320,7 @@ class ReaderMain extends React.Component {
return <DoublePageReader
ref={this.changeChild}
page={page}
lpages={lpages != null ? lpages.length : 0}
setPage={(i) => this.props.setPage(i)}
pages={pages}
cfg={cfg}
Expand All @@ -306,6 +329,7 @@ class ReaderMain extends React.Component {
return <LongStripReader
ref={this.changeChild}
page={page}
lpages={lpages != null ? lpages.length : 0}
setPage={(i) => this.props.setPage(i)}
pages={pages}
cfg={cfg}
Expand All @@ -314,6 +338,7 @@ class ReaderMain extends React.Component {
return <SinglePageReader
ref={this.changeChild}
page={page}
lpages={lpages != null ? lpages.length : 0}
setPage={(i) => this.props.setPage(i)}
pages={pages}
cfg={cfg}
Expand Down
2 changes: 2 additions & 0 deletions src/css/Chapter.css
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ body {
.reader .reader-main {
padding: 0;
margin: 0;
min-height: calc(100vh - 3.5rem);
}
.reader .reader-main .reader-images {
margin: 0px;
Expand All @@ -605,6 +606,7 @@ body {
position: fixed;
padding: inherit;
margin: inherit;
min-height: inherit;
}
.reader .reader-main .reader-images {
margin: inherit;
Expand Down

0 comments on commit 9ffc39a

Please sign in to comment.