summaryrefslogtreecommitdiff
path: root/website
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 /website
parent97e5f5a00debc18ff538b7dd4da78be5221a8807 (diff)
added folder
Diffstat (limited to 'website')
-rw-r--r--website/index.html20
-rw-r--r--website/main.js133
-rw-r--r--website/style.css0
3 files changed, 153 insertions, 0 deletions
diff --git a/website/index.html b/website/index.html
new file mode 100644
index 0000000..d6b2e58
--- /dev/null
+++ b/website/index.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <script src="/main.js" defer></script>
+ <title>Apple comverter</title>
+</head>
+<body>
+ <h1>apple option key convertor</h1>
+ <textarea id="input" placeholder="Input Encrypt or Decrypt msg"></textarea>
+ <select id="mode">
+ <option value="0">Normal</option>
+ <option value="1">Reverse</option>
+ </select>
+ <button id="convertBtn">convert</button>
+ <p id="output"></p>
+ <button id="copyBtn">copy result</button>
+</body>
+</html
diff --git a/website/main.js b/website/main.js
new file mode 100644
index 0000000..212e76e
--- /dev/null
+++ b/website/main.js
@@ -0,0 +1,133 @@
+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);
+}
diff --git a/website/style.css b/website/style.css
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/website/style.css