-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
114 lines (98 loc) · 2.43 KB
/
index.html
File metadata and controls
114 lines (98 loc) · 2.43 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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Assignment 1: Painting (Easy)</title>
<style>
body {
font-family: "Times New Roman", serif;
font-size: 12pt;
}
#canvasContainer {
position: relative;
width: 400px;
height: 400px;
}
canvas {
border: 1px solid black;
position: absolute;
left: 0;
top: 0;
}
#bgCanvas { z-index: 0; }
#webgl { z-index: 1; }
#controls {
margin-top: 10px;
}
.control-group {
margin-bottom: 10px;
}
.color-sliders input,
.slider-row input {
width: 150px;
margin-left: 5px;
vertical-align: middle;
}
button {
margin-right: 5px;
margin-top: 3px;
}
.slider-row {
display: flex;
gap: 30px;
align-items: center;
}
.slider-item {
display: flex;
align-items: center;
}
.slider-item label,
.color-sliders label {
margin-right: 5px;
font-weight: normal;
}
</style>
</head>
<body onload="main()">
<div id="canvasContainer">
<canvas id="bgCanvas" width="400" height="400"></canvas>
<canvas id="webgl" width="400" height="400">Your browser does not support canvas.</canvas>
</div>
<div id="controls">
<div class="control-group">
<button onclick="clearCanvas()">Clear Canvas</button>
</div>
<div class="control-group">
<div>Drawing mode:</div>
<button onclick="setBrush('point')">Point</button>
<button onclick="setBrush('triangle')">Triangle</button>
<button onclick="setBrush('circle')">Circle</button>
</div>
<div class="control-group">
<div>Shape Color:</div>
<div class="color-sliders">
<label>R:</label>
<input type="range" id="rSlider" min="0" max="1" step="0.01" value="1">
<label>G:</label>
<input type="range" id="gSlider" min="0" max="1" step="0.01" value="0">
<label>B:</label>
<input type="range" id="bSlider" min="0" max="1" step="0.01" value="0">
</div>
</div>
<div class="control-group slider-row">
<div class="slider-item">
<label>Shape Size:</label>
<input type="range" id="sizeSlider" min="2" max="50" value="10">
</div>
<div class="slider-item">
<label>(Circles) Segment Count:</label>
<input type="range" id="segmentSlider" min="3" max="50" value="20">
</div>
</div>
</div>
<script src="lib/webgl-utils.js"></script>
<script src="lib/webgl-debug.js"></script>
<script src="lib/cuon-utils.js"></script>
<script src="asgn1.js"></script>
</body>
</html>