-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
182 lines (154 loc) · 7.53 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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<!DOCTYPE>
<html>
<head>
<title>Graphing Calculator</title>
<meta charset="utf-8" />
<!--Import Google Icon Font-->
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="materialize-src/css/materialize.css" media="screen,projection"/>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/math.min.js"></script>
<script src="jscolor.js"></script>
<script type="text/javascript" src="grapher.js"></script>
<!-- In case I ever need a symbolic derivative:
<script src="http://nerdamer.com/js/nerdamer.core.js"></script>
<script src="http://nerdamer.com/js/Algebra.js"></script>
<script src="http://nerdamer.com/js/Calculus.js"></script>
-->
<script type="text/javascript">
function getRGBColor(picker, elementId) {
//alert($(elementId).val());
//$(elementId).val(picker.toRGBString());
$(elementId).val(Math.round(picker.rgb[0]) + ', ' +
Math.round(picker.rgb[1]) + ', ' +
Math.round(picker.rgb[2]));
}
</script>
</head>
<body>
<!--- nav bar -->
<nav>
<div class="nav-wrapper teal lighten-2">
<a href="#" class="brand-logo center">A Graphing Calculator</a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href=""><!-- enter link here someday --></a></li>
</ul>
</div>
</nav>
<!-- end nav bar -->
<div class="row"></div>
<!-- page layout here -->
<div class="row container">
<div class="col s3">
<!-- left navigation panel -->
<div class="row">
<form action="#">
Function Type:
<p>
<input name="functionType" type="radio" id="rational" class="with-gap" />
<label for="rational">Rational Function</label>
</p>
<p>
<input name="functionType" type="radio" id="polynomial" class="with-gap" checked />
<label for="polynomial">Polynomial Function</label>
</p>
<p>
<input name="functionType" type="radio" id="other" class="with-gap" />
<label for="other">Logarithmic, Trigonometric, or Exponential Function</label>
</p>
</form>
</div>
<div class="row"> </div>
<div class="row"> </div>
<div class="row">
<!-- Modal Trigger -->
<button data-target="colorModal" class="btn modal-trigger">Select Colors</button>
<!-- Modal Structure -->
<div id="colorModal" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Colors</h4>
<p>Select colors below</p>
<ul>
<li><input type="hidden" id="hdnFuncColor" />
<button class="waves-effect waves-light btn jscolor {valueElement:'hdnFuncColor',value:'009688'}"
id="functionColor">Function</button> </li>
<li><input type="hidden" id="hdn2" />
<button class="waves-effect waves-light btn jscolor {valueElement:hdn2,value:'6BA292'}"
id="derivColor">First Derivative</button></li>
<li><input type="hidden" id="hdn3" />
<button class="waves-effect waves-light btn jscolor {valueElement:hdn3,value:'595959'}"
id="2derivColor">Second Derivative</button></li>
<br>
<li><input type="hidden" id="hdn4" value="255,15,0" />
<button class="waves-effect waves-light btn jscolor {valueElement:hdn4,value:'BCA3AC', onFineChange:'getRGBColor(this, hdn4)'}"
id="inflectioncolor">Inflection Point</button></li>
<li><input type="hidden" id="hdn5" value="153,0,204" />
<button class="waves-effect waves-light btn jscolor {valueElement:hdn5, value:'3581B8', onFineChange:'getRGBColor(this, hdn5)'}"
id="extremaColor">Extrema</button></li>
<li><input type="hidden" id="hdn6" value="51,102,0" />
<button class="waves-effect waves-light btn jscolor {valueElement:hdn6, value:'AB9B96', onFineChange:'getRGBColor(this, hdn6)'}"
id="upColor">Concave Up</button></li>
<li><input type="hidden" id="hdn7" value="0,0,0" />
<button class="waves-effect waves-light btn jscolor {onFineChange:'getRGBColor(this, hdn7)', valueElement:hdn7,value:'E8F1F2 '}"
id="downColor">Concave Down</button></li>
</ul>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">Close</a>
</div>
</div>
</div>
<div class="row"> </div>
<div class="row">
<div class="row">
<div class="input-field ">
<input placeholder="Enter a Function to Graph" type="text" id="inputField">
<label for="inputField">f(x) = </label>
</div>
</div>
<div class="row">
<button class="btn waves-effect waves-light" type="submit" name="refreshGraph" id="btnGraph">Graph
<i class="material-icons right">send</i>
</button>
</div>
</div>
</div>
<div class="col s9">
<!-- right page content -->
<canvas width="600" height="600" id="myCanvas"></canvas>
</div>
</div>
<!-- end page content-->
<!-- begin footer -->
<footer class="page-footer teal lighten-2">
<div class="container">
<div class="row">
<div class="col l6 s12">
<h5 class="white-text">Key to Entering Functions:</h5>
<ul>
<li><a class="grey-text text-lighten-3" href="#!">Enter log(x) to graph ln(x)</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Enter log(x, b) to graph log base b </a></li>
<li><a class="grey-text text-lighten-3" href="#!">Coefficients: 3*x instead of 3x</a></li>
</ul>
</div>
<div class="col l4 offset-l2 s12">
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
© 2016 Shirlyn Prabahar
</div>
</div>
</footer>
<!-- end footer -->
<!-- move more imports here later -->
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/css/materialize.min.css">
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/js/materialize.min.js"></script>
</body>
</html>