Add viewer arrow support & Readme license badage

This commit is contained in:
symant233 2019-05-04 11:04:43 +08:00
parent 2acb6a1249
commit 1eb1b5c04c
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://opensource.org/licenses/MIT)](https://img.shields.io/cocoapods/l/AFNetworking.svg)
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;
}
};