Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package-lock.json
/node_modules
38 changes: 13 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
Assignment 4 - Components
===
## Morgan's text OwO-ifier
Link: https://a4-patrick-lee22.herokuapp.com/

Due: October 4th, by 11:59 AM.
This application is designed to take user input and then convert it into "OwO speak." The specific regex rules implemented on the user messages have these effects:

For this assignment you will re-implement the client side portion of *either* A2 or A3 using either React or Svelte components. If you choose A3 you only need to use components for the data display / updating; you can leave your login UI as is.
1. All 'L' or 'R' characters are replaced with 'W' characters, case sensitive.
2. All 'N' characters followed by a vowell are replaced with 'Ny', also case sensitive.
3. All '!' characters are replaced with a text face randomly selected from a predetermined list of faces.

[Svelte Tutorial](https://github.com/cs4241-21a/cs4241-21a.github.io/blob/main/using_svelte.md)
[React Tutorial](https://github.com/cs4241-21a/cs4241-21a.github.io/blob/main/using_react.md)
The resulting data from this transformation can be viewed in a table or in a sentence form, at the user's preference. The options for which view is currently active are at the top of the page.

This project can be implemented on any hosting service (Glitch, DigitalOcean, Heroku etc.), however, you must include all files in your GitHub repo so that the course staff can view them.
The layout for this page was set up using flexboxes.

Deliverables
---
## Changes for Assignment 4
For this assignment, all elements displaying user data and the button used for submission were retooled using React components. It should have the exact same functionality as it did in assignment 2 (as listed above), the primary difference in using this new development framework was the headache I developed while refactoring the code.

Do the following to complete this assignment:
I did not enjoy using React. My problems with React as a framework mostly boil down to my personal preferences when coding and trying my best to preserve the code base as it already existed, which was a challenge. I found out, to my dismay, that I could not update the state of a React component from another function. The only way to set the state of a React component is to do so via an internal method, and the only way these internal methods can be called is via a browser event, originating from a react component. So, this is why the submit button is now part of a React component, along with all of the code to fetch the appdata.

1. Implement your project with the above requirements.
3. Test your project to make sure that when someone goes to your main page on Glitch/Heroku/etc., it displays correctly.
4. Ensure that your project has the proper naming scheme `a4-firstname-lastname` so we can find it.
5. Fork this repository and modify the README to the specifications below. Be sure to add *all* project files.
6. Create and submit a Pull Request to the original repo. Name the pull request using the following template: `a4-firstname-lastname`.
I originally wished to use React to generate similar blocks of HTML on the fly whenever I needed to insert a new element into the page. I ended up completely changing the structure of my code, and what resulted was a more complicated, somewhat less readable application. I understand the power this framework has. I will probably use this framework again at some point in the future. That fact brings me great pain.

Sample Readme (delete the above when you're ready to submit, and modify the below so with your links and descriptions)
---

## Your Web Application Title

your hosting link e.g. http://a4-charlieroberts.glitch.me

Include a very brief summary of your project here and what you changed / added to assignment #3. Briefly (3–4 sentences) answer the following question: did the new technology improve or hinder the development experience?

Unlike previous assignments, this assignment will be solely graded on whether or not you successfully complete it. Partial credit will be generously given.
PS: To anyone looking at my commit history, I'm fine, I swear. I'm just a bit overdramatic and I like documenting my pain in the commit messages.
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "a4-components",
"version": "1.0.0",
"description": "This application is designed to take user input and then convert it into \"OwO speak.\" The specific regex rules implemented on the user messages have these effects:",
"main": "server.improved.js",
"dependencies": {
"babel-cli": "^6.26.0",
"babel-preset-react-app": "^3.1.2",
"mime": "^2.5.2"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.improved.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/patrick-lee22/a4-components.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/patrick-lee22/a4-components/issues"
},
"homepage": "https://github.com/patrick-lee22/a4-components#readme"
}
72 changes: 72 additions & 0 deletions public/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*Style your own assignment! This is fun! */
th,td,p,b,input,button {
font-family: 'Courier Prime', monospace;
font-size: large;
}

button {
cursor:pointer;
}

a {
font-family: 'Courier Prime', monospace;
font-size: x-large;
}

.root {
display: flex;
flex-direction: row;
align-content: center;
}

#sentence-root{
display: none;
}

th, td {
border:#333;
border-width: 1px;
border-style: solid;
padding: 1em;
}

p {
border: #333;
border-width: 1px;
border-style: solid;
margin-right: 1em;
padding-left: 5px;
padding-right:5px;
padding-top: 2px;
padding-bottom: 2px;
}

b {
border: #333;
border-width: 1px;
border-bottom: solid;
border-top:hidden;
border-left:hidden;
border-right:hidden;
display: flex;
justify-content: center;
padding-left: 5px;
padding-right:5px;
padding-top: 2px;
padding-bottom: 2px;
}

table {
margin-top:.5em;
}

form {
display:flex;
flex-direction: column;
margin-top: 1em;
margin-bottom: 1em;
}

input {
margin-bottom: 1em;
}
28 changes: 28 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!doctype html>
<html lang="en">

<head>
<title>CS4241 Assignment 2</title>
<script src="https://fb.me/react-0.14.3.min.js"></script>
<script src="https://fb.me/react-dom-0.14.3.min.js"></script>
<script type='text/javascript' src='/js/new_elements.js'></script>
<script type='text/javascript' src='/js/scripts.js'></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime&display=swap');
</style>
<link rel='stylesheet' href='/css/style.css'>
<meta charset="utf-8">
</head>

<body>
<nav>
<a id='table-nav' href='#'>Table View</a> | <a id='sentence-nav' href='#'>Sentence View</a>
</nav>
<form action="">
<input type='text' id='name' value="your name here" />
<input type='text' id='target-text' value="Type something here!" />
</form>
<div id='main-body-container'></div>
</body>

</html>
Loading