diff --git a/Calculators/Palindrome-Calculator/README.md b/Calculators/Palindrome-Calculator/README.md new file mode 100644 index 000000000..e3f3e3037 --- /dev/null +++ b/Calculators/Palindrome-Calculator/README.md @@ -0,0 +1,20 @@ +#

Palindrome Checker

+ +## Description :- + +This is a simple website that checks whether a entered number or string is a palindrome or not. + +## Features +> Checks for single words and phrases (including spaces and punctuation). +Displays a clear message indicating if the input is a palindrome or not. +Handles case-insensitivity (e.g., "Racecar" and "RACECAR" are both considered palindromes). + +## Tech Stacks :- + +- HTML +- CSS +- JavaScript + +## Screenshots :- + +![image](https://github.com/Rakesh9100/CalcDiverse/assets/146326636/95d593fd-4e29-4780-86ee-268523c51c1c) diff --git a/Calculators/Palindrome-Calculator/index.html b/Calculators/Palindrome-Calculator/index.html new file mode 100644 index 000000000..d708f2db5 --- /dev/null +++ b/Calculators/Palindrome-Calculator/index.html @@ -0,0 +1,20 @@ + + + + + + Palindrome Checker + + + +
+

Palindrome Checker

+ + + +

+
+ + + + diff --git a/Calculators/Palindrome-Calculator/script.js b/Calculators/Palindrome-Calculator/script.js new file mode 100644 index 000000000..7baecec17 --- /dev/null +++ b/Calculators/Palindrome-Calculator/script.js @@ -0,0 +1,12 @@ +function checkPalindrome() { + var userInput = document.getElementById("input").value; + var reversedInput = userInput.split('').reverse().join(''); + var isPalindrome = (userInput === reversedInput); + + if (isPalindrome) { + document.getElementById("result").innerText = userInput + " is a palindrome."; + } else { + document.getElementById("result").innerText = userInput + " is not a palindrome."; + } + } + \ No newline at end of file diff --git a/Calculators/Palindrome-Calculator/styles.css b/Calculators/Palindrome-Calculator/styles.css new file mode 100644 index 000000000..d58b38084 --- /dev/null +++ b/Calculators/Palindrome-Calculator/styles.css @@ -0,0 +1,58 @@ +body { + background: linear-gradient(to right, #5E1675, #344955); + font-family: Arial, sans-serif; + background-color: #f4f4f4; + margin: 0; + padding: 0; + } + + .container { + max-width: 600px; + margin: 100px auto; + padding: 20px; + background-color: #fff; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + } + + h1 { + text-align: center; + } + + label { + display: block; + margin-bottom: 10px; + } + + input[type="text"] { + width: 97%; + padding: 8px; + margin-bottom: 10px; + font-size: 16px; + border-radius: 4px; + border: 1px solid #ccc; + } + + button { + display: block; + width: 100%; + padding: 10px; + margin-top: 10px; + font-size: 16px; + background-color: #337357; + color: #fff; + border: none; + border-radius: 4px; + cursor: pointer; + transition: all 0.5s ease; + } + + button:hover { + background-color: #5E1675; + } + + p#result { + margin-top: 20px; + text-align: center; + } + \ No newline at end of file diff --git a/index.html b/index.html index dafb46079..ba02e55e2 100644 --- a/index.html +++ b/index.html @@ -1911,6 +1911,20 @@

Check if a number is Happy or not and finds happy number in a range.

+
+
+

Palindrome Calculator

+

Checks if an entered number or string is Palindrome or not.

+ +
+