diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcfb..1e24e1b488 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -1,15 +1,21 @@ - + - Title here + Quote generator app + -

hello there

-

-

- +
+
+ Profile picture +

waakeme--upp

+
+

+

+ +
diff --git a/Sprint-3/quote-generator/package.json b/Sprint-3/quote-generator/package.json index 0f6f989174..725f59ef64 100644 --- a/Sprint-3/quote-generator/package.json +++ b/Sprint-3/quote-generator/package.json @@ -13,5 +13,9 @@ "bugs": { "url": "https://github.com/CodeYourFuture/CYF-Coursework-Template/issues" }, - "homepage": "https://github.com/CodeYourFuture/CYF-Coursework-Template#readme" + "homepage": "https://github.com/CodeYourFuture/CYF-Coursework-Template#readme", + "devDependencies": { + "@testing-library/jest-dom": "^6.9.1", + "jest-environment-jsdom": "^30.5.2" + } } diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b722..97b77461bc 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -491,3 +491,19 @@ const quotes = [ ]; // call pickFromArray with the quotes array to check you get a random quote +function displayRandomQuote() { + const randomQuote = pickFromArray(quotes); // this is an object + // display text + let quoteDisplay = document.getElementById("quote"); + quoteDisplay.textContent = `"${randomQuote.quote}"`; + + let authorDisplay = document.getElementById("author"); + authorDisplay.textContent = `- ${randomQuote.author}`; +} + +// display quote on load +displayRandomQuote(); + +// button should recall pickFromArray +let newQuoteButton = document.getElementById("new-quote"); +newQuoteButton.addEventListener("click", displayRandomQuote); diff --git a/Sprint-3/quote-generator/style.css b/Sprint-3/quote-generator/style.css index 63cedf2d2f..33831cbd44 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1 +1,74 @@ -/** Write your CSS in here **/ +/** Write your CSS in here +quote p ==== id='quote' +author p === id='author' +button === id='new-quote' +**/ + +body { + background-image: url("tumblrbgimg.jpeg"); + background-size: contain; + background-position: center; + background-repeat: no-repeat; + background-color: #023647; + color: #030303; + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; + margin: 0; +} + +#quote-card { + backdrop-filter: blur(10px); + background-color: rgb(255, 255, 255); + border-radius: 10px; + padding: 20px 20px; + max-width: 350px; +} + +#card-header { + display: flex; + align-items: center; + gap: 10px; + margin-bottom: 15px; +} + +#profile-pic { + width: 30px; + height: 30px; + object-fit: cover; +} + +#quote { + font-family: sans-serif; + line-height: 1.4; + font-style: italic; + word-spacing: -1.5px; +} + +#author { + color: #555; + font-size: 11px; + font-weight: bold; +} + +#new-quote { + display: block; + margin-left: auto; + margin-top: 20px; + background-color: #333; + color: white; + border: none; + border-radius: 20px; + padding: 8px 16px; + font-size: 12px; + font-weight: bold; + font-family: sans-serif; + cursor: pointer; +} + +#username { + font-weight: bold; + font-size: 13px; + margin: 0; +} diff --git a/Sprint-3/quote-generator/tumblrbgimg.jpeg b/Sprint-3/quote-generator/tumblrbgimg.jpeg new file mode 100644 index 0000000000..abd5bb9c67 Binary files /dev/null and b/Sprint-3/quote-generator/tumblrbgimg.jpeg differ diff --git a/Sprint-3/quote-generator/tumblrprofile.jpg b/Sprint-3/quote-generator/tumblrprofile.jpg new file mode 100644 index 0000000000..862fd7c528 Binary files /dev/null and b/Sprint-3/quote-generator/tumblrprofile.jpg differ