summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-04-08 22:26:29 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-04-08 22:26:29 +0800
commitd7295c8f71ec67b88f81934fd1561eeaad1107f1 (patch)
treec47e41556dcf414c968e7aa39d93b7f4d6f0d72b
parent189c4e4e559380d676e902bb18c3fa9edc9acef0 (diff)
finished index.html & main.js
-rw-r--r--__pycache__/stdlib.cpython-311.pycbin0 -> 12791 bytes
-rw-r--r--index.html20
-rw-r--r--main.js123
-rw-r--r--main.py2
4 files changed, 144 insertions, 1 deletions
diff --git a/__pycache__/stdlib.cpython-311.pyc b/__pycache__/stdlib.cpython-311.pyc
new file mode 100644
index 0000000..f206498
--- /dev/null
+++ b/__pycache__/stdlib.cpython-311.pyc
Binary files differ
diff --git a/index.html b/index.html
index e69de29..4fff5be 100644
--- a/index.html
+++ b/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">
+ <title>APPLE CONVERTER | SECRET ENCRYPT & DECRYPTER</title>
+</head>
+<body>
+ <div class="input">
+ <textarea id="input" cols="30" rows="10">Input Area</textarea>
+ </div>
+ <select id="mode">
+ <option value="normal">Normal</option>
+ <option value="reverse">Reverse</option>
+ </select>
+ <button id="convert">Convert</button>
+ <div class="output" id="output"></div>
+ <script defer src="/main.js"></script>
+</body>
+</html> \ No newline at end of file
diff --git a/main.js b/main.js
index e69de29..a227ac9 100644
--- a/main.js
+++ b/main.js
@@ -0,0 +1,123 @@
+const map = {
+ '`': '`',
+ '~': '`',
+ '1': '¡',
+ '!': '⁄',
+ '2': '™',
+ '@': '€',
+ '3': '£',
+ '#': '‹',
+ '4': '¢',
+ '$': '›',
+ '5': '∞',
+ '%': 'fi',
+ '6': '§',
+ '^': 'fl',
+ '7': '¶',
+ '&': '‡',
+ '8': '•',
+ '*': '°',
+ '9': 'ª',
+ '(': '·',
+ '0': 'º',
+ ')': '‚',
+ '-': '−',
+ '_': '—',
+ '=': '≠',
+ '+': '±',
+ 'q': 'œ',
+ 'Q': 'Œ',
+ 'w': '∑',
+ 'W': '„',
+ 'e': '´',
+ 'E': '´',
+ 'r': '®',
+ 'R': '‰',
+ 't': '†',
+ 'T': 'ˇ',
+ 'y': '¥',
+ 'Y': 'Á',
+ 'u': '¨',
+ 'U': '¨',
+ 'i': 'ˆ',
+ 'I': 'ˆ',
+ 'o': 'ø',
+ 'O': 'Ø',
+ 'p': 'π',
+ 'P': '∏',
+ '[': '“',
+ '{': '”',
+ ']': '‘',
+ '}': '’',
+ '\\': '«',
+ '|': '»',
+ 'a': 'å',
+ 'A': 'Å',
+ 's': 'ß',
+ 'S': 'Í',
+ 'd': '∂',
+ 'D': 'Î',
+ 'f': 'ƒ',
+ 'F': 'Ï',
+ 'g': '©',
+ 'G': '˝',
+ 'h': '˙',
+ 'H': '',
+ 'j': '∆',
+ 'J': 'Ô',
+ 'k': '˚',
+ 'K': '',
+ 'l': '…',
+ 'L': 'Ò',
+ ';': '…',
+ ':': 'Ú',
+ 'z': 'Ω',
+ 'Z': '¸',
+ 'x': '≈',
+ 'X': '˛',
+ 'c': 'ç',
+ 'C': 'Ç',
+ 'v': '√',
+ 'V': '◊',
+ 'b': '∫',
+ 'B': 'ı',
+ 'n': '˜',
+ 'N': '˜',
+ 'm': 'µ',
+ 'M': 'Â',
+ ',': '≤',
+ '<': '≤',
+ '.': '≥',
+ '>': '˘',
+ '/': '÷',
+ '?': '¿'
+};
+
+const inputArea = document.getElementById('input');
+const outputDiv = document.getElementById('output');
+const convertButton = document.getElementById('convert');
+const modeSelect = document.getElementById('mode');
+
+convertButton.addEventListener('click', () => {
+ const mode = modeSelect.value;
+ const inputText = inputArea.value;
+ let outputText = '';
+
+ if (mode === 'normal') {
+ outputText = convertNormal(inputText, map);
+ } else if (mode === 'reverse') {
+ outputText = convertReverse(inputText, map);
+ }
+
+ outputDiv.textContent = outputText;
+});
+
+function convertNormal(data, map) {
+ return data.split('').map(char => {
+ return Object.keys(map).find(key => map[key] === char) || char;
+ }).join('');
+}
+
+function convertReverse(data, map) {
+ return data.split('').map(char => map[char] || char).join('');
+} \ No newline at end of file
diff --git a/main.py b/main.py
index e8cf321..96860d8 100644
--- a/main.py
+++ b/main.py
@@ -153,4 +153,4 @@ def reverseMode(data: str):
if __name__ == '__main__':
in_data = keepasks("What is the data you want to transfer?", inputter=askinput)
out_data = ""
- main() \ No newline at end of file
+ main()