-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMotivationalPosterDemo.html
More file actions
42 lines (39 loc) · 1.06 KB
/
MotivationalPosterDemo.html
File metadata and controls
42 lines (39 loc) · 1.06 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Motivational Poster Demo</title>
<style type='text/css'>
canvas {
border: 1px solid black;
}
</style>
</head>
<body>
<canvas id='canvas' width='800' height='560'></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 = "white";
if ( faceReady )
ctx.drawImage(face, 130, 30);
ctx.font = '60pt Times New Roman, serif';
ctx.fillText("MR. MITCHELL", 115, 500);
ctx.font = '24pt Century Gothic, Futura, sans-serif';
ctx.fillText("NOT A CYBORG. PROBABLY.", 190, 540);
}
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>