Deprecated. See @internetarchive/bookreader
This webcomponent follows the open-wc recommendation.
npm i ia-book-visual-adjustments
or
yarn add @internetarchive/ia-book-visual-adjustments
<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
}
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.
To scan the project for linting errors, run
npm run lint
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
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.
npm start
To run a local development server that serves the basic demo located in demo/index.html