diff --git a/.gitignore b/.gitignore index 6c589c2f8..abf8b81c6 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,7 @@ typings/ .netlify dist/ +live + exercise + live2 + \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 91171c0fe..d959d3ad6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,10 +8,12 @@ "Debouncing", "Maartje", "blabla", + "chinua", "codewars", "keyup", "maartje's", "maartjes", + "marner", "roverjs", "taalmap", "trollface" diff --git a/Week1/homework/app.js b/Week1/homework/app.js index 6131f54ea..8fcf0c39b 100644 --- a/Week1/homework/app.js +++ b/Week1/homework/app.js @@ -2,10 +2,121 @@ { const bookTitles = [ - // Replace with your own book titles - 'harry_potter_chamber_secrets' + 'So_Long_A_Letter', + 'Macbeth', + 'Julius_Caesar', + 'Silas_Marner', + 'The_Gods_Are_Not_To_Blame', + 'Things_Fall_Apart', + 'Database_Processing', + 'JavaScript_For_Web_Developers', + 'Installing_And_Configuring_Windows_10', + 'Installing_And_Configuring_Windows_Server_2012_R2' ]; - // Replace with your own code - console.log(bookTitles); + const booksInformation = { + So_Long_A_Letter: { + title: 'So Long A Letter', + language: 'French', + author: 'Mariama Ba' + }, + Macbeth: { + title: 'Macbeth', + language: 'English', + author: 'William Shakespeare' + }, + Julius_Caesar: { + title: 'Julius Caesar', + language: 'English', + author: 'William Shakespeare' + }, + Silas_Marner: { + title: 'Silas Marner', + language: 'English', + author: 'George Eliot' + }, + The_Gods_Are_Not_To_Blame: { + title: 'The Gods Are Not To Blame', + language: 'English', + author: 'Ola Rotimi' + }, + Things_Fall_Apart: { + title: 'Things Fall Apart', + language: 'English', + author: 'Chinua Achebe' + }, + Database_Processing: { + title: 'Database Processing', + language: 'English', + author: 'David Kroenke' + }, + JavaScript_For_Web_Developers: { + title: 'JavaScript For Web Developers', + language: 'English', + author: 'Nicholas C. Zakas' + }, + Installing_And_Configuring_Windows_10: { + title: 'Installing And Configuring Windows 10', + language: 'English', + author: 'Andrew Bettany' + }, + Installing_And_Configuring_Windows_Server_2012_R2: { + title: 'Installing And Configuring Windows Server 2012 R2', + language: 'English', + author: 'Craig Zacker' + } + }; + + function createList() { + const ul = document.createElement('ul'); + document.body.appendChild(ul); + for (const bookTitle of bookTitles) { + const li = document.createElement('li'); + ul.appendChild(li); + li.setAttribute('id', bookTitle); + const bookInfo = booksInformation[bookTitle]; + + const h2 = document.createElement('h2'); + li.appendChild(h2); + h2.textContent = bookInfo.title; + + const h3 = document.createElement('h3'); + li.appendChild(h3); + h3.textContent = bookInfo.language; + + const p = document.createElement('p'); + li.appendChild(p); + p.textContent = bookInfo.author; + } + } + + const bookCovers = { + So_Long_A_Letter: './images/So_Long_A_Letter.jpeg', + Macbeth: './images/Macbeth.jpeg', + Julius_Caesar: './images/Julius_Caesar.jpeg', + Silas_Marner: './images/Silas_Marner.jpeg', + The_Gods_Are_Not_To_Blame: './images/The_Gods_Are_Not_To_Blame.jpeg', + Things_Fall_Apart: './images/Things_Fall_Apart.jpeg', + Database_Processing: './images/Database_Processing.jpg', + JavaScript_For_Web_Developers: './images/JavaScript_For_Web_Developers.jpeg', + Installing_And_Configuring_Windows_10: './images/Installing_And_Configuring_Windows_10.jpg', + Installing_And_Configuring_Windows_Server_2012_R2: + './images/Installing_And_Configuring_Windows_Server_2012.jpg' + }; + + function displayBooks() { + for (const key of Object.keys(bookCovers)) { + const li = document.getElementById(key); + const img = document.createElement('img'); + li.appendChild(img); + img.setAttribute('src', `${bookCovers[key]}`); + img.setAttribute('alt', `${bookCovers[key]}`); + } + } + + function main() { + createList(); + displayBooks(); + } + window.onload = main; } diff --git a/Week1/homework/images/Background_image.jpeg b/Week1/homework/images/Background_image.jpeg new file mode 100644 index 000000000..1b8253d4a Binary files /dev/null and b/Week1/homework/images/Background_image.jpeg differ diff --git a/Week1/homework/images/Database_Processing.jpg b/Week1/homework/images/Database_Processing.jpg new file mode 100644 index 000000000..da4e3d2c9 Binary files /dev/null and b/Week1/homework/images/Database_Processing.jpg differ diff --git a/Week1/homework/images/Installing_And_Configuring_Windows_10.jpg b/Week1/homework/images/Installing_And_Configuring_Windows_10.jpg new file mode 100644 index 000000000..60de8dda8 Binary files /dev/null and b/Week1/homework/images/Installing_And_Configuring_Windows_10.jpg differ diff --git a/Week1/homework/images/Installing_And_Configuring_Windows_Server_2012.jpg b/Week1/homework/images/Installing_And_Configuring_Windows_Server_2012.jpg new file mode 100644 index 000000000..d41453268 Binary files /dev/null and b/Week1/homework/images/Installing_And_Configuring_Windows_Server_2012.jpg differ diff --git a/Week1/homework/images/JavaScript_For_Web_Developers.jpeg b/Week1/homework/images/JavaScript_For_Web_Developers.jpeg new file mode 100644 index 000000000..a15d23bc4 Binary files /dev/null and b/Week1/homework/images/JavaScript_For_Web_Developers.jpeg differ diff --git a/Week1/homework/images/Julius_Caesar.jpeg b/Week1/homework/images/Julius_Caesar.jpeg new file mode 100644 index 000000000..bbc29918e Binary files /dev/null and b/Week1/homework/images/Julius_Caesar.jpeg differ diff --git a/Week1/homework/images/Macbeth.jpeg b/Week1/homework/images/Macbeth.jpeg new file mode 100644 index 000000000..43a575a8f Binary files /dev/null and b/Week1/homework/images/Macbeth.jpeg differ diff --git a/Week1/homework/images/Silas_Marner.jpeg b/Week1/homework/images/Silas_Marner.jpeg new file mode 100644 index 000000000..25599b65a Binary files /dev/null and b/Week1/homework/images/Silas_Marner.jpeg differ diff --git a/Week1/homework/images/So_Long_A_Letter.jpeg b/Week1/homework/images/So_Long_A_Letter.jpeg new file mode 100644 index 000000000..79d4027b0 Binary files /dev/null and b/Week1/homework/images/So_Long_A_Letter.jpeg differ diff --git a/Week1/homework/images/The_Gods_Are_Not_To_Blame.jpeg b/Week1/homework/images/The_Gods_Are_Not_To_Blame.jpeg new file mode 100644 index 000000000..4f2d25539 Binary files /dev/null and b/Week1/homework/images/The_Gods_Are_Not_To_Blame.jpeg differ diff --git a/Week1/homework/images/Things_Fall_Apart.jpeg b/Week1/homework/images/Things_Fall_Apart.jpeg new file mode 100644 index 000000000..87013e0a7 Binary files /dev/null and b/Week1/homework/images/Things_Fall_Apart.jpeg differ diff --git a/Week1/homework/index.html b/Week1/homework/index.html index b22147cd1..2cea4a507 100644 --- a/Week1/homework/index.html +++ b/Week1/homework/index.html @@ -1 +1,14 @@ - \ No newline at end of file + + + + + + + + JavaScript2 Week1 + + + + + + diff --git a/Week1/homework/style.css b/Week1/homework/style.css index bab13ec23..50a9d5405 100644 --- a/Week1/homework/style.css +++ b/Week1/homework/style.css @@ -1 +1,26 @@ -/* add your styling here */ \ No newline at end of file +body { + background-color: #8fbc8f; + width: auto; + padding: 10%; + display: flex; +} + +img { + width: 45%; + border-radius: 10%; +} + +ul { + text-decoration-style: none; +} + +li { + list-style: none; + font-size: 120%; + font-weight: bold; +} + +p { + font-style: italic; + color: grey; +} diff --git a/Week2/live2/forEach.js b/Week2/live2/forEach.js new file mode 100644 index 000000000..87631f55b --- /dev/null +++ b/Week2/live2/forEach.js @@ -0,0 +1,10 @@ +'use strict'; + +const numbers = [1, 2, 3, 4]; + +let sum = 0; +for (const number of numbers) { + sum += number; +} + +console.log(sum);