This repository has been archived by the owner on Jun 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
uuCanvastest.html
70 lines (50 loc) · 1.68 KB
/
uuCanvastest.html
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html>
<head>
<title>Wedding Seating Planner</title>
<link rel="stylesheet" href="css/seating-planner.css">
<script src="js/libs/uuCanvas.js"></script>
<script src="js/libs/jquery.js"></script>
<script>
function xcanvas(uu) {
drawShape(document.getElementById('slcanvas'));
drawShape(document.getElementById('vmlcanvas'));
drawShape(document.getElementById('flashcanvas'));
var canvas = uu.canvas.create();
var ctx = canvas.getContext("2d");
ctx.textBaseline = "top";
ctx.font = "32pt 'Times New Roman'";
ctx.fillStyle = "black";
ctx.shadowColor = "gray";
ctx.shadowOffsetX = 10;
ctx.shadowOffsetY = 10;
ctx.shadowBlur = 5;
ctx.fillText("Hello Canvas", 0, 0);
$('.app').appendChild(canvas);
$('.app').show();
}
function drawShape(canvas, matrix){
var ctx = canvas.getContext('2d');
ctx.clearRect(0, 0, canvas.width, canvas.height);
if (matrix) {
ctx.rotate(Math.PI / 36);
}
ctx.save();
ctx.fillRect(25,25,100,100);
ctx.clearRect(45,45,60,60);
ctx.strokeRect(50,50,50,50);
ctx.font = "64pt Arial";
ctx.textBaseline = "top";
ctx.fillStyle = "orange";
ctx.fillText("fill", 22, 22);
ctx.restore();
}
</script>
</head>
<body>
<div class="app" style="display:none"></div>
<canvas id="slcanvas" class="sl" width="150" height="150"></canvas>
<canvas id="vmlcanvas" class="vml" width="150" height="150"></canvas>
<canvas id="flashcanvas" class="flash" width="150" height="150"></canvas>
</body>
</html>