-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
just testing for seeing if cloudflare changes
- Loading branch information
1 parent
790b445
commit 3685317
Showing
11 changed files
with
198 additions
and
56 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,23 @@ | ||
.App { | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", | ||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
background: linear-gradient( | ||
to left, | ||
rgba(7, 27, 82, 1) 0%, | ||
rgba(0, 128, 128, 1) 100% | ||
); | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
} | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
.app-title { | ||
margin: 50px; | ||
font-size: 120px; | ||
color: #0ccac4; | ||
font-family: "Bigelow Rules"; | ||
letter-spacing: 7.5px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,55 @@ | ||
import logo from './logo.svg'; | ||
import './App.css'; | ||
|
||
function App() { | ||
return ( | ||
<div className="App"> | ||
<header className="App-header"> | ||
<img src={logo} className="App-logo" alt="logo" /> | ||
<p> | ||
Edit <code>src/App.js</code> and save to reload. | ||
</p> | ||
<a | ||
className="App-link" | ||
href="https://reactjs.org" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Learn React | ||
</a> | ||
</header> | ||
</div> | ||
); | ||
import { Component } from "react"; | ||
|
||
import Cardlist from "./components/card-list/card-list.component"; | ||
import "./App.css"; | ||
import SearchBox from "./components/search-box/search-box.component"; | ||
|
||
class App extends Component { | ||
constructor() { | ||
super(); | ||
|
||
this.state = { | ||
monsters: [], | ||
searchField: "", | ||
}; | ||
} | ||
|
||
componentDidMount() { | ||
fetch("https://jsonplaceholder.typicode.com/users").then((response) => | ||
response.json().then((users) => | ||
this.setState(() => { | ||
return { monsters: users }; | ||
}) | ||
) | ||
); | ||
} // Mounting is the first time when a application gets rendered onto the dom. | ||
|
||
onSearchChange = (event) => { | ||
const searchField = event.target.value.toLowerCase(); | ||
this.setState(() => { | ||
return { searchField }; | ||
}); | ||
}; | ||
|
||
render() { | ||
const { monsters, searchField } = this.state; | ||
const { onSearchChange } = this; | ||
|
||
const filteredMonsters = this.state.monsters.filter((monster) => { | ||
return monster.name.toLowerCase().includes(this.state.searchField); | ||
}); | ||
return ( | ||
<div className="App"> | ||
<h1 className="app-title">Monster Filter</h1> | ||
<SearchBox | ||
onChangeHandler={onSearchChange} | ||
placeHolder="Search Monsters" | ||
className="monstersSearchBox" | ||
/> | ||
<Cardlist monsters={filteredMonsters} /> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { computeHeadingLevel } from "@testing-library/react"; | ||
import { Component } from "react"; | ||
import Card from "../card/card.component"; | ||
import "./card-list.styles.css"; | ||
|
||
class Cardlist extends Component { | ||
render() { | ||
const { monsters } = this.props; | ||
|
||
return ( | ||
<div className="card-list"> | ||
{monsters.map((monsters) => { | ||
return <Card monsterProp={monsters} />; | ||
})} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Cardlist; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.card-list { | ||
width: 85vw; | ||
margin: 0 auto; | ||
display: grid; | ||
grid-template-columns: 1fr 1fr 1fr 1fr; | ||
grid-gap: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Component } from "react"; | ||
|
||
import "./card.styles.css"; | ||
|
||
class Card extends Component { | ||
render() { | ||
const { id, name, email } = this.props.monsterProp; | ||
return ( | ||
<div className="card-container" key={id}> | ||
<img | ||
alt={`monster ${name}`} | ||
src={`https://robohash.org/${id}?set=set2&size=180x180`} | ||
/> | ||
<h2>{name}</h2> | ||
<p>{email}</p> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Card; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.card-container { | ||
display: flex; | ||
flex-direction: column; | ||
background-color: #95dada; | ||
border: 1px solid grey; | ||
border-radius: 5px; | ||
padding: 25px; | ||
cursor: pointer; | ||
-moz-osx-font-smoothing: grayscale; | ||
backface-visibility: hidden; | ||
transform: translateZ(0); | ||
transition: transform 0.25s ease-out; | ||
} | ||
|
||
.card-container:hover { | ||
transform: scale(1.05); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Component } from "react"; | ||
import "./search-box.styles.css"; | ||
|
||
class SearchBox extends Component { | ||
render() { | ||
return ( | ||
<div> | ||
<input | ||
className={`search-box ${this.props.className}`} | ||
type="search" | ||
placeholder={this.props.placeHolder} | ||
onChange={this.props.onChangeHandler} | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default SearchBox; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.search-box { | ||
-webkit-appearance: none; | ||
border: none; | ||
outline: none; | ||
padding: 10px; | ||
width: 150px; | ||
line-height: 30px; | ||
margin-bottom: 30px; | ||
} |