Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Answer #212

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
49 changes: 27 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
# ↔️ Week08 Bootcamp2019a Project: Server Side Palindrome Checker

### Goal: Create a simple web application that uses the fs and http modules to validate if a string is a palindrome server side.

### How to submit your code for review:

- Fork and clone this repo
- Create a new branch called answer
- Checkout answer branch
- Push to your fork
- Issue a pull request
- Your pull request description should contain the following:
- (1 to 5 no 3) I completed the challenge
- (1 to 5 no 3) I feel good about my code
- Anything specific on which you want feedback!

Example:
```
I completed the challenge: 5
I feel good about my code: 4
I'm not sure if my constructors are setup cleanly...
```
# Palindrome Panic

![Palindrome Panic Site Gif](img/palindrome-panic.gif)

Link to Project: https://palindrome-panic-production.up.railway.app/

Welcome to my Palindrome Panic project. This server-side application uses the fs and http modules to validate whether a given string is a palindrome.

## How It's Made

Technologies Used: HTML, CSS, JavaScript, Node.js

In this project, I created a simple web application that checks if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequences of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization).

I used HTML to create the structure of the web page and included input fields for users to enter a string. The CSS was used to style the page and make it visually appealing. The core functionality was implemented in JavaScript, where I used the fs and http modules to validate whether the input string is a palindrome. If it is, the application displays a message indicating that the string is a palindrome; otherwise, it notifies the user that the string is not a palindrome.

This project allowed me to practice my front-end development skills and demonstrate my ability to create a simple, server-side application.

## Optimizations (optional)

During the development of this project, I focused on delivering a functional and user-friendly application. While I did not implement specific optimizations, I continuously refined and improved the code as I gained more experience. I learned the importance of efficient code and how it can significantly impact the user experience.

## Lessons Learned

Building this project was a great learning experience. It reminded me that being an engineer means continuous growth and learning. I encountered challenges and had moments of realization and excitement as I made progress. I found joy in solving problems and making the application work seamlessly. This project taught me the value of perseverance, self-awareness, and the satisfaction of creating something functional and user-friendly.

I look forward to further expanding my knowledge and skills in web development, and I am excited to take on new challenges in the future.
12 changes: 12 additions & 0 deletions api.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<h1>API Loading</h1>
<script type="text/javascript" src="/js/main.js"></script>
</body>
</html>
38 changes: 38 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
*{
box-sizing: border-box;
}

html{
font-size: 62.5%;
}

body{
font-family: 'Source Code Pro', Arial, Helvetica, sans-serif;
display:flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
background: linear-gradient(0deg, rgba(117,140,179,1) 0%, rgba(171,37,112,1) 100%);
height: 100vh;
color: white;
}

h1{
font-size: 4rem;
}

h2{
font-size: 2.2rem;
}

input, button{
font-family: 'Source Code Pro', Arial, Helvetica, sans-serif;
width: 15%;
text-align: center;
font-size: 1.5rem;
}

p{
font-size: 1.8rem;
}
5 changes: 5 additions & 0 deletions data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
name: "leon",
status: "Boss Man",
currentOccupation: "Baller"
}
Binary file added img/palindrome-panic.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/sky.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>Palindrome Panic</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@300;400;500;600;700&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
</head>

<body>
<h1>Palindrome Panic</h1>
<p>Enter any word to see if it is a palindrome!</p>
<input id="userName" type="text" name="" placeholder="Enter Word">
<button id="clickMe" type="button" name="button">Is it a palindrome?</button>
<h2 id="personName"></h2>
<h2 id="personStatus"></h2>
<h2 id="personOccupation"></h2>
<script type="text/javascript" src="js/main.js"></script>
</body>

</html>
48 changes: 48 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
document.querySelector('#clickMe').addEventListener('click', isPalindrome)

function isPalindrome(){

const checkWord = document.querySelector("#userName").value;

fetch(`/api?word=${checkWord}`)
.then(response => response.json())
.then((data) => {
console.log(data);
document.querySelector("#personName").textContent = data.name
document.querySelector("#personStatus").textContent = data.status
document.querySelector("#personOccupation").textContent = data.currentOccupation
});

}

// document.getElementById("clickMe").onclick = makeReq;
//
// function makeReq(){
//
// var userName = document.getElementById("userName").value;
//
// var request = new XMLHttpRequest();
// request.open('GET', '/api?student='+userName, true);
//
// request.onload = function() {
// console.log("works")
// if (request.status >= 200 && request.status < 400) {
// // Success!
// var data = JSON.parse(request.responseText);
// console.log(data)
// document.getElementById("personName").innerHTML = data.name
// document.getElementById("personStatus").innerHTML = data.status
// document.getElementById("personOccupation").innerHTML = data.currentOccupation
//
// } else {
// // We reached our target server, but it returned an error
//
// }
// };
//
// request.onerror = function() {
// // There was a connection error of some sort
// };
//
// request.send();
// }
13 changes: 13 additions & 0 deletions node_modules/figlet/.jshintrc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/figlet/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions node_modules/figlet/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions node_modules/figlet/Gruntfile.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions node_modules/figlet/LICENSE.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading