summaryrefslogtreecommitdiff
path: root/Base/home/anon/www/canvas.html
blob: 8d277ae9b892880f0a7bb64ccdc90329c3a5cd21 (plain)
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
<!DOCTYPE html>
<html>
<head>
<title>Canvas 2D test!</title>
<style type="text/css">
body {
    background-color: #000;
    color: #fff; /* another css comment */
}
canvas {
    border-width: 1px;
    border-style: solid;
    border-color: #fff;
}
</style>
<script>
    document.addEventListener("DOMContentLoaded", function() {
        ctx = document.getElementById("foo").getContext("2d");

        var width = 200;
        var height = 100;
        for (var i = 0; i < 2; i++)
        {
            ctx.fillStyle = 'red';
            ctx.fillRect(10, 10, width, height);

            ctx.strokeStyle = 'blue';
            ctx.strokeRect(10, 10, width, height);

            ctx.scale(0.5, 0.5);
            ctx.translate(10 + width * 2, 10 + height * 2);
        }
    });
</script>
</head>
<body link="#44f" vlink="#c4c" background="90s-bg.png">
    <canvas id="foo" width="300" height="200"></canvas>
</body>
</html>