Code Monkey home page Code Monkey logo

villain's Introduction

An open source web-based comic book reader.


Installation

$ yarn add villain-react

WebWorker

This component uses the libarchivejs for the extraction process, so you will need to provide the path of webworker:

The webworker bundle lives in libarchive.js/dist folder so you need to make sure that it is available in your public folder since it will not get bundled if you're using bundler (it's all bundled up already)

const opts = {
  workerUrl: 'path to ../build/worker-bundle.js',
  ...
}

Usage

Import the component and the css styles

// Component
import Villain from 'villain-react'

// Css styles
import 'villain-react/dist/style.min.css'

// Path of the comicbook archive
const url = '/files/test.cbz'

//...

<Villain file={url} options={opts} />

Options

Available options to customize the reader component:

Name Type Default Description
workerUrl string null path to libarchive.js worker-bundle.
allowFullScreen bool true Show full screen button.
autoHideControls bool false Set inital auto hide state of toolbar.
preview number null Load and render only the provided number of images.

Development

Run yarn command to install the dependencies.

To start the development run yarn start, this will open up localhost:8080 on your default browser:

  • This uses webpack-dev-server and includes hot-reloading.

An example archive has been provided to play around inside ./build/testFile

  • A good resource for archives can be found here: https://archive.org/details/comics.
  • Alternative, any compressed folder (zip, rar, tar, etc) with a few images will also do the job.

Credits

villain's People

Contributors

btzr-io avatar chadramsey avatar daniacu avatar deniskond avatar dependabot[bot] avatar fadc80 avatar floookay avatar islander avatar ismaeldcom avatar jonathanmcchesney avatar maydayo avatar mraguso2 avatar n1tin avatar nio-o avatar timeterminal avatar toshiuk avatar vclayton avatar

Watchers

 avatar

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.