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
11 changes: 5 additions & 6 deletions Sprint-1/implement/dedupe.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Dedupe Array

In this kata, you will need to deduplicate the elements of an array

E.g. dedupe(['a','a','a','b','b','c']) returns ['a','b','c']
E.g. dedupe([5, 1, 1, 2, 3, 2, 5, 8]) returns [5, 1, 2, 3, 8]
E.g. dedupe([1, 2, 1]) returns [1, 2]
E.g. dedupe(['a','a','a','b','b','c']) target output: ['a','b','c']
E.g. dedupe([5, 1, 1, 2, 3, 2, 5, 8]) target output: [5, 1, 2, 3, 8]
E.g. dedupe([1, 2, 1]) target output: [1, 2]
*/

// Acceptance Criteria:
Expand All @@ -22,7 +22,6 @@ test.todo("given an empty array, it returns an empty array");
// When passed to the dedupe function
// Then it should return a copy of the original array

// Given an array of strings or numbers
// Given an array with strings or numbers
// When passed to the dedupe function
// Then it should return a new array with duplicates removed while preserving the
// first occurrence of each element from the original array.
// Then it should remove the duplicate values, preserving the first occurence of each element
19 changes: 13 additions & 6 deletions Sprint-3/quote-generator/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Title here</title>
<title>Quote Generator</title>
<link rel="stylesheet" href="style.css" />
<script defer src="quotes.js"></script>
</head>
<body>
<h1>hello there</h1>
<p id="quote"></p>
<p id="author"></p>
<button type="button" id="new-quote">New quote</button>
<div class="container">
<h1>Quote Generator</h1>

<div class="quote-box">
<p id="quote"></p>
<p id="author"></p>
</div>

<button type="button" id="new-quote">New quote</button>
</div>
</body>
</html>
13 changes: 13 additions & 0 deletions Sprint-3/quote-generator/quotes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
const quoteP = document.querySelector("#quote");
const authorP = document.querySelector("#author");
const button = document.querySelector("#new-quote");

function displayQuote() {
const randomQuote = pickFromArray(quotes);
quoteP.innerText = randomQuote.quote;
authorP.innerText = randomQuote.author;
}

button.addEventListener("click", displayQuote);

// DO NOT EDIT BELOW HERE

// pickFromArray is a function which will return one item, at
Expand Down Expand Up @@ -491,3 +503,4 @@ const quotes = [
];

// call pickFromArray with the quotes array to check you get a random quote
displayQuote();
88 changes: 87 additions & 1 deletion Sprint-3/quote-generator/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,87 @@
/** Write your CSS in here **/
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Poppins", Arial, sans-serif;
}

body {
height: 100vh;
background: linear-gradient(135deg, #fbc2eb, #a6c1ee);
display: flex;
justify-content: center;
align-items: center;
}

.container {
position: relative;
width: 90%;
max-width: 520px;
height: 360px;

background: rgba(255, 255, 255, 0.75);
backdrop-filter: blur(10px);

border-radius: 24px;
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);

display: flex;
flex-direction: column;
padding: 25px;
}

h1 {
text-align: center;
font-size: 1.6rem;
color: #6d5dfc;
font-weight: 600;
letter-spacing: 1px;
}

.quote-box {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;

text-align: center;
}

#quote {
font-size: 1.3rem;
color: #333;
line-height: 1.6;
font-style: italic;
padding: 0 10px;
}

#author {
margin-top: 12px;
font-size: 0.95rem;
color: #7a7a7a;
}

#new-quote {
position: absolute;
bottom: 18px;
right: 18px;

background: linear-gradient(135deg, #ff9a9e, #fad0c4);
color: white;
border: none;

padding: 10px 16px;
border-radius: 50px;

cursor: pointer;
font-weight: 500;

box-shadow: 0 6px 15px rgba(255, 154, 158, 0.4);
transition: all 0.3s ease;
}

#new-quote:hover {
transform: translateY(-2px) scale(1.05);
box-shadow: 0 10px 20px rgba(255, 154, 158, 0.5);
}