Giter Club home page Giter Club logo

villain's Introduction

Villain logo

The open source web-based comic book reader that you need, but don't deserve.


Screen preview

What?

A simple open source web-based reader for:

  • Manga
  • Comic books
  • Graphic novels
  • Illustrated books

Works on the client side and is easy to integrate on any modern website or react application.

How?

It relays on cutting-edge web apis and frameworks like react, webworkers and webAssembly:

  • Dont expect it to work on a hot potato
  • Usage with modern browsers is recommended

Features

  • Dark / light theme
  • Manga mode ( Read right to left or default left to right )
  • Full screen mode ( Browser fullscreen API integration )
  • Easy page navigation : prev / next page buttons, slider component as well and a text input for accessibility
  • Keyboard shortcuts ( I need to document this )
  • Localization of strings ( Multi language support for the UI )
  • Layout mode : Single page / Book ( two pages )

A killer feature is missing ? Open a feature request

Formats

Supported archives formats by libarchive.js

  • ZIP
  • 7-Zip
  • RAR v4
  • RAR v5
  • TAR

Development

This repository is now a mono-repo and is maintained with lerna

Setup

Before you jump in the code please follow the initial setup guide for development:

  1. Clone or fork this repository.
  2. Run yarn command to install the project dependencies.
  3. Run yarn bootstrap to install all dependencies from internal packages and link any cross-dependencies.

Thats it! Now you are ready to start fixing bugs and implementing new features. ๐ŸŽ‰

Packages

Available packages living inside this repository:

Name version Description
villain-web 0.0.1 (beta) web app + embed api
villain-react 1.0.7 react component

Commands

Available package scripts for development:

Name Description
deploy Deploy villain-web to github pages
bootstrap Bootstrap the packages in the current mono repo
start:web Start development webpack-dev-server (includes hot-reloading) of villain-web
build:web Build production version of villain-web
start:react Start development webpack-dev-server (includes hot-reloading) of villain-react
build:react Build production version of villain-react
docs:copy Prepare documents for docsify-cli
docsify:serve Serve docsify generated document on localhost:3000
yarn command-name

Known issues

  • Accessibility issues #23
  • Some .rar and .cbr fail to load #1
  • Encrypted archived are not yet supported #26

Credits

villain's People

Contributors

abbascoder51 avatar btzr-io avatar damofer avatar daniacu avatar deniskond avatar dependabot-preview[bot] avatar dependabot[bot] avatar edumoreira1506 avatar eelec avatar fadc80 avatar fuku710 avatar giulianovarriale avatar harikesh409 avatar imgbotapp avatar islander avatar ismaeldcom avatar jkvyff avatar jonathanmcchesney avatar joshwooding avatar junbread avatar lambk avatar larissagilliane avatar lucas-barros avatar maydayo avatar mskuybeda avatar n1tin avatar sprakash57 avatar thomasluu00 avatar timeterminal avatar uuykay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

villain's Issues

Create tests

We need some test to ensure everything is working fine ๐Ÿ‘

Zoom handler event affects animations

Describe the bug
The zoom handler function makes the zoom animations choppy and slow.
I suspect is caused by the new implentation on the getTargetZoom function.

To Reproduce
Steps to reproduce the behavior:

  1. Use the wheel mouse button to zoom in / out.
  2. See animations.

Expected behavior
Smooth zoom animations

this.viewer.addHandler('zoom', ({ zoom }) => {
const { viewport } = this.viewer
const max = viewport.getMaxZoom()
const min = viewport.getMinZoom()
const currentZoom = parseInt((zoom / this.getTargetZoom()) * 100)
const canZoomIn = zoom < max && currentZoom < 100
const canZoomOut = zoom > min
this.context.updateState({ currentZoom, canZoomIn, canZoomOut })
})

See: Optimize getTargetZoom function #67

Improve image type validation

Currently only detects files as images when the name ends on a valid image type extension,
we should at least validate if the name contains invalid charactes such as a filename starting with . see example:

Valid name: image.png
Invalid name: .__image.name.png

A more efficient validation system to ensure that the file is a real image will be reading the magi numbers or something similar but this will probably affect performance.

See related issue: Broken example archive #49

Some hints

Here is the validation function used on the uncompress component:

export const isValidImageType = name => regexImage.test(name)

Shortcut keys

Add shortcut keys to control the viewer like f to toggle fullscreen.

Monorepo

Move the npm package ( villain-react component ) to its own folder.

Customizable toolbar

Current set of options for toolbar is really limited, see https://github.com/btzr-io/Villain#options
We should provide and option to customize the toolbar elements.

Possible solutions and ideas

  • Create an allowFeature.. props for each tool / feature
  • Create a prop to choose what toolbar actions will be shown: actions: ['fullscreen' , ...]
  • Maybe another one to block actions: blockActions: ['fullscreen',...]
  • Add custom buttons ? buttons: [ { name: 'flip', action: (e) => something... } ]

Open for suggestions.

Web-app

Create a web application + embed api ๐Ÿš€

  • Home page.
  • Move docs to website ?
  • Initial UI for reader.
  • Get Domain #224
  • Embed api
  • Open archive from local storage #239
  • Document api
  • Drag and drop support: c184f3a

About panel

A panel or overlay container ( maybe even a pop up modal ) to display some info about the viwer:

  • Logo / Project name
  • Current version
  • Description
  • Maybe add the github links ?

full screen button in viewer controls

The full screen button is being removed in lbry-desktop in place of individual full screen buttons in the different viewers. f for fullscreen will still work, but there will no longer be a button below the viewer components.

Preview mode

Add an option to display a preview version of the archive, this should be faster and more optimized than loading the full archive:

  • Extract a defined number of images (eg. 3 first pages ) and display it.
  • Maybe add a label or indication that is a preview version.

Slider component skipped key tab

Describe the bug
The handler of the slider element don't auto focus when using key tab navigation.

To Reproduce
Steps to reproduce the behavior:

  1. Press tab to navigate until you reach the toolbar controls (buttons)
  2. See error ( slider don't get focus )

This will be probably required by: s://github.com//issues/39

Broken example archive

The example archive included breaks the viewer when navigating from pages.

I suspect it contains corrupted images or unsupported format?

message: "Error loading image at blob:http://localhost:8080/2df85bc3-6f11-406e-9345-399c101a6bc0"

Also we should handle better this error: #37

Update

Well the issue appears to be related to this folder inside the archive: __MACOSX/

All files contained in there had a valid extension name (png, jpg...) but invalid names (._Name), also from what I understand they are not real images so they will be handled as corrupted:

Exampe.zip
--- ._Clouds.jpg
--- ._Sunset.jpg
--- ... 

So not sure if there is a way to ignore it?

Improve documentation with development instructions

Is your feature request related to a problem? Please describe.
Documentation should provide the basic steps for contributors to get started with the project

Describe the solution you'd like
Contributors should be able to get started with ease

Related issue: Improve documentation #16

Mirror mode

Is your feature request related to a problem? Please describe.
It should flip the images like a "mirror".

Describe the solution you'd like
Openseadragon provides this feature we just need a control to toggle it, see the docs for more info.

Note always keep in mind usability and accessibility โœŒ๏ธ

Responsive toolbar

When the viewer size is too small toolbar will break ( fail to display and interact with elements)
Also we should be able to handle almost any screen size for mobiles.

Probably will require to remove certain components from the toolbar:
See: #13

Note always keep in mind usability and accessibility โœŒ๏ธ

Fullscreen mode not working

The current fullscreen mode only expands the size of the viewer, it should actually trigger the fullscreen enter / exit event of the window.

Use the lib/full-screen.js polyfill.

Split react component

This repo host the web-app and also the react component version, it should be a good idea to organize the code in modules:

@Villain
--- @Villain/web-reader
--- @Villain/react-reader

Menu (options)

The space of the toolbar is limited, we will eventually need panel or drop menu to display all the configurable options of the player.

Note always keep in mind usability and accessibility โœŒ๏ธ

Improve tooltips for controls

  • Buttons and other interactive elements are missing tooltips.
  • Better tooltip messages

We should also look for a react component instead of using the native tooltips.
I think we should stick for the native ones for know but open for suggestions.

Improve rollup config

I'm not familiar with rollup so I don't know if there is something we should improve on the config:

  • Remove unnecessary plugins.
  • Add better / necessary plugins.
  • something else ?

Also see related issue: Remove webpack usage #47

Bad zoom levels

  • The min and max zoom levels are affected by the resize event.
  • Inconsistent zoom levels on different image sizes

Add a changelog

Create a change log file to register future changes / updates for each version.

Shorcut keys panel

A panel or overlay container ( maybe even a pop up modal ) to display some info about all shortcut keys.

(See the openseadragon docs for more info)

Light theme

Create a light theme, see the dark theme for inspiration.

Accessibility issues

Implementing accessibility in any component of the viewer.

Reported issues

This are probably not the only ones so feel free to report it here:

  • Responsive toolbar #34
  • Keyboard navigation for slider component #39
  • Mobile compatibility #38
  • Improve tooltips for controls #12
  • Handler on slider components skipped key tab #40
  • Keyboard-Only Focus Styles #41
  • Missing aria labels and roles #84
  • Opeseadragon issues: openseadragon/openseadragon#1478

Theme toggler

Add an option to quickly switch between dark and light theme.

( Note: the light theme don't exist yet #15 )

Improve message error

Is your feature request related to a problem?
The message error view needs some improvement.
Also we should improve the error message handler to detect different types of error.

Auto hide controls not working when image fails to open

Describe the bug
Auto hide controls not working when the viewer cant find or open and image from the archive (probably corrupted file or invalid format).

To Reproduce
Steps to reproduce the behavior:

  1. Load an archive containing invalid images
  2. Toggle auto hide
  3. Se error: the controls will hide but not appear anymore.

Remove webpack usage

Currently we use webpack to run the dev server and rollup to build the production module.
So we have two different config files and both are required to be on sync and be compatible with each other.

Is there anyway to just use rollup and discard web-pack ?

Well there is this, but, web-pack has react-hot-loader implemented, so not sure if this is possible:
https://github.com/thgh/rollup-plugin-serve

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.