From d7295c8f71ec67b88f81934fd1561eeaad1107f1 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Mon, 8 Apr 2024 22:26:29 +0800 Subject: finished index.html & main.js --- __pycache__/stdlib.cpython-311.pyc | Bin 0 -> 12791 bytes index.html | 20 ++++++ main.js | 123 +++++++++++++++++++++++++++++++++++++ main.py | 2 +- 4 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 __pycache__/stdlib.cpython-311.pyc diff --git a/__pycache__/stdlib.cpython-311.pyc b/__pycache__/stdlib.cpython-311.pyc new file mode 100644 index 0000000..f206498 Binary files /dev/null and b/__pycache__/stdlib.cpython-311.pyc differ diff --git a/index.html b/index.html index e69de29..4fff5be 100644 --- a/index.html +++ b/index.html @@ -0,0 +1,20 @@ + + + + + + APPLE CONVERTER | SECRET ENCRYPT & DECRYPTER + + +
+ +
+ + +
+ + + \ 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() -- cgit v1.2.3