diff --git a/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/README.md b/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/README.md new file mode 100644 index 00000000..1fe30464 --- /dev/null +++ b/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/README.md @@ -0,0 +1,64 @@ +

đŸ’Ĩ Ceaser Cipher Conversion đŸ’Ĩ

+ + + +

Tech Stack Used 🎮

+ + +
+ + ![HTML5](https://img.shields.io/badge/html5-%23E34F26.svg?style=for-the-badge&logo=html5&logoColor=white) + ![CSS3](https://img.shields.io/badge/css3-%231572B6.svg?style=for-the-badge&logo=css3&logoColor=white) + ![Javascript](https://img.shields.io/badge/css3-%231572B6.svg?style=for-the-badge&logo=css3&logoColor=white) + +
+ + +![Line](https://github.com/Avdhesh-Varshney/WebMasterLog/assets/114330097/4b78510f-a941-45f8-a9d5-80ed0705e847) + + + +## :zap: Description 📃 + +
+

This project is a simple HTML and CSS implementation of a Amazon Prime website clone. It aims to replicate the basic structure and styling of the popular entertaining website Amazon Prime.This project Showcases the power of HTML and CSS.

+
+ + + +## :zap: How to run it? 🕹ī¸ + +
+

To run this project locally, follow these steps: + +- Fork this repository. +- Clone the forked repository. +- Open index.html in your web browser to start your culinary exploration. + +

+
+ + + + +## :zap: Screenshots 📸 + + + +![Line](https://github.com/Avdhesh-Varshney/WebMasterLog/assets/114330097/4b78510f-a941-45f8-a9d5-80ed0705e847) + + + +

Developed By Damini Chachane

+

+ + + + + + +

+ +

Happy Coding 🧑‍đŸ’ģ

+ +

Show some  â¤ī¸  by  đŸŒŸ  this repository!

diff --git a/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/cipher.css b/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/cipher.css new file mode 100644 index 00000000..e9d8b513 --- /dev/null +++ b/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/cipher.css @@ -0,0 +1,108 @@ +body { + font-family: Arial, sans-serif; + background-color: whitesmoke; /* Dark background color */ + color: black; /* Light text color */ + margin: 0; + padding: 0; +} +header{ + display: flex; + justify-content: space-between; + padding: 20px; + font-size: 20px; +} +h1, h2 { + text-align: center; + color: black; /* Light heading color */ +} +#theme-toggle{ + width: 50px; + height: 50px; +justify-items: center; +} +.container{ + display: flex; + justify-content: space-around; + padding: 50px; +} +#decrypt-button{ + width: 100%; + padding: 10px; + border: none; + background-color: black; /* Button color */ + color: #fff; /* Light text color */ + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s; +} +form { + + border:2px solid black; + box-shadow: 2px black; /* White shadow */ + max-width: 400px; + margin: 20px ; + background:whitesmoke; +box-shadow: 32px 32pxpx 32px 32px rgba(21, 26, 106, 0.37);/* Dark form background color */ +backdrop-filter: blur(20px); +-webkit-backdrop-filter: blur(20px); +padding: 20px; + box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); +} + +label { + font-weight: bold; + display: block; + margin-bottom: 5px; + color: black; /* Light label color */ +} + +textarea, +input[type='number'] { + width: 100%; + padding: 10px; + margin-bottom: 10px; + border: 1px solid black; /* Dark border color */ + border-radius: 5px; + box-sizing: border-box; + background-color: white; /* Dark input background color */ + color: black; /* Light text color */ +} + +input[type='submit'] { + width: 100%; + padding: 10px; + border: none; + background-color: black; /* Button color */ + color: #fff; /* Light text color */ + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s; +} + +input[type='submit']:hover { + background-color: rgb(72, 22, 22); /* Button hover color */ +} + +#output { + max-width: 400px; + margin: 20px auto; + background-color: whitesmoke; /* Dark output background color */ + padding: 20px; + border-radius: 10px; + border: 2px solid black; + box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); /* White shadow */ +} +#plaintext{ + max-width: 400px; + margin: 20px ; + background-color: whitesmoke; /* Dark output background color */ + padding: 20px; + border-radius: 10px; + border: 2px solid black; + box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); /* White shadow */ +} +.output-heading { + font-size: 1.2em; + color: chocolate; /* Light heading color */ + margin-bottom: 10px; +} diff --git a/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/index.html b/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/index.html new file mode 100644 index 00000000..366c6150 --- /dev/null +++ b/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/index.html @@ -0,0 +1,54 @@ + + + + + Caesar Cipher + + + +
+

Caesar Cipher

+ +
+ + + +
+ +
+
+ + + + + + +
+

Output

+
+
+
+ +
+
+ + + + +
+ + +
+ +
+

Output

+
+
+ +
+ + + + + + \ No newline at end of file diff --git a/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/main.js b/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/main.js new file mode 100644 index 00000000..9bd4a96c --- /dev/null +++ b/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/main.js @@ -0,0 +1,67 @@ +// main.js +const ALPHABET = 'abcdefghijklmnopqrstuvwxyz'; + +const form = document.querySelector('form'); +const plaintextInput = document.querySelector('textarea[name="plaintext"]'); +const shiftInput = document.querySelector('input[name="shift"]'); +const outputDiv = document.querySelector('#output'); +const themeToggle = document.getElementById('theme-toggle'); +const themeStyle = document.getElementById('theme-style'); +const decryptButton = document.getElementById('decrypt-button'); +const ciphertextInput = document.getElementById('ciphertext'); +const decryptShiftInput = document.getElementById('shift'); +const plaintextOutputDiv = document.getElementById('plaintext'); + +// Theme changing code +themeToggle.addEventListener('click', function() { + if (themeStyle.getAttribute('href') === 'style.css') { + themeStyle.setAttribute('href', 'cipher.css'); + } else { + themeStyle.setAttribute('href', 'style.css'); + } +}); + +// Encrypt code +function encrypt(char, shift) { + if (ALPHABET.includes(char.toLowerCase())) { + const position = ALPHABET.indexOf(char.toLowerCase()); + const newPosition = (position + shift) % 26; + return ALPHABET[newPosition]; + } else { + return char; + } +} + +function encryptText(text, shift) { + return [...text].map(char => encrypt(char, shift)).join(''); +} + +form.addEventListener('submit', (event) => { + event.preventDefault(); + const plaintext = plaintextInput.value; + const shift = Number(shiftInput.value); + const ciphertext = encryptText(plaintext, shift); + outputDiv.innerHTML = ciphertext; +}); + +// Decrypt code +function decrypt(char, shift) { + if (ALPHABET.includes(char.toLowerCase())) { + const position = ALPHABET.indexOf(char.toLowerCase()); + const newPosition = (position - shift + 26) % 26; + return ALPHABET[newPosition]; + } else { + return char; + } +} + +function decryptText(text, shift) { + return [...text].map(char => decrypt(char, shift)).join(''); +} + +decryptButton.addEventListener('click', () => { + const ciphertext = ciphertextInput.value; + const shift = Number(decryptShiftInput.value); + const plaintext = decryptText(ciphertext, shift); + plaintextOutputDiv.textContent = plaintext; +}); \ No newline at end of file diff --git a/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/screenshot.webp b/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/screenshot.webp new file mode 100644 index 00000000..0fb17cd1 Binary files /dev/null and b/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/screenshot.webp differ diff --git a/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/style.css b/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/style.css new file mode 100644 index 00000000..4460de16 --- /dev/null +++ b/Vanilla-JS-Projects/Intermediate/Ceaser-Cipher/style.css @@ -0,0 +1,124 @@ +body { + font-family: Arial, sans-serif; + background-color: #050816; /* Dark background color */ + color: #fff; /* Light text color */ + margin: 0; + padding: 0; +} +header { + display: flex; + justify-content: space-between; + padding: 20px; + font-size: 20px; +} + +h1, +h2 { + text-align: center; + color: #eee; /* Light heading color */ +} +#theme-toggle { + width: 50px; + height: 50px; +} +form { + max-width: 400px; + margin: 20px; + background: rgba(23, 17, 49, 0.5); + box-shadow: 0 8px 32px 0 rgba(21, 26, 106, 0.37); /* Dark form background color */ + backdrop-filter: blur(20px); + -webkit-backdrop-filter: blur(20px); + border-radius: 10px; + border: 1px solid rgba(255, 255, 255, 0.18); + padding: 20px; + border-radius: 10px; + box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); /* White shadow */ +} +.container { + display: flex; + justify-content: space-around; + padding: 50px; +} +label { + font-size: 25px; + font-weight: bold; + display: block; + margin-bottom: 5px; + color: #ccc; /* Light label color */ +} +h2, +h3 { + text-align: center; +} +textarea, +input[type="number"] { + width: 100%; + padding: 10px; + margin-bottom: 10px; + border: 1px solid #555; /* Dark border color */ + border-radius: 5px; + box-sizing: border-box; + background-color: #444; /* Dark input background color */ + color: #fff; /* Light text color */ +} +input[type="submit"] { + width: 100%; + padding: 10px; + border: none; + background-color: #007bff; /* Button color */ + color: #fff; /* Light text color */ + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s; +} +#decrypt-button { + width: 100%; + padding: 10px; + border: none; + background-color: #007bff; /* Button color */ + color: #fff; /* Light text color */ + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s; +} +input[type="submit"]:hover { + background-color: #0056b3; /* Button hover color */ +} + +input[type="Decrypt"] { + width: 100%; + padding: 10px; + border: none; + background-color: #007bff; /* Button color */ + color: #fff; /* Light text color */ + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s; +} + +input[type="Decrypt"]:hover { + background-color: #0056b3; /* Button hover color */ +} + +#output { + max-width: 400px; + margin: 20px; + background-color: #333; /* Dark output background color */ + padding: 20px; + border-radius: 10px; + box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); /* White shadow */ +} +#plaintext { + color: white; + max-width: 400px; + margin: 20px auto; + background-color: #333; /* Dark output background color */ + padding: 20px; + border-radius: 10px; + box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); /* White shadow */ +} +.output-heading { + font-size: 1.2em; + color: #eee; /* Light heading color */ + margin-bottom: 10px; +}