diff --git a/Week1/homework/Thumbs.db b/Week1/homework/Thumbs.db new file mode 100644 index 000000000..561531410 Binary files /dev/null and b/Week1/homework/Thumbs.db differ diff --git a/Week1/homework/app.js b/Week1/homework/app.js index a9b5f75d8..5400364e1 100644 --- a/Week1/homework/app.js +++ b/Week1/homework/app.js @@ -2,10 +2,144 @@ { const bookTitles = [ - // Replace with your own book titles - 'harry_potter_chamber_secrets', + 'neverwhere', + 'kushiels_chosen', + 'huckleberry_finn', + 'dragons_of_autumn_twilight', + 'darkness_visible', + 'the_things_they_carried', + 'milk_and_honey', + 'japan_at_war', + 'the_secret_circle', + 'basho', ]; - // Replace with your own code - console.log(bookTitles); + const booksInfo = { + neverwhere: { + title: 'Neverwhere', + author: 'Neil Gaiman', + language: 'English', + image: 'neverwhere.jpg', + image_alt: 'Neverwhere Cover', + goodreads: 'https://www.goodreads.com/book/show/14497.Neverwhere?from_search=true', + }, + kushiels_chosen: { + title: "Kushiel's Chosen", + author: 'Jacqueline Carey', + language: 'English', + image: 'kushiels_chosen.jpg', + image_alt: "Kushiel's Chosen Cover", + goodreads: 'https://www.goodreads.com/book/show/395962.Kushiel_s_Chosen?from_search=true', + }, + huckleberry_finn: { + title: 'Huckleberry Finn', + author: 'Mark Twain', + language: 'English', + image: 'huckleberry_finn.jpg', + image_alt: 'Huckleberry Finn Cover', + goodreads: 'https://www.goodreads.com/book/show/2956.The_Adventures_of_Huckleberry_Finn?from_search=true', + }, + dragons_of_autumn_twilight: { + title: 'Dragons of Autumn Twilight', + author: 'Margaret Weis and Tracy Hickman', + language: 'English', + image: 'dragons_of_autumn_twilight.jpg', + image_alt: 'Dragons of Autumn Twilight Cover', + goodreads: 'https://www.goodreads.com/book/show/259836.Dragons_of_Autumn_Twilight?ac=1&from_search=true', + }, + darkness_visible: { + title: 'Darkness Visible', + author: 'William Styron', + language: 'English', + image: 'darkness_visible.jpg', + image_alt: 'Darkness Visible Cover', + goodreads: 'https://www.goodreads.com/book/show/249042.Darkness_Visible?from_search=true', + }, + the_things_they_carried: { + title: 'The Things They Carried', + author: "Tim O'Brien", + language: 'English', + image: 'the_things_they_carried.jpg', + image_alt: 'The Things They Carried Cover', + goodreads: 'https://www.goodreads.com/book/show/133518.The_Things_They_Carried?from_search=true', + }, + milk_and_honey: { + title: 'Milk and Honey', + author: 'Rupi Kaur', + language: 'English', + image: 'milk_and_honey.jpg', + image_alt: 'Milk and Honey Cover', + goodreads: 'https://www.goodreads.com/book/show/23513349-milk-and-honey?from_search=true', + }, + japan_at_war: { + title: 'Japan At War', + author: 'Haruko Taya Cook and Theodore Failor Cook', + language: 'English and Japanese', + image: 'japan_at_war.jpg', + image_alt: 'Japan At War Cover', + goodreads: 'https://www.goodreads.com/book/show/31040.Japan_at_War?from_search=true', + }, + the_secret_circle: { + title: 'The Secret Circle', + author: 'L.J. Smith', + language: 'English', + image: 'the_secret_circle.jpg', + image_alt: 'The Secret Circle: The initiation Cover', + goodreads: 'https://www.goodreads.com/book/show/879215.The_Initiation?from_search=true', + }, + basho: { + title: 'Basho: The Complete Haiku', + author: 'Matsuo Basho', + language: 'Japanese and English', + image: 'basho.jpg', + image_alt: 'Basho Cover', + goodreads: 'https://www.goodreads.com/book/show/2183600.Basho?from_search=true', + }, + } + + /* Replace with your own code + //console.log(bookTitles); + + let titlesList = document.createElement('ul'); + document.getElementById('titlesListDiv').appendChild(titlesList); */ + + let listDiv = document.createElement('div'); + listDiv.setAttribute('id', 'titlesListDiv'); + document.body.appendChild(listDiv); + + function createList(titles) { + for (let i = 0; i < titles.length; i++) { + let idKey = '' + titles[i] + ''; + let titleDiv = document.createElement('div'); + titleDiv.setAttribute('id', idKey); + titleDiv.style = 'height: 200px; width: 700px; background-color: tan'; + document.getElementById('titlesListDiv').appendChild(titleDiv); + let goodreadslink = document.createElement('a'); + goodreadslink.href = booksInfo[idKey].goodreads; + goodreadslink.target = '_blank'; + goodreadslink.setAttribute('id', ('' + idKey + 'grlink')); + document.getElementById(idKey).appendChild(goodreadslink); + let coverImage = document.createElement("img"); + coverImage.src = booksInfo[idKey].image; + coverImage.alt = booksInfo[idKey].image_alt; + coverImage.style = 'height: 200px; width: 145px; float: left; display: inline; margin-right: 20px'; + document.getElementById('' + idKey + 'grlink').appendChild(coverImage); + let headerTitle = document.createElement('h1'); + headerTitle.style = 'padding-top: 30px'; + headerTitle.setAttribute('id', '' + idKey + 'header'); + document.getElementById(idKey).appendChild(headerTitle); + document.getElementById('' + idKey + 'header').innerHTML = booksInfo[idKey].title; + let otherInfo = document.createElement('p'); + otherInfo.setAttribute('id', '' + idKey + 'p'); + document.getElementById(idKey).appendChild(otherInfo); + document.getElementById('' + idKey + 'p').innerHTML = 'Author: ' + booksInfo[idKey].author + '

Language: ' + booksInfo[idKey].language; + + /*let li = document.createElement('li'); + titlesList.appendChild(li); + li.id = idKey; + document.getElementById(idKey).innerHTML = titles[i];*/ + } + } + + createList(bookTitles); } diff --git a/Week1/homework/basho.jpg b/Week1/homework/basho.jpg new file mode 100644 index 000000000..e108db720 Binary files /dev/null and b/Week1/homework/basho.jpg differ diff --git a/Week1/homework/bookcase.jpg b/Week1/homework/bookcase.jpg new file mode 100644 index 000000000..b32fc2b49 Binary files /dev/null and b/Week1/homework/bookcase.jpg differ diff --git a/Week1/homework/darkness_visible.jpg b/Week1/homework/darkness_visible.jpg new file mode 100644 index 000000000..d274b4774 Binary files /dev/null and b/Week1/homework/darkness_visible.jpg differ diff --git a/Week1/homework/dragons_of_autumn_twilight.jpg b/Week1/homework/dragons_of_autumn_twilight.jpg new file mode 100644 index 000000000..73560534e Binary files /dev/null and b/Week1/homework/dragons_of_autumn_twilight.jpg differ diff --git a/Week1/homework/huckleberry_finn.jpg b/Week1/homework/huckleberry_finn.jpg new file mode 100644 index 000000000..e7d7b1763 Binary files /dev/null and b/Week1/homework/huckleberry_finn.jpg differ diff --git a/Week1/homework/index.html b/Week1/homework/index.html index b22147cd1..160ca660d 100644 --- a/Week1/homework/index.html +++ b/Week1/homework/index.html @@ -1 +1,13 @@ - \ No newline at end of file + + + + + + + + +

Favorite Books

+ + + + \ No newline at end of file diff --git a/Week1/homework/japan_at_war.jpg b/Week1/homework/japan_at_war.jpg new file mode 100644 index 000000000..f95b25723 Binary files /dev/null and b/Week1/homework/japan_at_war.jpg differ diff --git a/Week1/homework/kushiels_chosen.jpg b/Week1/homework/kushiels_chosen.jpg new file mode 100644 index 000000000..4a053ce03 Binary files /dev/null and b/Week1/homework/kushiels_chosen.jpg differ diff --git a/Week1/homework/milk_and_honey.jpg b/Week1/homework/milk_and_honey.jpg new file mode 100644 index 000000000..50b37f3b0 Binary files /dev/null and b/Week1/homework/milk_and_honey.jpg differ diff --git a/Week1/homework/neverwhere.jpg b/Week1/homework/neverwhere.jpg new file mode 100644 index 000000000..abd2a238c Binary files /dev/null and b/Week1/homework/neverwhere.jpg differ diff --git a/Week1/homework/style.css b/Week1/homework/style.css index bab13ec23..930fa5631 100644 --- a/Week1/homework/style.css +++ b/Week1/homework/style.css @@ -1 +1,12 @@ -/* add your styling here */ \ No newline at end of file +body { + background-image: url(bookcase.jpg); +} + +#pagetitle { + background-color: tan; + text-align: center; +} + + + + diff --git a/Week1/homework/the_secret_circle.jpg b/Week1/homework/the_secret_circle.jpg new file mode 100644 index 000000000..0d8902d29 Binary files /dev/null and b/Week1/homework/the_secret_circle.jpg differ diff --git a/Week1/homework/the_things_they_carried.jpg b/Week1/homework/the_things_they_carried.jpg new file mode 100644 index 000000000..eace17020 Binary files /dev/null and b/Week1/homework/the_things_they_carried.jpg differ diff --git a/package-lock.json b/package-lock.json index e89e9916d..2b047f93a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2221,12 +2221,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2241,17 +2243,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2368,7 +2373,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2380,6 +2386,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2394,6 +2401,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2401,12 +2409,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2425,6 +2435,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -2505,7 +2516,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2517,6 +2529,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2638,6 +2651,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",