From 2357abb522c783d7f13f47ae640b96c1bfdd620b Mon Sep 17 00:00:00 2001 From: Amatullah Brown Date: Mon, 28 Dec 2020 21:31:24 -0500 Subject: [PATCH 01/12] added js-dom.html --- js-dom.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 js-dom.html diff --git a/js-dom.html b/js-dom.html new file mode 100644 index 0000000..ef9ae45 --- /dev/null +++ b/js-dom.html @@ -0,0 +1,12 @@ + + + + + + Document + + +

+

+ + \ No newline at end of file From debd365007f5f5881119a4c72dd9cdd8c07cc1cc Mon Sep 17 00:00:00 2001 From: Amatullah Brown Date: Mon, 28 Dec 2020 21:56:03 -0500 Subject: [PATCH 02/12] added image --- js-dom.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/js-dom.html b/js-dom.html index ef9ae45..d8915ec 100644 --- a/js-dom.html +++ b/js-dom.html @@ -8,5 +8,19 @@

+ \ No newline at end of file From 1afac284e9fc87372f3cc7fa2dc2cb25c683f4e0 Mon Sep 17 00:00:00 2001 From: Amatullah Brown Date: Mon, 28 Dec 2020 22:01:29 -0500 Subject: [PATCH 03/12] changed color and font size --- js-dom.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/js-dom.html b/js-dom.html index d8915ec..3c54de4 100644 --- a/js-dom.html +++ b/js-dom.html @@ -13,7 +13,7 @@ let newp = document.createTextNode("We are coders!"); let pContent = document.getElementsByTagName("p"); for (let i=0; i element and change its text to "Developers for life!" document.getElementById("p1").textContent = "Developers for life!"; @@ -21,6 +21,15 @@ let img = document.createElement("img"); img.src = "https://helpx.adobe.com/content/dam/help/en/stock/how-to/visual-reverse-image-search/jcr_content/main-pars/image/visual-reverse-image-search-v2_intro.jpg"; document.getElementsByTagName("body")[0].appendChild(img); + // change the color of the text + pContent = document.getElementsByTagName("p"); + for (let i=0; i to 40px + document.getElementById("p1").style.fontSize = "40px"; + // add button + // hide image when button is clicked \ No newline at end of file From 109e6e9aca9c75a6ce0a0dbbc2916ca71db9e657 Mon Sep 17 00:00:00 2001 From: Amatullah Brown Date: Mon, 28 Dec 2020 22:05:36 -0500 Subject: [PATCH 04/12] added button to hide image --- js-dom.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js-dom.html b/js-dom.html index 3c54de4..b52d623 100644 --- a/js-dom.html +++ b/js-dom.html @@ -29,7 +29,12 @@ // change the font size of the first

to 40px document.getElementById("p1").style.fontSize = "40px"; // add button + let button = document.createElement("button"); + document.getElementsByTagName("body")[0].appendChild(button); // hide image when button is clicked + button.addEventListener("click", () => { + img.style.display = "none"; + }) \ No newline at end of file From c10a76e10948d31ba20f2aec3f687d9dce3113ac Mon Sep 17 00:00:00 2001 From: Amatullah Brown Date: Mon, 28 Dec 2020 22:06:28 -0500 Subject: [PATCH 05/12] created about.html --- about.html | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 about.html diff --git a/about.html b/about.html new file mode 100644 index 0000000..d01f779 --- /dev/null +++ b/about.html @@ -0,0 +1,11 @@ + + + + + + Document + + + + + \ No newline at end of file From 0c69d767b02ad46493aab2843a6e28faf6e5a18d Mon Sep 17 00:00:00 2001 From: Amatullah Brown Date: Mon, 28 Dec 2020 22:07:16 -0500 Subject: [PATCH 06/12] added title and ul --- about.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/about.html b/about.html index d01f779..44835f3 100644 --- a/about.html +++ b/about.html @@ -3,9 +3,14 @@ - Document + About Me - +

    +
  • Nickname: booboo
  • +
  • Favorites: music, pizza, The Office
  • +
  • Hometown: Wilmington
  • +
  • Random Fact: Black is my favorite color.
  • +
\ No newline at end of file From e44cf8bbd297d8f15e582daafb78051c76fc03e4 Mon Sep 17 00:00:00 2001 From: Amatullah Brown Date: Mon, 28 Dec 2020 22:09:53 -0500 Subject: [PATCH 07/12] added and connected main.js --- about.html | 9 +++++---- main.js | 0 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 main.js diff --git a/about.html b/about.html index 44835f3..fcd6475 100644 --- a/about.html +++ b/about.html @@ -7,10 +7,11 @@
    -
  • Nickname: booboo
  • -
  • Favorites: music, pizza, The Office
  • -
  • Hometown: Wilmington
  • -
  • Random Fact: Black is my favorite color.
  • +
  • Nickname: booboo
  • +
  • Favorites: music, pizza, The Office
  • +
  • Hometown: Wilmington
  • +
  • Random Fact: Black is my favorite color.
+ \ No newline at end of file diff --git a/main.js b/main.js new file mode 100644 index 0000000..e69de29 From 3d468e1ef2fab680f7b4bcd84271681439f4d0bf Mon Sep 17 00:00:00 2001 From: Amatullah Brown Date: Mon, 28 Dec 2020 22:29:53 -0500 Subject: [PATCH 08/12] updated list information --- about.html | 8 ++++---- main.js | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/about.html b/about.html index fcd6475..e1a3aff 100644 --- a/about.html +++ b/about.html @@ -7,10 +7,10 @@
    -
  • Nickname: booboo
  • -
  • Favorites: music, pizza, The Office
  • -
  • Hometown: Wilmington
  • -
  • Random Fact: Black is my favorite color.
  • +
  • Nickname: booboo
  • +
  • Favorites: music, pizza, The Office
  • +
  • Hometown: Wilmington
  • +
  • Random Fact: Black is my favorite color.
diff --git a/main.js b/main.js index e69de29..030651d 100644 --- a/main.js +++ b/main.js @@ -0,0 +1,6 @@ +const lis = document.querySelectorAll("li"); +lis[0].textContent = "Nickname: none"; +lis[1].textContent = "Favorites: baking, gardening, pottery"; +lis[2].textContent = "Hometown: Philadelphia"; +lis[3].textContent = "Random fact: Oprah loves bread."; +document.body.style.fontFamily = "Arial", sans-ServiceUIFrameContext; From 8068d20a6b976569b70bb6172994c37f8aff1c5e Mon Sep 17 00:00:00 2001 From: Amatullah Brown Date: Mon, 28 Dec 2020 22:35:39 -0500 Subject: [PATCH 09/12] changed li color --- main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.js b/main.js index 030651d..6226d45 100644 --- a/main.js +++ b/main.js @@ -3,4 +3,9 @@ lis[0].textContent = "Nickname: none"; lis[1].textContent = "Favorites: baking, gardening, pottery"; lis[2].textContent = "Hometown: Philadelphia"; lis[3].textContent = "Random fact: Oprah loves bread."; +// change
  • color +for (let i=0; i Date: Tue, 29 Dec 2020 20:24:48 -0500 Subject: [PATCH 10/12] added images --- main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 6226d45..6693eb1 100644 --- a/main.js +++ b/main.js @@ -7,5 +7,12 @@ lis[3].textContent = "Random fact: Oprah loves bread."; for (let i=0; i Date: Tue, 29 Dec 2020 20:26:35 -0500 Subject: [PATCH 11/12] created table-of-contents.html --- table-of-contents.html | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 table-of-contents.html diff --git a/table-of-contents.html b/table-of-contents.html new file mode 100644 index 0000000..e26bec8 --- /dev/null +++ b/table-of-contents.html @@ -0,0 +1,27 @@ + + + + + + Document + + +
    +

    Table of Contents

    +
    +
    +
    +

    Fruits

    +

    Red Fruits

    +

    Apple

    +

    Raspberry

    +

    Orange Fruits

    +

    Orange

    +

    Tangerine

    +

    Vegetables

    +

    Vegetables Which Are Actually Fruits

    +

    Tomato

    +

    Eggplant

    +
    + + \ No newline at end of file From 03fd6adfdd10ee1a1a9e72b314f398664372e011 Mon Sep 17 00:00:00 2001 From: Amatullah Brown Date: Mon, 11 Jan 2021 23:27:09 -0500 Subject: [PATCH 12/12] complete --- table-of-contents.html | 24 ++++++++++++++---------- table-of-contents.js | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 table-of-contents.js diff --git a/table-of-contents.html b/table-of-contents.html index e26bec8..23c0694 100644 --- a/table-of-contents.html +++ b/table-of-contents.html @@ -3,7 +3,10 @@ - Document + Table of Contents +
    @@ -12,16 +15,17 @@

    Table of Contents


    Fruits

    -

    Red Fruits

    -

    Apple

    -

    Raspberry

    -

    Orange Fruits

    -

    Orange

    -

    Tangerine

    +

    Red Fruits

    +

    Apple

    +

    Raspberry

    +

    Orange Fruits

    +

    Orange

    +

    Tangerine

    Vegetables

    -

    Vegetables Which Are Actually Fruits

    -

    Tomato

    -

    Eggplant

    +

    Vegetables Which Are Actually Fruits

    +

    Tomato

    +

    Eggplant

    + \ No newline at end of file diff --git a/table-of-contents.js b/table-of-contents.js new file mode 100644 index 0000000..ac7df4b --- /dev/null +++ b/table-of-contents.js @@ -0,0 +1,38 @@ +const toc = document.querySelectorAll("h1, h2, h3"); + let ul = document.createElement('ul'); + ul.setAttribute("class", "main"); + document.querySelector('div').appendChild(ul); + let li; + let text; + let oldLi; + for (let i=1; i