Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including dynamicon with all npm packages installed. Try it out:

var dynamicon = require("dynamicon")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

dynamicon v1.0.2

dynamic emoticon

dynamicon

dynamic emoticon

did some textual sentiment analysis and needed a face rather than a float (number)

npm i -S dynamicon

const d = require('dynamicon')()

// or

require('dynamicon')
const d = document.createElement('dynamic-emoticon')

// append somewhere

document.body.appendChild(d)

// set mood

d.ease(value) // transition/ animate
d.set(value) // immediate

// change appearance

d.setSize(width)
d.setTheme('outline')

// custom initialization

const d = require('dynamicon')({
    value: 0,
    min: -100,
    max: 100,
    size: 200,
    theme: {
        face: '#ffeb97',
        faceStroke: 'none',
        stroke: '#444',
        mouthFill: '#ff396d40',
        heart: '#ff396d'
    }
})

maybe

  • support old browsers (typeof window.customElements === undefined)
  • drop webpack and babel (read: modern javascript) to reduce filesize

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free