1.2.2 • Published 7 years ago

codepix v1.2.2

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

codepix

A React Component of a programable pixel grid.

The primary purpose of this project is to build small showcase applications to practice learning to code.

Usage

import React from 'react'
import ReactDOM from 'react-dom'
import App from './app'

ReactDOM.render(<App actions={setActions} />, document.getElementById('app'))

function setActions (actions) {
  Object.keys(actions).map(k => window[k] = actions[k])
  window.workspace()
}

This will give the user access via the console or a separate js file to the following methods to control the pixel grid:

  • setPixel(row, col, color) // sets a color of a cell
  • getPixel(row, col) // returns the color of a cell
  • setInput('value') // sets the value of the input box
  • getInput() // gets the value of the input box
  • onClick('a or b', fn) // handles a click event for one of the two buttons
  • output('string') // sets output to the output region
  • clear()

License

MIT

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago