-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
114 lines (102 loc) · 4.86 KB
/
Copy pathindex.html
File metadata and controls
114 lines (102 loc) · 4.86 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">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
content="Visualise mathematical functions and their derivatives on interactive Cartesian planes. A learning tool for students.">
<title>Function & Derivative Visualiser</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
rel="stylesheet">
<link rel="icon" href="public/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="app">
<!-- Top-left: Function Input -->
<div class="panel" id="input-panel">
<div class="panel-header">Function Input</div>
<div class="input-group">
<label for="fn-input">f(x) =</label>
<input type="text" id="fn-input" placeholder="e.g. x^3 - 2*x + 1" autocomplete="off" spellcheck="false"
autocapitalize="none" autocorrect="off" />
<label style="margin-top:4px;">f(x) Axis Range</label>
<div class="range-row">
<div class="range-field">
<label for="range-xmin">x min</label>
<input type="number" id="range-xmin" class="range-input" placeholder="-10" value="-10" step="0.01" />
</div>
<div class="range-field">
<label for="range-xmax">x max</label>
<input type="number" id="range-xmax" class="range-input" placeholder="10" value="10" step="0.01" />
</div>
</div>
<div class="range-row">
<div class="range-field">
<label for="range-ymin">y min</label>
<input type="number" id="range-ymin" class="range-input" placeholder="-10" value="-10" step="0.01" />
</div>
<div class="range-field">
<label for="range-ymax">y max</label>
<input type="number" id="range-ymax" class="range-input" placeholder="10" value="10" step="0.01" />
</div>
</div>
<button id="enter-btn">ENTER</button>
<div id="error-msg"></div>
</div>
<div class="hint">
Supported: <code>x</code>, <code>^</code>, <code>sin</code>, <code>cos</code>,
<code>tan</code>, <code>ln</code>, <code>sqrt</code>, <code>e</code>, <code>pi</code>
</div>
</div>
<!-- Top-right: f(x) graph -->
<div class="panel canvas-panel top" id="fn-canvas-panel">
<span class="canvas-label fn">f(x)</span>
<canvas id="canvas-fn"></canvas>
</div>
<!-- Bottom-left: Derivative display -->
<div class="panel" id="deriv-panel">
<div class="panel-header">Derivative</div>
<div class="deriv-display" id="deriv-display">
<div class="fn-placeholder" id="fn-placeholder-orig">Enter a function above…</div>
</div>
<div class="input-group" style="padding-top:0;">
<label>f ′(x) Axis Range</label>
<div class="range-row">
<div class="range-field">
<label for="range-dxmin">x min</label>
<input type="number" id="range-dxmin" class="range-input" placeholder="-10" value="-10" step="0.01" />
</div>
<div class="range-field">
<label for="range-dxmax">x max</label>
<input type="number" id="range-dxmax" class="range-input" placeholder="10" value="10" step="0.01" />
</div>
</div>
<div class="range-row">
<div class="range-field">
<label for="range-dymin">y min</label>
<input type="number" id="range-dymin" class="range-input" placeholder="-10" value="-10" step="0.01" />
</div>
<div class="range-field">
<label for="range-dymax">y max</label>
<input type="number" id="range-dymax" class="range-input" placeholder="10" value="10" step="0.01" />
</div>
</div>
<button id="deriv-enter-btn"
style="font-family:'Inter',sans-serif;font-size:14px;font-weight:600;padding:12px 0;border:none;border-radius:10px;cursor:pointer;background:linear-gradient(135deg,var(--accent),#9b6aff);color:#fff;letter-spacing:.4px;transition:transform .15s,box-shadow .25s;margin-top:4px;">ENTER</button>
<button id="lock-btn"
style="font-family:'Inter',sans-serif;font-size:13px;font-weight:600;padding:10px 0;border:2px solid var(--accent);border-radius:10px;cursor:pointer;background:transparent;color:var(--accent);letter-spacing:.4px;transition:all .2s;margin-top:4px;">🔓
Lock Points</button>
</div>
</div>
<!-- Bottom-right: f'(x) graph -->
<div class="panel canvas-panel bottom" id="deriv-canvas-panel">
<span class="canvas-label deriv">f ′(x)</span>
<canvas id="canvas-deriv"></canvas>
</div>
</div>
<script src="script.js"></script>
</body>
</html>