From 6c86393c62f8b6f98f4a10e366da20d63f8d56d7 Mon Sep 17 00:00:00 2001 From: hinalatif25 Date: Mon, 28 Dec 2020 19:50:05 -0500 Subject: [PATCH 01/13] JS DOM LAB part1 --- js-dom.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 js-dom.html diff --git a/js-dom.html b/js-dom.html new file mode 100644 index 0000000..1dbc1c6 --- /dev/null +++ b/js-dom.html @@ -0,0 +1,18 @@ + + + + DOM lab + + +

+ +

+ + + + + + + + + From eba40ee3ea68acd633a55c7ca67349ba525163e7 Mon Sep 17 00:00:00 2001 From: hinalatif25 Date: Mon, 28 Dec 2020 20:48:21 -0500 Subject: [PATCH 02/13] add image --- js-dom.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/js-dom.html b/js-dom.html index 1dbc1c6..7b8fcaf 100644 --- a/js-dom.html +++ b/js-dom.html @@ -4,15 +4,23 @@ DOM lab -

- -

+ +

Developers for life!

- +

+ arch +

+ + From 0f33b764a9fe0c026e87ed8da4a6d48ac4294d2c Mon Sep 17 00:00:00 2001 From: hinalatif25 Date: Tue, 29 Dec 2020 22:08:41 -0500 Subject: [PATCH 03/13] changed color and font size --- js-dom.html | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/js-dom.html b/js-dom.html index 7b8fcaf..a042692 100644 --- a/js-dom.html +++ b/js-dom.html @@ -6,20 +6,21 @@ -

Developers for life!

+

Developers for life!

- arch + architecture

- + var x = document.getElementById("myImg").src; + document.getElementById("demo").innerHTML = x; + document.getElementById("para1").style.fontSize = "40px"; + + } + From 2351690e3d9ca0fd0a9b497947e1aa577ac74628 Mon Sep 17 00:00:00 2001 From: hinalatif25 Date: Wed, 30 Dec 2020 12:26:11 -0500 Subject: [PATCH 04/13] show/hide image --- js-dom.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js-dom.html b/js-dom.html index a042692..cdd4eef 100644 --- a/js-dom.html +++ b/js-dom.html @@ -2,6 +2,15 @@ DOM lab + + + @@ -13,6 +22,8 @@ architecture

+ + \ No newline at end of file From 911513e0062e9321a40b0f789b309faf717a275a Mon Sep 17 00:00:00 2001 From: hinalatif25 Date: Wed, 30 Dec 2020 18:04:08 -0500 Subject: [PATCH 08/13] add own info --- about.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/about.html b/about.html index c8a2b2e..f1532d1 100644 --- a/about.html +++ b/about.html @@ -4,16 +4,16 @@ About me - +
    -
  • Nickname: booboo
  • +
  • Nickname: hinz
  • Favorites: music, pizza, The Office
  • -
  • Hometown: Wilmington
  • -
  • Random Fact: Black is my favorite color.
  • +
  • Hometown: Bear
  • +
  • Random Fact: Brown is my favorite color.

- + \ No newline at end of file From 66b1a2ae8d388b3b777513abffe1a89d174c07d5 Mon Sep 17 00:00:00 2001 From: hinalatif25 Date: Thu, 31 Dec 2020 13:06:13 -0500 Subject: [PATCH 09/13] change color --- about.html | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/about.html b/about.html index f1532d1..8e22267 100644 --- a/about.html +++ b/about.html @@ -3,17 +3,24 @@ About me + + + + + +

About Me

-
    -
  • Nickname: hinz
  • -
  • Favorites: music, pizza, The Office
  • -
  • Hometown: Bear
  • -
  • Random Fact: Brown is my favorite color.
  • +
      +
    • Nickname: hinz
    • +
    • Favorites: music, pizza, The Office
    • +
    • Hometown: Bear
    • +
    • Random Fact: Brown is my favorite color.
    -

    - + + + \ No newline at end of file From f2bb683dc1537a0ddcefa043aa658dc9934e2607 Mon Sep 17 00:00:00 2001 From: hinalatif25 Date: Thu, 7 Jan 2021 18:55:47 -0500 Subject: [PATCH 10/13] change color --- main.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 main.js diff --git a/main.js b/main.js new file mode 100644 index 0000000..ebc5047 --- /dev/null +++ b/main.js @@ -0,0 +1,8 @@ + + function changeFont() { + document.getElementById("font").style.fontFamily = "Arial,sans-serif"; + } + + function changeColor() { + document.getElementById("list").style.color = "green"; + } \ No newline at end of file From c68cce1608d5232856e4628642847711b76232ed Mon Sep 17 00:00:00 2001 From: hinalatif25 Date: Thu, 7 Jan 2021 18:59:07 -0500 Subject: [PATCH 11/13] show image --- DOM.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 DOM.js diff --git a/DOM.js b/DOM.js new file mode 100644 index 0000000..cbe5529 --- /dev/null +++ b/DOM.js @@ -0,0 +1,33 @@ +function addText() { + document.getElementById("para1").textContent = "We are coders!"; +} + +function changeText() { + document.getElementById("para1").innerHTML = "Developers for life!"; + } + +function addImage() { + let image = new Image(200, 200); + image.src = "tech.jpg"; + document.getElementById("para2").appendChild(image); + } + +function changeColor() { + document.getElementById("para1").style.color = "brown"; +} + +function fontSize() { + document.getElementById("para1").style.fontSize = "40px"; +} + +function hideImage() { + document.getElementById("para2").textContent = ""; +} + + + + + + + + From 02a2406c28d2ab4962938fc53c7fc14107fd2941 Mon Sep 17 00:00:00 2001 From: hinalatif25 Date: Thu, 7 Jan 2021 19:02:37 -0500 Subject: [PATCH 12/13] table of contents --- TOC.html | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 TOC.html diff --git a/TOC.html b/TOC.html new file mode 100644 index 0000000..4c8b218 --- /dev/null +++ b/TOC.html @@ -0,0 +1,30 @@ + + + + + + Table of Contents + + + +
    +

    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 6461d96ce8404e1ff9f618fb43c32d4d21aae414 Mon Sep 17 00:00:00 2001 From: hinalatif25 Date: Thu, 7 Jan 2021 19:05:04 -0500 Subject: [PATCH 13/13] contents --- toc.js | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 toc.js diff --git a/toc.js b/toc.js new file mode 100644 index 0000000..5fcc244 --- /dev/null +++ b/toc.js @@ -0,0 +1,49 @@ +var c = function() { + return({ + log: function(msg) { + consoleDiv = document.getElementById('console'); + para = document.createElement('p'); + text = document.createTextNode(msg); + para.appendChild(text); + consoleDiv.appendChild(para); + } + }); +}(); + +window.onload = function () { + var toc = ""; + var level = 0; + var maxLevel = 3; + + document.getElementById("contents").innerHTML = + document.getElementById("contents").innerHTML.replace( + /([^<]+)<\/h([\d])>/gi, + function (str, openLevel, titleText, closeLevel) { + if (openLevel != closeLevel) { + c.log(openLevel) + return str + ' - ' + openLevel; + } + + if (openLevel > level) { + toc += (new Array(openLevel - level + 1)).join("
      "); + } else if (openLevel < level) { + toc += (new Array(level - openLevel + 1)).join("
    "); + } + + level = parseInt(openLevel); + + var anchor = titleText.replace(/ /g, "_"); + toc += "
  • " + titleText + + "
  • "; + + return "" + + titleText + ""; + } + ); + + if (level) { + toc += (new Array(level + 1)).join(""); + } + + document.getElementById("toc").innerHTML += toc; +}; \ No newline at end of file