Coder Social home page Coder Social logo

iaux-book-visual-adjustments's Introduction

Build Status codecov

<ia-book-visual-adjustments>

This webcomponent follows the open-wc recommendation.

Installation

npm i ia-book-visual-adjustments

or

yarn add @internetarchive/ia-book-visual-adjustments

Usage

<script type="module">
  import 'ia-book-visual-adjustments/ia-book-visual-adjustments.js';
</script>

<ia-book-visual-adjustments></ia-book-visual-adjustments>

The only property is an array of options. Each option has these properties:

{
  id: 'contrast', // Identifier for adjustment type
  name: 'Use increased contrast', // Name of adjustment rendered as label text
  active: false, // Checked state of option
}

Events

When an option is changed, the 'visualAdjustmentOptionChanged' event is emitted. The detail object on the event object receives the complete array of options to allow BookReader to collect all active adjustments and add CSS to the image containers. An example of listening to this event and altering an image can be found in the demo.

Linting with ESLint

To scan the project for linting errors, run

npm run lint

Testing with Karma

To run the suite of karma tests, run

npm run test

To run the tests in watch mode (for TDD, for example), run

npm run test:watch

Tooling configs

For most of the tools, the configuration is in the package.json to reduce the amount of files in your project.

If you customize the configuration a lot, you can consider moving them to individual files.

Local Demo with es-dev-server

npm start

To run a local development server that serves the basic demo located in demo/index.html

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.