Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (45 sloc) 1.091 kB
<!DOCTYPE 5>
<html>
<head>
<title>Pie</title>
<link rel="stylesheet" href="build/build.css">
<style>
body {
background: #EBEBEB;
padding: 150px;
}
canvas {
margin: 10px;
}
.big-pie {
color: #5d8dc7;
background: #78b5ff;
border: 1px solid white;
}
</style>
</head>
<body>
<script src="build/build.js"></script>
<script>
var favicon = require('component-favicon');
function pie(size, fav) {
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
var pie = require('pie')(64 == size ? '.big-pie' : '.pie');
pie.size(size);
canvas.width = canvas.height = size;
document.body.appendChild(canvas);
var n = 0;
var id = setInterval(function(){
pie.update(++n);
pie.draw(ctx);
if (fav) favicon(canvas.toDataURL());
if (n >= 100) clearInterval(id);
}, Math.random() * 100 | 0);
}
pie(16, true);
pie(32);
pie(64);
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.