Skip to content

Commit

Permalink
refactor to increase readability | add 'use strict'
Browse files Browse the repository at this point in the history
  • Loading branch information
mateogianolio committed Mar 23, 2015
1 parent ede0641 commit 405db23
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 264 deletions.
8 changes: 3 additions & 5 deletions captcha.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@

var size = Math.round(config.height * .7),
c = new canvas(config.width, config.height),
context = c.getContext('2d');
context = c.getContext('2d'),
fonts = config.fonts || ['sans-serif', 'serif'],
i;

context.fillStyle = config.background;
context.fillRect(0, 0, config.width, config.height);
context.fillStyle = config.color;

var fonts = config.fonts || [
'"Arial", "Helvetica", sans-serif'
];
var i;
for(i = 0; i < config.text.length; i++) {
context.font = size + 'px ' + fonts[Math.floor(Math.random() * fonts.length)];

Expand Down
Binary file modified examples/0123456789.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/abcdefghijklmnopqrstuvwxyz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 405db23

Please sign in to comment.