Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
3be5b5f9
Commit
3be5b5f9
authored
Apr 18, 2021
by
Ozzie Isaacs
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'comic_reader/master' into master
parents
04ac5b69
755eb140
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
13 deletions
+40
-13
kthoom.css
cps/static/css/kthoom.css
+12
-3
kthoom.js
cps/static/js/kthoom.js
+26
-8
readcbr.html
cps/templates/readcbr.html
+2
-2
No files found.
cps/static/css/kthoom.css
View file @
3be5b5f9
...
@@ -84,15 +84,24 @@ body {
...
@@ -84,15 +84,24 @@ body {
#progress
.bar-load
,
#progress
.bar-load
,
#progress
.bar-read
{
#progress
.bar-read
{
display
:
flex
;
display
:
flex
;
align-items
:
flex-end
;
justify-content
:
flex-end
;
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
left
:
0
;
bottom
:
0
;
bottom
:
0
;
transition
:
width
150ms
ease-in-out
;
transition
:
width
150ms
ease-in-out
;
}
}
#progress
.from-left
{
left
:
0
;
align-items
:
flex-end
;
justify-content
:
flex-end
;
}
#progress
.from-right
{
right
:
0
;
align-items
:
flex-start
;
justify-content
:
flex-start
;
}
#progress
.bar-load
{
#progress
.bar-load
{
color
:
#000
;
color
:
#000
;
background-color
:
#ccc
;
background-color
:
#ccc
;
...
...
cps/static/js/kthoom.js
View file @
3be5b5f9
...
@@ -171,7 +171,10 @@ kthoom.ImageFile = function(file) {
...
@@ -171,7 +171,10 @@ kthoom.ImageFile = function(file) {
function
initProgressClick
()
{
function
initProgressClick
()
{
$
(
"#progress"
).
click
(
function
(
e
)
{
$
(
"#progress"
).
click
(
function
(
e
)
{
var
page
=
Math
.
max
(
1
,
Math
.
ceil
((
e
.
offsetX
/
$
(
this
).
width
())
*
totalImages
))
-
1
;
var
offset
=
$
(
this
).
offset
();
var
x
=
e
.
pageX
-
offset
.
left
;
var
rate
=
settings
.
direction
===
0
?
x
/
$
(
this
).
width
()
:
1
-
x
/
$
(
this
).
width
();
var
page
=
Math
.
max
(
1
,
Math
.
ceil
(
rate
*
totalImages
))
-
1
;
currentImage
=
page
;
currentImage
=
page
;
updatePage
();
updatePage
();
});
});
...
@@ -285,6 +288,22 @@ function updatePage() {
...
@@ -285,6 +288,22 @@ function updatePage() {
}
}
function
updateProgress
(
loadPercentage
)
{
function
updateProgress
(
loadPercentage
)
{
if
(
settings
.
direction
===
0
)
{
$
(
"#progress .bar-read"
)
.
removeClass
(
"from-right"
)
.
addClass
(
"from-left"
);
$
(
"#progress .bar-load"
)
.
removeClass
(
"from-right"
)
.
addClass
(
"from-left"
);
}
else
{
$
(
"#progress .bar-read"
)
.
removeClass
(
"from-left"
)
.
addClass
(
"from-right"
);
$
(
"#progress .bar-load"
)
.
removeClass
(
"from-left"
)
.
addClass
(
"from-right"
);
}
// Set the load/unzip progress if it's passed in
// Set the load/unzip progress if it's passed in
if
(
loadPercentage
)
{
if
(
loadPercentage
)
{
$
(
"#progress .bar-load"
).
css
({
width
:
loadPercentage
+
"%"
});
$
(
"#progress .bar-load"
).
css
({
width
:
loadPercentage
+
"%"
});
...
@@ -526,18 +545,17 @@ function keyHandler(evt) {
...
@@ -526,18 +545,17 @@ function keyHandler(evt) {
break
;
break
;
case
kthoom
.
Key
.
SPACE
:
case
kthoom
.
Key
.
SPACE
:
var
container
=
$
(
"#mainContent"
);
var
container
=
$
(
"#mainContent"
);
var
atTop
=
container
.
scrollTop
()
===
0
;
//
var atTop = container.scrollTop() === 0;
var
atBottom
=
container
.
scrollTop
()
>=
container
[
0
].
scrollHeight
-
container
.
height
();
//
var atBottom = container.scrollTop() >= container[0].scrollHeight - container.height();
if
(
evt
.
shiftKey
&&
atTop
)
{
if
(
evt
.
shiftKey
)
{
evt
.
preventDefault
();
evt
.
preventDefault
();
// If it's Shift + Space and the container is at the top of the page
// If it's Shift + Space and the container is at the top of the page
show
Left
Page
();
show
Prev
Page
();
}
else
if
(
!
evt
.
shiftKey
&&
atBottom
)
{
}
else
{
evt
.
preventDefault
();
evt
.
preventDefault
();
// If you're at the bottom of the page and you only pressed space
// If you're at the bottom of the page and you only pressed space
showRightPage
();
showNextPage
();
container
.
scrollTop
(
0
);
}
}
break
;
break
;
default
:
default
:
...
...
cps/templates/readcbr.html
View file @
3be5b5f9
...
@@ -60,12 +60,12 @@
...
@@ -60,12 +60,12 @@
<a
id=
"fullscreen"
class=
"icon-resize-full"
>
Fullscreen
</a>
<a
id=
"fullscreen"
class=
"icon-resize-full"
>
Fullscreen
</a>
</div>
</div>
<div
id=
"progress"
role=
"progressbar"
class=
"loading"
>
<div
id=
"progress"
role=
"progressbar"
class=
"loading"
>
<div
class=
"bar-load"
>
<div
class=
"bar-load
from-left
"
>
<div
class=
"text load"
>
<div
class=
"text load"
>
Loading...
Loading...
</div>
</div>
</div>
</div>
<div
class=
"bar-read"
>
<div
class=
"bar-read
from-left
"
>
<div
class=
"text page"
></div>
<div
class=
"text page"
></div>
</div>
</div>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment