-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheqtyper.html
169 lines (164 loc) · 7.18 KB
/
eqtyper.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
---
layout: default
title: Plain Text Equation Typer
description: Type equations using plain text, then paste them anywhere (even sites that don't support math formatting such as Discord, Facebook, WhatsApp, etc).
categories: [tools]
---
<style>
body {
zoom: 125%;
}
table, tr, td {
border: none;
}
textarea {
opacity: 0;
}
#textbox {
width: 100%;
}
button {
font-family: inherit;
}
.inserter {
font-weight: bold;
font-family: Arial, sans-serif;
}
</style>
<table>
<tr>
<td>
<button id="copier" width="50%">Copy</button>
<button id="clearer" width="50%">Clear</button>
</td>
<td>
<input type="text" name="textbox" id="textbox" placeholder="Enter equation here" spellcheck="false">
</td>
</tr>
<tr>
<td><b>Subscripts</b></td>
<td>
<button class="inserter" title="Subscript 1">₁</button>
<button class="inserter" title="Subscript 2">₂</button>
<button class="inserter" title="Subscript 3">₃</button>
<button class="inserter" title="Subscript 4">₄</button>
<button class="inserter" title="Subscript 5">₅</button>
<button class="inserter" title="Subscript 6">₆</button>
<button class="inserter" title="Subscript 7">₇</button>
<button class="inserter" title="Subscript 8">₈</button>
<button class="inserter" title="Subscript 9">₉</button>
<button class="inserter" title="Subscript 0">₀</button>
<button class="inserter" title="Subscript Minus">₋</button>
</td>
</tr>
<tr>
<td>
<b>Superscripts</b>
</td>
<td>
<button class="inserter" title="Superscript 1">¹</button>
<button class="inserter" title="Superscript 2">²</button>
<button class="inserter" title="Superscript 3">³</button>
<button class="inserter" title="Superscript 4">⁴</button>
<button class="inserter" title="Superscript 5">⁵</button>
<button class="inserter" title="Superscript 6">⁶</button>
<button class="inserter" title="Superscript 7">⁷</button>
<button class="inserter" title="Superscript 8">⁸</button>
<button class="inserter" title="Superscript 9">⁹</button>
<button class="inserter" title="Superscript 0">⁰</button>
<button class="inserter" title="Superscript Minus">⁻</button>
</td>
</tr>
<tr>
<td>
<b>Math/Greek</b>
</td>
<td>
<button class="inserter" title="Plus/Minus">±</button>
<button class="inserter" title="Square Root">√</button>
<button class="inserter" title="Not Equal To">≠</button>
<button class="inserter" title="Less Than or Equal To">≤</button>
<button class="inserter" title="Greater Than or Equal To">≥</button>
<button class="inserter" title="Approximately Equal To">≈</button>
<button class="inserter" title="Theta">θ</button>
<button class="inserter" title="Alpha">α</button>
<button class="inserter" title="Pi">π</button>
<button class="inserter" title="Degree">°</button>
<button class="inserter" title="Division">÷</button>
<button class="inserter" title="Multiplication">×</button>
<button class="inserter" title="Infinity">∞</button>
</td>
</tr>
<tr>
<td>
<b>Arrows</b>
</td>
<td>
<button class="inserter" title="Left Arrow">←</button>
<button class="inserter" title="Right Arrow">→</button>
<button class="inserter" title="Left-Right Arrow">↔</button>
</td>
</tr>
<tr>
<td>
<b>Logic</b>
</td>
<td>
<button class="inserter" title="Element of">∈</button>
<button class="inserter" title="Not an Element of">∉</button>
<button class="inserter" title="Exists">∃</button>
<button class="inserter" title="Does Not Exist">∄</button>
<button class="inserter" title="For All">∀</button>
<button class="inserter" title="Negation">¬</button>
<button class="inserter" title="Superset">⊃</button>
<button class="inserter" title="Subset">⊂</button>
<button class="inserter" title="Subset or Equal To">⊆</button>
<button class="inserter" title="Superset or Equal To">⊇</button>
<button class="inserter" title="Perpendicular">⊥</button>
<button class="inserter" title="Logical OR">∨</button>
<button class="inserter" title="Logical AND">∧</button>
<button class="inserter" title="Turnstile">⊢</button>
<button class="inserter" title="Entails">⊨</button>
<button class="inserter" title="XOR">⊕</button>
<button class="inserter" title="Equivalent">≡</button>
</td>
</tr>
</table>
<p>
This is a simple tool that allows you to type equations using only special characters,
which are supported by almost any app or website
(such as Twitter/X, Discord, Facebook, WhatsApp, Zoom, etc).
Just type your equation in the text box above
(clicking the special character buttons when needed)
and then click the "Copy" button to copy the equation to your clipboard.
You can then paste it anywhere you like.
</p>
<textarea id="copyarea" aria-hidden="true"></textarea>
<script>
let textfield = document.getElementById("textbox")
let buttons = document.querySelectorAll(".inserter")
let copybtn = document.getElementById("copier")
let clearbtn = document.getElementById("clearer")
buttons.forEach(btn => {
btn.addEventListener("click", _e => {
textfield.value += btn.innerText
textfield.focus()
})
})
copybtn.addEventListener("click", _e => {
/* navigator.clipboard.writeText(textfield.value)
.then(() => alert("copied!"))
.catch(err => alert("Error: ", err)) */
let ta = document.getElementById("copyarea")
ta.value = textfield.value
ta.focus()
ta.select()
ta.setSelectionRange(0, 99999)
document.execCommand("copy")
textfield.focus()
})
clearbtn.addEventListener("click", _e => {
textfield.value = ""
textfield.focus()
})
</script>