-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·85 lines (76 loc) · 2.17 KB
/
index.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="./styles.css" />
</head>
<body>
<div id="controls">
<ul>
<li><button id="reset">Reset</button></li>
<li><button id="about">About</button></li>
</ul>
</div>
<canvas id="shapes" width="700" height="750">
Your browser does not support canvas.
</canvas>
<div class="about">
<button id="close">X</button>
<header>
<h1>The Drawing Machine</h1>
<h2>Author: Bruno Chagas</h2>
</header>
<p>
The Drawing Machine is an APP that helps
you to draw a parallelogram from 3 selected points.
</p>
<h3>Usage</h3>
<p>
Click on browser area to create a point,
after you have created 3 points, the fourth point will
be automatically calculated in order to draw a blue parallelogram
with the corners in the center of the points that you have chosen, in addition
a yellow circle with the same area and center of mass of the parallelogram.
<br><br>
If you align the points to make a square the program will re-create the parallelogram :D.
</p>
</div>
<div class="captions">
<p>PA: Parallelogram Area</p>
<p>CA: Cirlce Area</p>
<p>CP: Circle Position</p>
</dl>
</div>
</body>
<script src="./parallelogram.js"></script>
<script>
window.onload = () => {
window.circleArea = Math.PI * 2;
window.pointSize = pointSize = 11;
const options = {
lineWidth: 2,
pointSize: window.pointSize,
fontFamily: "11pt Courier",
circleArea: window.circleArea,
minPoints: 3,
strokeColors: {
blue: "blue",
red: "red",
yellow: "yellow"
},
actions: {
dragging: false
},
messages: {
error: false
},
resetButton: "reset",
aboutButton: "about",
closeButton: "close"
};
const canvas = document.querySelector("canvas");
const App = new ShapesApp(canvas);
App.initialize(options);
}
</script>
</html>