1 var http = require('http');
2 var charmer = require('../');
4 http.createServer(function (req, res) {
5 res.setHeader('content-type', 'text/ansi');
7 var charm = charmer(res);
14 var iv = setInterval(function () {
15 var x = 2 + (radius + Math.cos(theta) * radius) * 2;
16 var y = 2 + radius + Math.sin(theta) * radius;
18 points.unshift([ x, y ]);
19 var colors = [ 'red', 'yellow', 'green', 'cyan', 'blue', 'magenta' ];
21 points.forEach(function (p, i) {
22 charm.position(p[0], p[1]);
23 var c = colors[Math.floor(i / 12)];
24 charm.background(c).write(' ')
26 points = points.slice(0, 12 * colors.length - 1);
28 theta += Math.PI / 40;
31 req.connection.on('end', function () {