An AngularJS simple directive that generate pixel pattern.
- angular.js, any version starting with 1
Download the from here
bower install ng-pixel
-
Copy
ng-pixel.js
to your project directory -
Set
ngPixel
as a dependency in your moduleangular.module("myApp", ["ngPixel"])
-
Add ng-pixel directive to the wanted element
<ng-pixel data='[{"xels":[{"id":0,"color":"#106CB7"},{"id":1,"color":"#F7EF22"},{"id":2,"color":"#D11E45"}]},{"xels":[{"id":3,"color":"#F7923A"},{"id":4,"color":"FFFFFF"},{"id":5,"color":"#F7EF22"}]},{"xels":[{"id":6,"color":"#139B69"},{"id":7,"color":"#D11E45"},{"id":8,"color":"#106CB7"}]}]'/>
Using ngPixel editor, you can generate json for data
attribute.
-
data : Pixel color info. ngPixel editor support to genarating.
-
config : Each pixel size (px). Default
width: 20
,height: 20
<ng-pixel data='Generated color info' config='{ width: 30, height: 30 }' />
Using ngPixel editor, you can generate pixel data.
Select the number of width, height.
Click cell, and select the color.
Copy generated code, and set to data property of ng-pixel tag.
coming soon...
- ngPixel
- event binding (each cells)
- pixel animation
- ngPixel Editor
- import ngPixel json
- import image, and convert to json