0.2.1 • Published 7 years ago

kewt-peacock v0.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

kewt

flipactual Travis Codecov Node NPM

interfaces for setting, fetching, persisting, and rendering text track styling

Example

The following code loads a DOM ready interface that checks for existing settings on localstorage, sets new values for a variety of options, persists the changes to localstorage, and renders a style tag to the document head.

import { KewtDOM } from 'kewt';

KewtDOM
  .set('font', 'sans-serif')
  .set('fontSize', '4')
  .set('fontEdge', 'shadow')
  .set('edgeHighlight', 'yellow')
  .set('edgeOpacity', 50)
  .set('textColor', 'teal')
  .set('textOpacity', 25)
  .set('backgroundColor', 'purple')
  .set('backgroundOpacity', '100')
  .persist()
  .render();

Settings

SettingDefaultOptions
font'monospace''monospace', 'sans-serif', 'serif'
fontSize'3''1'-'6'
fontEdgenone'none', 'uniform', 'raised', 'shadow', 'depressed'
edgeHighlight'black''black', 'blue', 'green', 'teal', 'red', 'purple', 'yellow', 'white'
edgeOpacity'0''0'-'100'
textColor'white''black', 'blue', 'green', 'teal', 'red', 'purple', 'yellow', 'white'
textOpacity'100''0'-'100'
backgroundColor'black''black', 'blue', 'green', 'teal', 'red', 'purple', 'yellow', 'white'
backgroundOpacity'100''0'-'100'

Kewt

Kind: global class

new Kewt(options, defaults)

constructor - creates a new text track interface

ParamTypeDescription
optionsobjectoverrides for default options
defaultsobjectoverrides for detault defaults

kewt.reset() ⇒ Kewt

reset - resets all caption properties to their default values

Kind: instance method of Kewt

kewt.get(property) ⇒ string | object

get - gets the property, if specified, or all the properties

Kind: instance method of Kewt
Returns: string | object - the property, if specified, or all the properties

ParamTypeDescription
propertystringthe property to get

kewt.set(property, value) ⇒ Kewt

set - sets a property or properties

Kind: instance method of Kewt

ParamTypeDescription
propertystring | objectthe property to set
valuestringthe value for the property if property is a string

kewt.setProperty(property, value) ⇒ Kewt

setProperty - sets a property

Kind: instance method of Kewt

ParamTypeDescription
propertystringthe property to set
valuestringthe value for the property

KewtDOM

Kind: global class

new KewtDOM(options, defaults)

constructor - creates a new text track interface with DOM capabilities

ParamTypeDescription
optionsobjectoverrides for default options
defaultsobjectoverrides for detault defaults

kewtDOM.reset() ⇒ undefined

reset - resets all caption properties to their default values and clears persisted state

Kind: instance method of KewtDOM

kewtDOM.render() ⇒ undefined

render - renders the style tag with styles to document head

Kind: instance method of KewtDOM

kewtDOM.persist() ⇒ undefined

persist - persists the current Kewt state to localstorage

Kind: instance method of KewtDOM

Scripts

test – run the tests

npm run test

coverage – generate and view code coverage as HTML

npm run coverage

lint – lint the codebase

npm run lint

readme – generate the README

npm run readme

compile – compile the code

npm run compile

License

MIT @ Flip