Permalink
Browse files

browserify example works but the colors are a bit close

  • Loading branch information...
1 parent cee5489 commit dfb06c1e6e7fa93bbb2e38d4960bfc6eb157cdbb @substack committed Jul 10, 2011
Showing with 52 additions and 1 deletion.
  1. +5 −0 README.markdown
  2. +12 −0 example/browser/index.html
  3. +22 −0 example/browser/main.js
  4. +10 −0 example/browser/server.js
  5. +3 −1 package.json
View
@@ -1,2 +1,7 @@
Mr. Color
=========
+
+I just want some colors, you know?
+
+This module gives you some colors which are all different but they get less
+different the more you want.
View
@@ -0,0 +1,12 @@
+<html>
+ <head>
+ <title>Mr. Color, requisition me some colors post haste!</title>
+ <script type="text/javascript" src="/browserify.js"></script>
+ </head>
+ <body>
+ <div>
+ <input id="clicky" type="button" value="more colors!">
+ </div>
+ <div id="colors"></div>
+ </body>
+</html>
View
@@ -0,0 +1,22 @@
+var mr = require('mrcolor');
+var $ = require('jquery-browserify');
+
+$(window).ready(function () {
+ var color = mr();
+
+ $('#clicky').click(function () {
+ var rgb = 'rgb(' + color.rgb().join(',') + ')';
+ color = color.next();
+
+ $('<div>')
+ .css({
+ 'background-color' : rgb,
+ color : 'white',
+ width : 500,
+ height : 30
+ })
+ .text(rgb)
+ .appendTo($('#colors'))
+ ;
+ });
+});
View
@@ -0,0 +1,10 @@
+var express = require('express');
+var app = express.createServer();
+app.use(express.static(__dirname));
+
+var browserify = require('browserify');
+var bundle = browserify({ entry : __dirname + '/main.js' });
+app.use(bundle);
+
+app.listen(8080);
+console.log('Listening on :8080');
View
@@ -12,7 +12,9 @@
"color-convert" : "0.2.x"
},
"devDependencies" : {
- "expresso" : "0.7.x"
+ "expresso" : "0.7.x",
+ "jquery-browserify" : "1.6.x",
+ "browserify" : ">=1.2.8 <1.3"
},
"scripts" : {
"test" : "expresso"

0 comments on commit dfb06c1

Please sign in to comment.