From c27cdf708bcec7139e1a85419152f3956ae56da0 Mon Sep 17 00:00:00 2001 From: Mehank <70057473+M3hank@users.noreply.github.com> Date: Wed, 11 Oct 2023 08:59:52 -0400 Subject: [PATCH 1/2] Add files via upload --- CodeCipher/M3hank/index.html | 41 +++++++++++++++++++++++++ CodeCipher/M3hank/scripts.js | 39 ++++++++++++++++++++++++ CodeCipher/M3hank/styles.css | 58 ++++++++++++++++++++++++++++++++++++ 3 files changed, 138 insertions(+) create mode 100644 CodeCipher/M3hank/index.html create mode 100644 CodeCipher/M3hank/scripts.js create mode 100644 CodeCipher/M3hank/styles.css diff --git a/CodeCipher/M3hank/index.html b/CodeCipher/M3hank/index.html new file mode 100644 index 000000000..c7c181961 --- /dev/null +++ b/CodeCipher/M3hank/index.html @@ -0,0 +1,41 @@ + + + + + + + Encoder & Decoder + + + + +
+

CodeCipher

+ + +
+ + + + + + + + + + + + +
+ + +
+ Made by M3hank +
+ + +
+ + + + diff --git a/CodeCipher/M3hank/scripts.js b/CodeCipher/M3hank/scripts.js new file mode 100644 index 000000000..3f0701435 --- /dev/null +++ b/CodeCipher/M3hank/scripts.js @@ -0,0 +1,39 @@ +/** + * Encoder & Decoder Script + * Author: M3hank + */ + +function convert(type, method) { + const input = document.getElementById('input').value; + let output = ''; + + switch (method) { + case 'uri': + output = (type === 'encode') ? encodeURIComponent(input) : decodeURIComponent(input); + break; + case 'base64': + output = (type === 'encode') ? btoa(unescape(encodeURIComponent(input))) : decodeURIComponent(escape(atob(input))); + break; + case 'html': + const textArea = document.createElement('textarea'); + if (type === 'encode') { + textArea.innerText = input; + output = textArea.innerHTML; + } else { + textArea.innerHTML = input; + output = textArea.value; + } + break; + case 'unicode': + output = (type === 'encode') ? input.split('').map(char => '\\u' + char.charCodeAt(0).toString(16).padStart(4, '0')).join('') : input.replace(/\\u([\d\w]{4})/gi, (match, grp) => String.fromCharCode(parseInt(grp, 16))); + break; + case 'hex': + output = (type === 'encode') ? Array.from(input).map(ch => ch.charCodeAt(0).toString(16)).join('') : String.fromCharCode(...input.match(/.{1,2}/g).map(byte => parseInt(byte, 16))); + break; + case 'binary': + output = (type === 'encode') ? Array.from(input).map(ch => ch.charCodeAt(0).toString(2).padStart(8, '0')).join('') : String.fromCharCode(...input.match(/.{1,8}/g).map(byte => parseInt(byte, 2))); + break; + } + + document.getElementById('output').value = output; +} diff --git a/CodeCipher/M3hank/styles.css b/CodeCipher/M3hank/styles.css new file mode 100644 index 000000000..77bedda4d --- /dev/null +++ b/CodeCipher/M3hank/styles.css @@ -0,0 +1,58 @@ +/* + * Encoder & Decoder Styles + * Author: M3hank + */ + +body { + font-family: 'Arial', sans-serif; + background-color: #f4f4f4; + padding: 40px; +} + +.container { + background-color: #fff; + padding: 30px; + border-radius: 8px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); + max-width: 600px; + margin: 0 auto; +} + +.dropdown { + padding: 10px 15px; + border-radius: 5px; + border: 1px solid #e0e0e0; + width: 100%; + margin-bottom: 15px; +} + +textarea { + width: 100%; + padding: 15px; + border-radius: 5px; + border: 1px solid #e0e0e0; + margin-bottom: 15px; + resize: vertical; +} + +.btn { + background-color: #007bff; + color: #fff; + padding: 10px 15px; + border: none; + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s; +} + +.btn:hover { + background-color: #0056b3; +} + +.author { + font-size: 1.2em; + text-align: center; + margin-top: 20px; + color: black; + font-weight: bold; +} \ No newline at end of file From 410c0db4de45fd20dc01db62013771e5a8eacc02 Mon Sep 17 00:00:00 2001 From: Mehank <70057473+M3hank@users.noreply.github.com> Date: Thu, 12 Oct 2023 02:20:20 +0000 Subject: [PATCH 2/2] Changed name to EncrypterDecrypterApp --- {CodeCipher => EncrypterDecrypterApp}/M3hank/index.html | 4 ++-- {CodeCipher => EncrypterDecrypterApp}/M3hank/scripts.js | 2 +- {CodeCipher => EncrypterDecrypterApp}/M3hank/styles.css | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename {CodeCipher => EncrypterDecrypterApp}/M3hank/index.html (95%) rename {CodeCipher => EncrypterDecrypterApp}/M3hank/scripts.js (98%) rename {CodeCipher => EncrypterDecrypterApp}/M3hank/styles.css (97%) diff --git a/CodeCipher/M3hank/index.html b/EncrypterDecrypterApp/M3hank/index.html similarity index 95% rename from CodeCipher/M3hank/index.html rename to EncrypterDecrypterApp/M3hank/index.html index c7c181961..57c644121 100644 --- a/CodeCipher/M3hank/index.html +++ b/EncrypterDecrypterApp/M3hank/index.html @@ -4,13 +4,13 @@ - Encoder & Decoder + EncrypterDecrypterApp
-

CodeCipher

+

EncrypterDecrypterApp

diff --git a/CodeCipher/M3hank/scripts.js b/EncrypterDecrypterApp/M3hank/scripts.js similarity index 98% rename from CodeCipher/M3hank/scripts.js rename to EncrypterDecrypterApp/M3hank/scripts.js index 3f0701435..66fd59276 100644 --- a/CodeCipher/M3hank/scripts.js +++ b/EncrypterDecrypterApp/M3hank/scripts.js @@ -1,5 +1,5 @@ /** - * Encoder & Decoder Script + * EncrypterDecrypterApp Script * Author: M3hank */ diff --git a/CodeCipher/M3hank/styles.css b/EncrypterDecrypterApp/M3hank/styles.css similarity index 97% rename from CodeCipher/M3hank/styles.css rename to EncrypterDecrypterApp/M3hank/styles.css index 77bedda4d..4bce10fb3 100644 --- a/CodeCipher/M3hank/styles.css +++ b/EncrypterDecrypterApp/M3hank/styles.css @@ -1,5 +1,5 @@ /* - * Encoder & Decoder Styles + * EncrypterDecrypterApp * Author: M3hank */