-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMotivationalPosterBonusDemo.html
More file actions
52 lines (49 loc) · 1.35 KB
/
MotivationalPosterBonusDemo.html
File metadata and controls
52 lines (49 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Motivational Poster Bonus Demo</title>
<style type='text/css'>
canvas {
border: 1px solid black;
}
</style>
</head>
<body>
<canvas id='canvas' width='800' height='580'></canvas>
<script type='text/javascript'>
var ctx;
var face = new Image();
var faceReady = false;
function draw(ctx) {
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
ctx.fillStyle = "black";
ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
ctx.fillStyle = "red";
ctx.strokeStyle = "red";
if ( faceReady )
ctx.drawImage(face, 130, 20);
ctx.font = '96pt Times New Roman, serif';
ctx.fillText("M", 130, 519);
ctx.fillText("L", 592, 519);
ctx.font = '48pt Times New Roman, serif';
ctx.fillText("R. MITCHEL", 243, 477);
ctx.beginPath();
ctx.moveTo(244.5,484.5);
ctx.lineTo(597.5,484.5);
ctx.closePath();
ctx.stroke();
ctx.fillStyle = "white";
ctx.font = 'small-caps 24pt Century Gothic, Futura, sans-serif';
ctx.fillText("Not a cyborg. Probably.", 255, 555);
}
function main() {
ctx = document.getElementById('canvas').getContext("2d");
face.onload = function() { faceReady = true; draw(ctx); }
face.src = 'face-model-cropped.jpg';
// draw(ctx);
}
main();
</script>
</body>
</html>