forked from TechStarHub/quotes
-
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.
- Loading branch information
1 parent
ed40359
commit 7abb537
Showing
8 changed files
with
239 additions
and
18 deletions.
There are no files selected for viewing
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
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,5 +1,67 @@ | ||
*{ | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
} | ||
@import url("https://fonts.googleapis.com/css2?family=Irish+Grover&display=swap"); | ||
@import url("https://fonts.googleapis.com/css2?family=Inria+Sans:wght@300&family=Irish+Grover&display=swap"); | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
background: #164863; | ||
} | ||
.quoteLogo { | ||
color: #fff; | ||
font-family: Irish Grover; | ||
font-size: 3.75rem; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: normal; | ||
margin-left: 2vh; | ||
} | ||
.quoteButton { | ||
width: 6rem; | ||
height: 2rem; | ||
flex-shrink: 0; | ||
color: #fff; | ||
|
||
border-radius: 0.2875rem; | ||
border: 2px solid #164863; | ||
background: #427d9d; | ||
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25); | ||
} | ||
.quote { | ||
display: flex; | ||
width: 47.9375rem; | ||
height: 9.375rem; | ||
flex-direction: column; | ||
justify-content: center; | ||
flex-shrink: 0; | ||
|
||
color: #fff; | ||
text-align: center; | ||
font-family: Inria Sans; | ||
font-size: 3.75rem; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: normal; | ||
} | ||
.quoteAuthor { | ||
color: #fff; | ||
text-align: center; | ||
font-family: Inria Sans; | ||
font-size: 2rem; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: normal; | ||
margin-left: 30vh; | ||
} | ||
|
||
.content { | ||
margin-top: 15vh; | ||
display: flex; | ||
justify-content: space-around; | ||
align-items: center; | ||
flex-direction: column; | ||
height: 50vh; | ||
} | ||
|
||
quoteSymboll { | ||
background: contain no-repeat; | ||
} |
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,44 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import axios from "axios"; | ||
import quoteRight from '../quote1.svg' | ||
import quoteLeft from '../quote2.svg' | ||
export default function Home() { | ||
|
||
const [quotes, setquotes] = useState([]); | ||
useEffect(() => { | ||
axios.get('http://localhost:8000/rand') | ||
.then(response => { | ||
setquotes(response.data.quote); | ||
}) | ||
.catch(error => { | ||
console.log(error); | ||
}); | ||
}, []); | ||
const HandleClick = () => { | ||
axios.get('http://localhost:8000/rand') | ||
.then(response => { | ||
setquotes(response.data.quote); | ||
}) | ||
.catch(error => { | ||
console.log(error); | ||
}); | ||
|
||
} | ||
const quote = quotes.quoteText | ||
const quoteAuthor = quotes.quoteAuthor | ||
|
||
return <div> | ||
<div className="quoteLogo">Quote</div> | ||
<div className="content"> | ||
|
||
<div className="quote"> | ||
<span className="quoteSymboll"> | ||
<img src={quoteRight} alt="" /> {quote} <img src={quoteLeft} alt="" /> | ||
</span> | ||
</div> | ||
<div className="quoteSymboll"></div> | ||
<div className="quoteAuthor"> - {quoteAuthor}</div> | ||
<button type="button" className="quoteButton" onClick={() => HandleClick()}>GET QUOTE</button> | ||
</div> | ||
</div>; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.