diff --git a/about.html b/about.html new file mode 100644 index 0000000..3f9744f --- /dev/null +++ b/about.html @@ -0,0 +1,26 @@ + + + + + + + Document + + + + +

About Me

+ + + + + + + + + \ No newline at end of file diff --git a/fruits.html b/fruits.html new file mode 100644 index 0000000..83301b3 --- /dev/null +++ b/fruits.html @@ -0,0 +1,33 @@ + + + + + + + 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 diff --git a/fruits.js b/fruits.js new file mode 100644 index 0000000..d181ebf --- /dev/null +++ b/fruits.js @@ -0,0 +1,34 @@ +const bodyElem = document.querySelector('body'); +const divHeader = document.querySelector('#headerDiv'); + + + +// insert a div element above current body content +let tocElem = document.createElement('div'); +tocElem.id = 'toc'; +bodyElem.insertBefore(tocElem, divHeader); + + +// jquery function on document ready to get child elem of #contents and iterate +//console.log(divList[i].innerText); +$(document).ready(function toc_builder(){ + + const divList = $('#contents').children(); + + for (let i = 0; i < divList.length; i++) { + if(divList[i].nodeName == "H1"){ + $('#toc').append(`

${divList[i].innerText}

`); + + } + else if(divList[i].nodeName == "H2"){ + $('#toc').append(``); + } + else { + $('#toc').append(`
  • ${divList[i].innerText}
  • `); + } + } + $('#toc').append(`
    `); + $('#toc').append(`
    `); + +}); + diff --git a/js-dom.html b/js-dom.html new file mode 100644 index 0000000..b73811e --- /dev/null +++ b/js-dom.html @@ -0,0 +1,19 @@ + + + + + + + Document + + + +

    one

    +

    two

    + + + + + + + \ No newline at end of file diff --git a/js-dom.js b/js-dom.js new file mode 100644 index 0000000..3643150 --- /dev/null +++ b/js-dom.js @@ -0,0 +1,41 @@ +//// Change text of p1, p2 //// +const paraBothMessage = "We are coders!"; +const paraOneMessage = "Developers for life!"; + +var bothPara = document.querySelectorAll(".para"); + +for (let i = 0; i < bothPara.length; i++) { + const thisPara = bothPara[i]; + thisPara.innerText = paraBothMessage; +} + +var paraOne = document.getElementById("paraOne"); +paraOne.innerText = paraOneMessage; +paraOne.style.fontSize = "40px"; + +// +let imageHtml = +` +

    This is a laptop!

    +Granville Woods +`; + +let bodyElem = document.querySelector('body'); +bodyElem.innerHTML += imageHtml; + +// Change all text to red +bodyElem.style.color = "red"; + +//hide button +function hideImage() { + const laptopImg = document.querySelector(".image"); + const status = laptopImg.style.visibility; + + if(status == "hidden"){ + laptopImg.style.visibility = "visible"; + } + else { + laptopImg.style.visibility = "hidden"; + } + +} diff --git a/lib/images/Headshot Photo.JPG b/lib/images/Headshot Photo.JPG new file mode 100644 index 0000000..d52b27b Binary files /dev/null and b/lib/images/Headshot Photo.JPG differ diff --git a/lib/index.html b/lib/index.html index 3bb5740..7bb802e 100644 --- a/lib/index.html +++ b/lib/index.html @@ -8,12 +8,16 @@ + +
    fist fist

    Minority Tech

    +

    +

    diff --git a/main.js b/main.js new file mode 100644 index 0000000..3221743 --- /dev/null +++ b/main.js @@ -0,0 +1,23 @@ +// Change font of body +const bodyElem = document.querySelector('body'); +bodyElem.style.fontFamily = "Arial, sans-serif"; + +const liElem = document.querySelectorAll('li'); + +for (let i = 0; i < liElem.length; i++) { + const thisLi = liElem[i]; + thisLi.style.color = "red"; +} + +//Add image +let imageHtml = +` +

    This is a picture of me!

    +Granville Woods +`; + +bodyElem.innerHTML += imageHtml; + +let imgElem = document.querySelector('.image'); +imgElem.width = "100"; +