jQuery Plugin For Random David Carson Inspired Art - Carson.js
| File Size: | 8.46 KB |
|---|---|
| Views Total: | 461 |
| Last Update: | |
| Publish Date: | |
| Official Website: | Go to website |
| License: | MIT |
Carson.js is a jQuery plugin which takes advantage of javascript and Html5 canvas element to make random David Carson inspired art.
How to use it:
1. The html
<canvas id="carson">You're browser doesn't support HTML5 canvas :(</canvas>
2. The CSS for this sample
canvas {
width: 100%;
height: 100%;
opacity: 0.3;
}
3. Load the jQuery javascript library and jQuery Carson.js script on the web page
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="carson.js"></script>
4. The javascript
<script type="text/javascript">
$(document).ready(function(){
var stage = $('#carson');
var foo = setInterval(function(){
stage.carson({
width: 900,
height: 600,
use_colors: false,
});
}, 2000);
});
</script>
5. All the options
fonts: Array of your fonts. width: Number for width of canvas. height: Number for height of canvas. use_colors: Boolean to make it black and white or randomized colors. complexity: Number (1,2,3 or 4) to determine complexity level (higher is more complex). use_textures: Boolean if you want textures on or off. use_stepped_bars: Boolean if you want to use the technique of having thin stepped lines across the canvas. use_random_complexity: Boolean if you want the complexity level to be randomized. text: String a string of text to use — you'll likely want to override this. textures: Array of your texture filenames (relative filepath is required — e.g: img1.jpg, img2.jpg).
This awesome jQuery plugin is developed by christabor. For more Advanced Usages, please check the demo page or visit the official website.











