summaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
authormrdog233o5 <mr.dog233o5@gmail.com>2024-04-11 17:45:21 +0800
committermrdog233o5 <mr.dog233o5@gmail.com>2024-04-11 17:45:21 +0800
commitfea88e1f72780109f794305ea3d27571f12bb075 (patch)
treee76ed7f4d22a69fc8aada377b55a1f49000c9ff6 /main.js
parent97e5f5a00debc18ff538b7dd4da78be5221a8807 (diff)
added folder
Diffstat (limited to 'main.js')
-rw-r--r--main.js133
1 files changed, 0 insertions, 133 deletions
diff --git a/main.js b/main.js
deleted file mode 100644
index 212e76e..0000000
--- a/main.js
+++ /dev/null
@@ -1,133 +0,0 @@
-const modeBtn = document.getElementById("mode");
-const convertBtn = document.getElementById("convertBtn");
-const input = document.getElementById("input");
-const output = document.getElementById("output");
-const copyBtn = document.getElementById("copyBtn");
-var mode = true;
-
-const match = `\`\`
-1¡
-2™
-3£
-4¢
-5∞
-6§
-7¶
-8•
-9ª
-0º
--–
-=≠
-qœ
-w∑
-e´
-r®
-t†
-y¥
-u¨
-iˆ
-oø
-pπ
-[“
-]‘
-\\«
-aå
-sß
-d∂
-fƒ
-g©
-h˙
-j∆
-k˚
-l¬
-;…
-'æ
-zΩ
-x≈
-cç
-v√
-b∫
-n˜
-mµ
-,≤
-.≥
-/÷
-~~
-!⁄
-@€
-#‹
-$›
-%fi
-^fl
-&‡
-*°
-(·
-)‚
-QŒ
-W„
-E´
-R‰
-Tˇ
-YÁ
-U¨
-Iˆ
-OØ
-P∏
-{”
-}’
-|»
-AÅ
-SÍ
-DÎ
-FÏ
-G˝
-HÓ
-JÔ
-K
-LÒ
-:Ú
-"Æ
-Z¸
-X˛
-CÇ
-V◊
-Bı
-N˜
-MÂ
-<¯
->˘
-?¿
- `.split("\n");
-
-function convert(input, mode) {
- input = input.split("");
- var result = "";
- var fromIndex = 0;
- var toIndex = 0;
- if (mode) {
- toIndex = 1;
- } else {
- fromIndex = 1;
- }
- // loop through each char
- input.forEach((char) => {
- // match this char
- for (var i = 0; i < match.length; i++) {
- if (char == match[i][fromIndex]) {
- result += match[i][toIndex];
- return;
- }
- }
- })
- return result;
-}
-
-convertBtn.onclick = event => {
- mode = modeBtn.value == "0" ? false : true;
- var res = convert(input.value, mode);
- output.innerText = res;
-}
-
-copyBtn.onclick = event => {
- navigator.clipboard.writeText(output.innerText);
-}