From 0f55c7712dc902a34aea69a5859b570fd143d177 Mon Sep 17 00:00:00 2001 From: bockarie <51052394+bockarie@users.noreply.github.com> Date: Sun, 14 Jul 2019 10:51:39 +0200 Subject: [PATCH 1/9] Update index.js --- Week1/exercise/w1/index.js | 92 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/Week1/exercise/w1/index.js b/Week1/exercise/w1/index.js index fcea7032e..03c818a4f 100644 --- a/Week1/exercise/w1/index.js +++ b/Week1/exercise/w1/index.js @@ -48,3 +48,95 @@ console.log('Hack your future Belgium!'); // 3f: set created
  • element innerHtml to todoInput value // 3g: add
  • element to todoList + + +window.onload = function(){ + console.log('Hack your future Belgium!'); + + // EXERCISE 1 + + // 1a: create a function called "changeHeader", put a console.log() inside this function to test + + /* function changeHeader() { + console.log("test 2"); + }; */ + + // 1b: inside this function: select the header element and assign that to a variable called "header" + + /* function changeHeader() { + var headerToChange = document.getElementById("myHeadChange"); + console.log(headerToChange) + }; */ + + // 1c: change the inner html of the header element to your name + + function changeHeader() { + var headerToChange = document.getElementById("myHeadChange"); + headerToChange.innerHTML = "Melrose" + }; + + // 1d: add an event listener to the "Change header" button + //and call the "changeHeader" function when clicked ( you should see your console.log() ) + //function changeHeader(); + var btn_changhead = document.getElementById("btn-changeHeader"); + btn_changhead.addEventListener("click", function(){ + changeHeader() + }); + + + // EXERCISE 2 + + // 2a: create a function called "changeImage", put a console.log() inside this function to test + function changeImage(){ + console.log("test image"); + }; + // 1b: add an event listener to the "Change image" button and call the "changeImage" function when clicked + var btn_changeImage = document.getElementById("btn-changeImage"); + btn_changeImage.addEventListener("click", function () { + changeImage() + }) + // inside this function: + + // 2c: select the "imageInput" element and assign to a variable called "imageInputValue" + function changeImage() { + var imageInputValue = "https://www.w3schools.com/w3css/img_nature_wide.jpg" + var imageToChange = document.getElementById("imageToChange"); + imageToChange.src = imageInputValue; + }; + + // 2d: select the image element and assign to a variable called "imageToChange" + //var imageToChange = + // 2e: to change the image: assign the imageInputValue to the image src + + + // Exercise 3: + + // 3a: select "add todo" button & add click event listener to execute addTodo() function on click event + var btn_addTodo = document.getElementById("btn-addTodo"); + btn_addTodo.addEventListener("click", function () { + addTodo() + }) + // 3b: define addTodo() function, in this function: + + /* function addTodo(){ + console.log("addTodo") + }; */ + +// 3c: get todoList element + var todoList = document.getElementById("todoList"); +// 3d: get todoInput element & log todoInput value + var todoInput = document.getElementById("todoInput") +// 3e: create a
  • element + var li = document.createElement("li"); +// 3f: set created
  • element innerHtml to todoInput value + li.innerHTML = todoInput.value +// 3g: add
  • element to todoList + function addTodo() { + console.log("addTodo") + li.innerHTML = todoInput.value + todoList.append(li) + }; +} +/* +// ====================================== // + */ From bd896d7650747f0dde3dd664e7fcb7c6bda03961 Mon Sep 17 00:00:00 2001 From: bockarie <51052394+bockarie@users.noreply.github.com> Date: Sun, 14 Jul 2019 10:52:10 +0200 Subject: [PATCH 2/9] Update index.html --- Week1/exercise/w1/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Week1/exercise/w1/index.html b/Week1/exercise/w1/index.html index 5a88074db..1e1a671a0 100644 --- a/Week1/exercise/w1/index.html +++ b/Week1/exercise/w1/index.html @@ -8,7 +8,7 @@ -

    Hack your future

    +

    Hack your future

    JS2 - exercise 1

    @@ -19,6 +19,7 @@

    JS2 - exercise 1

    +
    From a064fda5f22a35e8fad66305b686de54a0e760e8 Mon Sep 17 00:00:00 2001 From: bockarie <51052394+bockarie@users.noreply.github.com> Date: Sat, 20 Jul 2019 14:02:58 +0200 Subject: [PATCH 3/9] Update app.js --- Week1/homework/app.js | 113 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 2 deletions(-) diff --git a/Week1/homework/app.js b/Week1/homework/app.js index a9b5f75d8..d3f0f60d1 100644 --- a/Week1/homework/app.js +++ b/Week1/homework/app.js @@ -3,9 +3,118 @@ { const bookTitles = [ // Replace with your own book titles - 'harry_potter_chamber_secrets', + 'les_cerises_de_salomon', + 'kathrine_the_shrew', + 'autre_choix', + 'the_dog_and_the_bone', + 'six_tales_from_shakesphere', + 'fairy_tale_story', + 'she_stoop_to_conquer', + 'shylock', + 'the_owl_and_the_pussycat', + 'the_quick_brown_fox' + ]; // Replace with your own code - console.log(bookTitles); + + var newUl = document.createElement('ul') + bookTitles.forEach(book => { + var listItem = document.createElement("li"); + var itemText = document.createTextNode(book); + listItem.appendChild(itemText); + newUl.appendChild(listItem) + }) + document.body.appendChild(newUl) + //create Object of books + book1= { + title: 'les_cerises_de_salomon', + language: 'french', + Author: 'Claude Raucy', + }; + book2={ + title: 'kathrine_the_shrew', + language: 'english', + author: 'shakespeare', + }; + book3= { + title: 'autre_choix', + language: 'french', + author: 'forgot', + }; + book4= { + title: 'the_dog_and_the_bone', + language: 'english', + author: 'forgot', + } + book5={ + title: 'six_tales_from_shakespeare', + language: 'english', + author: 'shakespeare', + }; + book5= { + title: 'fairy_tale_story', + language:'english', + author: 'anonymous', + }; + book6= { + title: 'she_stoop_to_conquer', + language: 'english', + author: 'forgot', + }; + book8={ + title: 'shylock', + language: 'english', + author: 'shakespeare', + }; + book9= { + title: 'the_owl_and_the_pussycat', + language: 'english', + author: 'anonymous', + }; + book10= { + title: 'the_quick_brown_fox', + language: 'english', + author: 'anonymous', + }; + // object of images + + les_cerises_de_salomon: { + + image:'./image/les_cerises_de_salomon.jpg' + }; + + kathrine_the_shrew: { + image:'./image/ kathrine_the_shrew.jpg' + }; + + autre_choix: { + + image:'./image/autre_choix.jpg' + }; + the_dog_and_the_bone: { + image:'./image/the_dog_and_the_bone.jpg' + } + six_tales_from_shakesphere: { + image:'./image/six_tales_from_shakesphere.jpg' + } + fairy_tale_story :{ + image: './image/ fairy_tale_story.jpg' + } + she_stoops_to_conquer: { + image:'./image/she_stoops_to_conquer.jpg' + } + shylock: { + image:'./image/shylock.jpg' + } + he_owl_and_the_pussycat: { + image:'./image/the_owl_and_the_pussycat.jpg' + } + the_quick_brown_fox: { + image:'./image/the_quick_brown_fox.jpg' + + } + } + } + From 289053bfe60e70e67959961157efef8efc6716e4 Mon Sep 17 00:00:00 2001 From: bockarie <51052394+bockarie@users.noreply.github.com> Date: Sat, 20 Jul 2019 14:19:03 +0200 Subject: [PATCH 4/9] Update style.css --- Week1/homework/style.css | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Week1/homework/style.css b/Week1/homework/style.css index bab13ec23..4aabb0c0b 100644 --- a/Week1/homework/style.css +++ b/Week1/homework/style.css @@ -1 +1,24 @@ -/* add your styling here */ \ No newline at end of file +/* add your styling here */ + +.mainContainer{ display: flex; + flex-direction: column; +} + + + .itemsContainer{ + display: flex; + flex-wrap: wrap; + margin: 5px; + font-size: 15px; + +} +.item{ + margin: 10px; + width: 300px; + +} +#title{ + text-align: center; + font-family: 'Times New Roman', Times, serif; + font-size: 15px; +} From 500a3126e721fd2187e04002d6b1073dd65461a5 Mon Sep 17 00:00:00 2001 From: bockarie <51052394+bockarie@users.noreply.github.com> Date: Sat, 20 Jul 2019 14:20:59 +0200 Subject: [PATCH 5/9] Update index.html --- Week1/homework/index.html | 91 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/Week1/homework/index.html b/Week1/homework/index.html index b22147cd1..55e388448 100644 --- a/Week1/homework/index.html +++ b/Week1/homework/index.html @@ -1 +1,90 @@ - \ No newline at end of file + + + + + + + + Document + +
    +
    +
    +
    +

    les cerries de salomon

    + book1 +
    +
    +
    +
    +

    kathrine the shrew

    + book2 +
    +
    +
    +
    +

    autre choix

    + book3 +
    +
    +
    +
    +

    the dog and the bone

    + book4 +
    +
    +
    +
    +

    six tales from shakesphere

    + book5 +
    +
    +
    +
    +

    fairy tale story

    + book6 +
    +
    +
    +
    +

    she stoops to conquer

    + book7 +
    +
    +
    +
    +

    shylock

    + book8 +
    +
    +
    +
    +

    the owl and the pussycat

    + book9 +
    +
    +
    +
    +

    the quick brown fox

    + book10 +
    +
    + +
    + + + + From 7bf70a94569d0c0ae63d3c8cc49c7f6a7129c419 Mon Sep 17 00:00:00 2001 From: bockarie <51052394+bockarie@users.noreply.github.com> Date: Sat, 20 Jul 2019 14:21:48 +0200 Subject: [PATCH 6/9] Update index.html --- Week1/homework/index.html | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/Week1/homework/index.html b/Week1/homework/index.html index 55e388448..9542d3211 100644 --- a/Week1/homework/index.html +++ b/Week1/homework/index.html @@ -74,17 +74,6 @@

    the quick brown fox

    From dcd5ec90db2f11b5e978079c10919e75925fd655 Mon Sep 17 00:00:00 2001 From: bockarie <51052394+bockarie@users.noreply.github.com> Date: Sun, 21 Jul 2019 00:46:09 +0200 Subject: [PATCH 7/9] Update maartjes-work.js --- Week2/homework/maartjes-work.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Week2/homework/maartjes-work.js b/Week2/homework/maartjes-work.js index 49772eb44..118db6067 100644 --- a/Week2/homework/maartjes-work.js +++ b/Week2/homework/maartjes-work.js @@ -46,7 +46,14 @@ const maartjesTasks = monday.concat(tuesday); const maartjesHourlyRate = 20; function computeEarnings(tasks, hourlyRate) { - // Replace this comment and the next line with your code + // create variables of duration and task for monday + +let duration = ['180', '120','20','200'] +let task = [ 'Write a summary HTML/CSS','Some web development','Fix homework for class10','Talk to a lot of people'] + } +}); + + console.log(tasks, hourlyRate); } From f4cda1687be0c908b394a729fa832a0d2fb9be0f Mon Sep 17 00:00:00 2001 From: bockarie <51052394+bockarie@users.noreply.github.com> Date: Sun, 21 Jul 2019 00:57:58 +0200 Subject: [PATCH 8/9] Update map-filter.js --- Week2/homework/map-filter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Week2/homework/map-filter.js b/Week2/homework/map-filter.js index c8e8a88c1..44d27187b 100644 --- a/Week2/homework/map-filter.js +++ b/Week2/homework/map-filter.js @@ -1,7 +1,8 @@ 'use strict'; function doubleOddNumbers(numbers) { - // Replace this comment and the next line with your code + // call function + doubleOddNumber(numbers) console.log(numbers); } From f1d3c03d236e4bf8ee3f30c09b559aa6aab11510 Mon Sep 17 00:00:00 2001 From: bockarie <51052394+bockarie@users.noreply.github.com> Date: Tue, 23 Jul 2019 00:13:26 +0200 Subject: [PATCH 9/9] Update index.js --- Week1/exercise/w1/index.js | 51 -------------------------------------- 1 file changed, 51 deletions(-) diff --git a/Week1/exercise/w1/index.js b/Week1/exercise/w1/index.js index 03c818a4f..07d5a5b6f 100644 --- a/Week1/exercise/w1/index.js +++ b/Week1/exercise/w1/index.js @@ -1,54 +1,3 @@ -console.log('Hack your future Belgium!'); - -// EXERCISE 1 - -// 1a: create a function called "changeHeader", put a console.log() inside this function to test - -// 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 - - -// ====================================== // - - -// EXERCISE 2 - -// 2a: create a function called "changeImage", put a console.log() inside this function to test - -// 1b: add an event listener to the "Change image" button and call the "changeImage" function when clicked - -// inside this function: - -// 2c: select the "imageInput" element and assign to a variable called "imageInputValue" - -// 2d: select the image element and assign to a variable called "imageToChange" - -// 2e: to change the image: assign the imageInputValue to the image src - - -// ====================================== // - - -// Exercise 3: - -// 3a: select "add todo" button & add click event listener to execute addTodo() function on click event - -// 3b: define addTodo() function, in this function: - -// 3c: get todoList element - -// 3d: get todoInput element & log todoInput value - -// 3e: create a
  • element - -// 3f: set created
  • element innerHtml to todoInput value - -// 3g: add
  • element to todoList - window.onload = function(){ console.log('Hack your future Belgium!');