From 95eac35798c69a6a28cd175d803f5ecabd527053 Mon Sep 17 00:00:00 2001
From: Ramzi Salem <50933665+ramzisalem@users.noreply.github.com>
Date: Mon, 8 Jul 2019 23:17:28 +0200
Subject: [PATCH 1/8] Update index.js
---
Week1/exercise/w1/index.js | 33 +++++++++++++++++++++++++++++----
1 file changed, 29 insertions(+), 4 deletions(-)
diff --git a/Week1/exercise/w1/index.js b/Week1/exercise/w1/index.js
index fcea7032e..290a10745 100644
--- a/Week1/exercise/w1/index.js
+++ b/Week1/exercise/w1/index.js
@@ -1,19 +1,34 @@
console.log('Hack your future Belgium!');
+function changeHeader() {
+ console.log('test');
+ header.innerHTML = 'ramzi';
+}
+const header = document.querySelector('h1');
+
+header.addEventListener('click', changeHeader);
+document.getElementById('btn-header').addEventListener('click', changeHeader);
// EXERCISE 1
-// 1a: create a function called "changeHeader", put a console.log() inside this function to test
+// 1a: create a functi[on called "changeHeader", put a console.log() inside this function to test
-// 1d: add an event listener to the "Change header" button
+// 1d: add an event listener to the "Change header" button
// and call the "changeHeader" function when clicked ( you should see your console.log() )
// 1b: inside this function: select the header element and assign that to a variable called "header"
// 1c: change the inner html of the header element to your name
-
// ====================================== //
+function changeImage() {
+ var imageInputValue = document.getElementById('imageInput');
+ var imageToChange = document.querySelector('img');
+ console.dir(imageInputValue);
+ imageToChange.src = imageInputValue.value;
+}
+
+document.getElementById('btn-changeImage').addEventListener('click', changeImage);
// EXERCISE 2
@@ -29,9 +44,19 @@ console.log('Hack your future Belgium!');
// 2e: to change the image: assign the imageInputValue to the image src
-
// ====================================== //
+function addTodo() {
+ var todolist = document.getElementById('todoList');
+ var todo_input = document.querySelector('#todoInput');
+ //the above one its the same of document.getElementById ('todoInput')
+ console.log(todoInput.value);
+ var element_li = document.createElement('li');
+ element_li.innerHTML = todo_input.value;
+ todolist.appendChild(element_li);
+}
+
+document.getElementById('btn-addTodo').addEventListener('click', addTodo);
// Exercise 3:
From 3832d7135a519502c2d2cc183e7c03c28e29a880 Mon Sep 17 00:00:00 2001
From: Ramzi Salem <50933665+ramzisalem@users.noreply.github.com>
Date: Fri, 12 Jul 2019 21:52:27 +0200
Subject: [PATCH 2/8] Update app.js
---
Week1/homework/app.js | 98 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 96 insertions(+), 2 deletions(-)
diff --git a/Week1/homework/app.js b/Week1/homework/app.js
index a9b5f75d8..df5ee07f9 100644
--- a/Week1/homework/app.js
+++ b/Week1/homework/app.js
@@ -3,9 +3,103 @@
{
const bookTitles = [
// Replace with your own book titles
- 'harry_potter_chamber_secrets',
+ 'brave_new_world',
+ 'the_moonstone',
+ 'little_women',
+ 'three_men_in_boat',
+ 'the_sign_of_four',
+ 'new_grub_street',
+ 'jude_the_obscure',
+ 'heart_of_darkness',
+ 'sister_carrie',
+ 'the_rainbow',
];
+ const bookData = {
+ brave_new_world: {
+ title: 'Brave new world',
+ author: 'Aldous Huxley',
+ language: 'English',
+ image: './images/brave_new_world.jpg',
+ },
+ the_moonstone: {
+ title: 'The moonstone',
+ author: 'Wilkie Collins',
+ language: 'Italian',
+ image: './images/the_moonstone.jpg',
+ },
+ little_women: {
+ title: 'Little women',
+ author: 'Louisa May Alcott',
+ language: 'French',
+ image: './images/little_women.jpg',
+ },
+ three_men_in_boat: {
+ title: 'Three men in a boat',
+ author: 'Jerome K Jerome',
+ language: 'English',
+ image: './images/three_men_in_boat.jpg',
+ },
+ the_sign_of_four: {
+ title: 'The sign of four',
+ author: 'Arthur Conan Doyle',
+ language: 'French',
+ image: './images/the_sign_of_four.jpg',
+ },
+ new_grub_street: {
+ title: 'New grub street',
+ author: 'George Gissing',
+ language: 'English',
+ image: './images/new_grub_street.jpg',
+ },
+ jude_the_obscure: {
+ title: 'Jude the obscure',
+ author: 'Thomas Hardy',
+ language: 'Dutch ',
+ image: './images/jude_the_obscure.jpg',
+ },
+ heart_of_darkness: {
+ title: 'Heart of darkness',
+ author: 'Joseph Conrad',
+ language: 'Turkish',
+ image: './images/heart_of_darkness.jpg',
+ },
+ sister_carrie: {
+ title: 'Sister carrie',
+ author: 'Theodore Dreiser',
+ language: 'English',
+ image: './images/sister_carrie.jpg',
+ },
+ the_rainbow: {
+ title: 'The rainbow',
+ author: 'DH Lawrence',
+ language: 'Spanish',
+ image: './images/the_rainbow.jpg',
+ },
+ };
+
// Replace with your own code
- console.log(bookTitles);
+ function book_data() {
+ const book_ul = document.createElement('ul');
+
+ for (let i in bookTitles) {
+ const book_li = document.createElement('li');
+ const book_title = document.createElement('h1');
+ const book_author = document.createElement('p');
+ const book_language = document.createElement('p');
+ const book_cover = document.createElement('img');
+ book_title.innerHTML = bookData[bookTitles[i]].title;
+ book_author.innerHTML = bookData[bookTitles[i]].author;
+ book_language.innerHTML = bookData[bookTitles[i]].language;
+ book_cover.src = bookData[bookTitles[i]].image;
+ book_li.appendChild(book_cover);
+ book_li.appendChild(book_title);
+ book_li.appendChild(book_author);
+ book_li.appendChild(book_language);
+ book_ul.appendChild(book_li);
+ }
+ document.body.appendChild(book_ul);
+ }
+
+ book_data();
}
From 6f727f4b987a2cb15a1cf01fe2ea96f56491c48f Mon Sep 17 00:00:00 2001
From: Ramzi Salem <50933665+ramzisalem@users.noreply.github.com>
Date: Fri, 12 Jul 2019 21:52:43 +0200
Subject: [PATCH 3/8] Update index.html
---
Week1/homework/index.html | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/Week1/homework/index.html b/Week1/homework/index.html
index b22147cd1..3d827503c 100644
--- a/Week1/homework/index.html
+++ b/Week1/homework/index.html
@@ -1 +1,14 @@
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+ My books list
+
+
+
+
+
From 12c1d7e1cf42f2d51d01d2fc65d3c48a11f278af Mon Sep 17 00:00:00 2001
From: Ramzi Salem <50933665+ramzisalem@users.noreply.github.com>
Date: Fri, 12 Jul 2019 21:53:10 +0200
Subject: [PATCH 4/8] Update style.css
---
Week1/homework/style.css | 36 +++++++++++++++++++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a/Week1/homework/style.css b/Week1/homework/style.css
index bab13ec23..aba0b36c4 100644
--- a/Week1/homework/style.css
+++ b/Week1/homework/style.css
@@ -1 +1,35 @@
-/* add your styling here */
\ No newline at end of file
+body {
+ width: 1440px;
+ margin: 0 auto;
+ background-color: #fafafa;
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
+}
+
+img {
+ width: 150px;
+ height: 200px;
+ position: absolute;
+}
+ul {
+ list-style: none;
+ display: flex;
+ flex-flow: wrap;
+}
+li {
+ display: flex;
+ flex-flow: wrap;
+ background-color: white;
+ flex-direction: column;
+ width: 40%;
+ position: relative;
+ margin: 50px;
+ height: 200px;
+ box-shadow: 0 0.125rem 0.1875rem 0 rgba(0, 0, 0, 0.11);
+ border: 1px solid #ededed;
+}
+
+p,
+h1 {
+ margin-left: 200px;
+ color: #585858;
+}
From dc08e4c04e950da108d8357bf24bde2164c77301 Mon Sep 17 00:00:00 2001
From: Ramzi Salem <50933665+ramzisalem@users.noreply.github.com>
Date: Sat, 13 Jul 2019 15:10:26 +0200
Subject: [PATCH 5/8] Add files via upload
---
Week1/homework/images/brave_new_world.jpg | Bin 0 -> 295272 bytes
Week1/homework/images/heart_of_darkness.jpg | Bin 0 -> 165189 bytes
Week1/homework/images/jude_the_obscure.jpg | Bin 0 -> 39026 bytes
Week1/homework/images/little_women.jpg | Bin 0 -> 47463 bytes
Week1/homework/images/new_grub_street.jpg | Bin 0 -> 54742 bytes
Week1/homework/images/sister_carrie.jpg | Bin 0 -> 41003 bytes
Week1/homework/images/the_moonstone.jpg | Bin 0 -> 359704 bytes
Week1/homework/images/the_rainbow.jpg | Bin 0 -> 792533 bytes
Week1/homework/images/the_sign_of_four.jpg | Bin 0 -> 36450 bytes
Week1/homework/images/three_men_in_boat.jpg | Bin 0 -> 41132 bytes
10 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 Week1/homework/images/brave_new_world.jpg
create mode 100644 Week1/homework/images/heart_of_darkness.jpg
create mode 100644 Week1/homework/images/jude_the_obscure.jpg
create mode 100644 Week1/homework/images/little_women.jpg
create mode 100644 Week1/homework/images/new_grub_street.jpg
create mode 100644 Week1/homework/images/sister_carrie.jpg
create mode 100644 Week1/homework/images/the_moonstone.jpg
create mode 100644 Week1/homework/images/the_rainbow.jpg
create mode 100644 Week1/homework/images/the_sign_of_four.jpg
create mode 100644 Week1/homework/images/three_men_in_boat.jpg
diff --git a/Week1/homework/images/brave_new_world.jpg b/Week1/homework/images/brave_new_world.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..e32998e8030ba07447e543c5325cdf1963de156c
GIT binary patch
literal 295272
zcmeFZRa9JEw=G(PAR%Z7T0r3hcP%so3jq=m+}+(hfdmLnaCg_j3MaU`Q-!+}?t1yZ
zfA4ed!+p4?wR?}Ww%5a~hq-EvS!=G=~QBQMEFn}Zg^(6`_%1cyK6jU@cRCEkn
z42)N=Fy3P0VB!+JB_<|%OGrpcP6r|d(vT4nQnFCe&@(VHF_M5-IauFu(7j`P_pgf}
zp`oE+pkv@;VBo(aB_w_KKYTp>1>m8hk-e-$MxqA1z(YdDLwf20kOPnaFOZR*55RvO
zsAw-y(2-vty?X98#04O|M0)WO8RaDk8agT}faqVRKmQy&v^P|o_!3{=nNH3pHd+vN50N!(S6fOx=
z{4dYpqq896Z>hQ4X?Wf{t{y8B@EV@bO42>Ye_8-wK7Zo{9x@(446qmbLHxsqm;crL
z*FE^J=it9yga3kp|3bq5^N~>fo8#R6*&r71f@PTKEV`3hcgy>)2!YFG-0*U{eGDTX
zY)XE|}oiMgQW7XPmHiK}TAgWi`c02lh-7^M)
zR)yUsB|ovI=p?NaSk&b?J{a03AcN`)FtXB?ksigni@2afY(rg~q%Zq{dcfo@ffutp
zhv*mRqS1Irc({1~M>W#CsK&92|)7}#4KI#N&7m2JmgglwuP4xmf+0d+{21F6E<0>z~t&|!XwhlPICzc6k=ntO}D*ahL`;Qmb4_A-c0&LYbhgKfbR
zz(4626y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