Merge pull request #51 from symant233/master

Add viewer arrow support, add README license badge.
This commit is contained in:
Ricter Zheng 2019-05-04 11:11:34 +08:00 committed by GitHub
commit 13e60a69e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 6 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ dist/
*.egg-info
.python-version
.DS_Store
output/

View File

@ -7,7 +7,7 @@ nhentai
|_| |_|_| |_|\___|_| |_|\__\__,_|_|
あなたも変態。 いいね?
[![Build Status](https://travis-ci.org/RicterZ/nhentai.svg?branch=master)](https://travis-ci.org/RicterZ/nhentai) ![nhentai PyPI Downloads](https://img.shields.io/pypi/dm/nhentai.svg)
[![Build Status](https://travis-ci.org/RicterZ/nhentai.svg?branch=master)](https://travis-ci.org/RicterZ/nhentai) ![nhentai PyPI Downloads](https://img.shields.io/pypi/dm/nhentai.svg) [![license](https://img.shields.io/cocoapods/l/AFNetworking.svg)](https://github.com/RicterZ/nhentai/blob/master/LICENSE)
nHentai is a CLI tool for downloading doujinshi from [nhentai.net](http://nhentai.net).
@ -26,6 +26,8 @@ nHentai is a CLI tool for downloading doujinshi from [nhentai.net](http://nhenta
### Usage
**IMPORTANT**: To bypass the nhentai frequency limit, you should use `--login` option to log into nhentai.net.
*The default download folder will be the path where you run the command (CLI path).*
Download specified doujinshi:
```bash
nhentai --id=123855,123866
@ -78,8 +80,5 @@ NHENTAI=http://h.loli.club nhentai --id 123456
![](./images/download.png)
![](./images/viewer.png)
### License
MIT
### あなたも変態
![](./images/image.jpg)

View File

@ -46,17 +46,33 @@ document.getElementById('image-container').onclick = event => {
document.onkeypress = event => {
switch (event.key.toLowerCase()) {
// Previous Image
case 'arrowleft':
case 'a':
changePage(currentPage - 1);
break;
// Next Image
case ' ':
case 'esc': // future close page function
case 'enter':
case 'arrowright':
case 'd':
changePage(currentPage + 1);
break;
}// remove arrow cause it won't work
};
document.onkeydown = event =>{
switch (event.keyCode) {
case 37: //left
changePage(currentPage - 1);
break;
case 38: //up
changePage(currentPage - 1);
break;
case 39: //right
changePage(currentPage + 1);
break;
case 40: //down
changePage(currentPage + 1);
break;
}
};