Skip to content

London | 25-ITP-May | Emiliano Uruena | DG_Sprint 3 | Quote-Generator #633

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

Open
wants to merge 2 commits into
base: main
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Sprint-3/quote-generator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Title here</title>
<title>Quote generator app</title>
<link rel="stylesheet" href="style.css">
<script defer src="quotes.js"></script>
</head>
<body>
<h1>hello there</h1>
<h1>Quote generator app</h1>
<p id="quote"></p>
<p id="author"></p>
<button type="button" id="new-quote">New quote</button>
Expand Down
19 changes: 19 additions & 0 deletions Sprint-3/quote-generator/quotes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@

window.onload = setup;
function setup(){
document.getElementById("new-quote").addEventListener("click", function() {
newQuote();
});
newQuote()
}
// const newQuoteBtn = document.querySelector("#new-quote");

function newQuote(){
const quoteP = document.querySelector("#quote");
const authorP = document.querySelector("#author");
let quoteToShow = {}
quoteToShow = pickFromArray(quotes)
quoteP.innerText = quoteToShow.quote
authorP.innerText = quoteToShow.author
}

// DO NOT EDIT BELOW HERE

// pickFromArray is a function which will return one item, at
Expand Down
46 changes: 45 additions & 1 deletion Sprint-3/quote-generator/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,45 @@
/** Write your CSS in here **/
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {

background-color:black;
font-family:'Press Start 2P', monospace;
color: lawngreen;
display: flex;
flex-direction:column;
justify-content: center;
align-items: center;
text-align: center;
padding: 50px;
}
h1 {
font-size: 1rem;
margin-bottom: 30px;
color:yellow;
}
#quote {
font-size: 2rem;
max-width: 90vw;
margin-bottom: 40px;
line-height: 2.5rem;
}
#author{
font-size: 1rem;
width: 100%;
text-align: right;
margin-bottom: 50px;
padding-right: 1vw;
color: magenta;
}
button {
font-family: 'Press Start 2P', monospace;
font-size: 1rem;
padding: 1rem 2rem;
border: 3px solid cyan;
background-color: black;
color: cyan;
cursor: pointer;
text-transform: uppercase;
box-shadow: 4px 4px 0 cyan;

}