Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Finished first pass of homework
  • Loading branch information
jshortz committed Jun 30, 2019
commit fa9f7b9b4d996168acf226c9fdec2d4185238e9b
Binary file added Notes/Thumbs.db
Binary file not shown.
119 changes: 119 additions & 0 deletions Week1/homework/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
'use strict';

{
const bookTitles = [
'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',
];

const booksInfo = {
neverwhere: {
title: 'Neverwhere',
author: 'Neil Gaiman',
language: 'English',
image: 'neverwhere.jpg'
},
kushiels_chosen: {
title: "Kushiel's Chosen",
author: 'Jacqueline Carey',
language: 'English',
image: 'kushiels_chosen.jpg',
},
huckleberry_finn: {
title: 'Huckleberry Finn',
author: 'Mark Twain',
language: 'English',
image: 'huckleberry_finn.jpg',
},
'dragons_of_autumn_twilight': {
'title': 'Dragons of Autumn Twilight',
'author': 'Margaret Weis and Tracy Hickman',
'language': 'English',
'image': 'dragons_of_autumn_twilight.jpg',
},
'darkness_visible': {
'title': 'Darkness Visible',
'author': 'William Styron',
'language': 'English',
'image': 'darkness_visible.jpg',
},
'the_things_they_carried': {
'title': 'The Things They Carried',
'author': "Tim O'Brien",
'language': 'English',
'image': 'the_things_they_carried.jpg',
},
'milk_and_honey': {
'title': 'Milk and Honey',
'author': 'Rupi Kaur',
'language': 'English',
'image': 'milk_and_honey.jpg',
},
'japan_at_war': {
'title': 'Japan At War',
'author': 'Haruko Taya Cook and Theodore Failor Cook',
'language': 'English and Japanese',
'image': 'japan_at_war.jpg',
},
'the_secret_circle': {
'title': 'The Secret Circle',
'author': 'L.J. Smith',
'language': 'English',
'image': 'the_secret_circle.jpg',
},
'basho': {
'title': 'Basho: The Complete Haiku',
'author': 'Matsuo Basho',
'language': 'Japanese and English',
'image': 'basho.jpg',
},
}

/* 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';
document.getElementById('titlesListDiv').appendChild(titleDiv);
let coverImage = document.createElement("img");
coverImage.src = booksInfo[idKey].image;
coverImage.style = 'height: 200px; width: 145px; float: left; display: inline; margin-right: 20px';
document.getElementById(idKey).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 + '<br><br>Language: ' + booksInfo[idKey].language;

/*let li = document.createElement('li');
titlesList.appendChild(li);
li.id = idKey;
document.getElementById(idKey).innerHTML = titles[i];*/
}
}

createList(bookTitles);
}
Binary file added Week1/homework/basho.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/darkness_visible.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/dragons_of_autumn_twilight.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/huckleberry_finn.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions Week1/homework/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>

<head>

</head>

<body>
<script type="text/javascript" src="app.js"></script>
</body>

</html>
Binary file added Week1/homework/japan_at_war.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/kushiels_chosen.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/milk_and_honey.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/neverwhere.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/the_secret_circle.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/the_things_they_carried.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.