8000 Home work week1 JS2 by AllouhM · Pull Request #17 · HackYourFuture/JavaScript2 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 0 additions & 11 deletions Week1/homework/app.js

This file was deleted.

Binary file added Week1/homework/image/Great Expectations.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/image/Memory of the body.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/image/Tell Me a Riddle.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/image/The Grate Gatsby.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/image/To Kill a Mockingbird.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/image/Triple Granada.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/image/War and Peace.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/image/a river dies of thirst.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/image/background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion Week1/homework/index.html

This file was deleted.

56 changes: 56 additions & 0 deletions Week1/homework/mybooks.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
*{
box-sizing:border-box;
}

body {

width: 100%;
background-color: rgb(220, 220, 243);
background-image:url(https://s31.postimg.cc/nj8wb5jrv/background.jpg);
background-repeat: no-repeat;
background-size: 100% 100%;
}

li {
list-style: none;
width:50%;
float: left;
text-align: center;
padding: 20px;
color:rgb(241, 241, 241);
margin-bottom: 70px;

}

img {
width:400px;
height:400px;
border:2px solid black;
margin-top: 30px;
}

h1{
width:900px;
color:yellowgreen;
margin:10% 0 10% 10%;
font-size: 4em;
font-family: cursive;
padding:20px;
background-color: rgba(189, 140, 140, 0.4);
border-radius: 5px;
}

h2{
font-family: cursive; D0DC
font-size: 1.8em;
}

p{
font-family: sans-serif;
font-size: 1.5em;
}

h4{
font-family: sans-serif;
font-size: 1em;
}
16 changes: 16 additions & 0 deletions Week1/homework/mybooks.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8" />
<title>My Favorite Books</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="mybooks.css" />

</head>

<body>
<script src="mybooks.js"></script>
</body>

</html>
162 changes: 162 additions & 0 deletions Week1/homework/mybooks.js
< 3AE4 td id="diff-76ebfba7d1cda38cdbe259182803d982a831d55724e38133e4dbf3b5b482f1c9R29" data-line-number="29" class="blob-num blob-num-addition js-linkable-line-number js-blob-rnum"> D0DC
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
'use strict';

const myFavorite = [
'a_river_dies_of_thirst',
'in_the_presence_of_absence',
'the_grate_gatsby',
'to_kill_a_mockingbird ',
'tell_me_a_Riddle',
'triple_ granada',
'memory_of_the_body',
'great_expectations',
'war_and_peace',
'murder_on_the_orient_express',
];

// console.log(myFavorite);

function constructElements() {

const ul = document.createElement('ul');

myFavorite.forEach(function (bookItems) {
// console.log(bookItems);

const li = document.createElement('li');
ul.appendChild(li);
li.innerHTML += bookItems;
});
document.body.appendChild(ul);
}

// constructElements();

const addH1 = document.createElement('h1');
document.body.appendChild(addH1);
addH1.innerHTML = 'Books I Enjoyed';


const booksDetails = {

a_river_dies_of_thirst: {
title: 'A River of Thirst',
author: 'Mahmoud Darwish',
year: 2009,
language: 'Translated to English',
},
in_the_presence_of_absence: {
title: 'In The Presence of Absence',
author: 'Mahmoud Darwish',
year: 2006,
language: 'Translated to English',
},
the_grate_gatsby: {
title: 'The Grate Gatsby',
author: ' F. Scott Fitzgerald',
year: 1925,
language: 'English',
},
to_kill_a_mockingbird: {
title: 'To Kill a Mockingbird ',
author: ' Harper Lee',
year: 1960,
language: 'English',
},
tell_me_a_Riddle: {
title: 'Tell me a Riddle',
author: ' Tillie Olsen',
year: 1961,
language: 'English',
},
triple_granada: {
title: 'Triple Granada',
author: 'Radwa Ashour',
year: 2009,
language: 'Arabic',
},
memory_of_the_body: {
title: 'Memory of the body',
author: ' Ahlam Mosteghanemi ',
year: 2010,
language: 'Arabic',
},
great_expectations: {
title: 'Great Expectations',
author: ' Charles Dickens',
year: 1860,
language: 'English',
},
war_and_peace: {
title: 'War and Peace',
author: 'Leo Tolstoy',
year: 1869,
language: 'English',
},
murder_on_the_orient_express: {
title: 'Murder on the Orient Express',
author: 'Agatha Christie',
year: 1934,
language: 'English',
}

};

function createBooksList() {
const bookList = document.createElement('ul');
bookList.setAttribute('id', 'main_list');
document.body.appendChild(bookList);

for (const bookIndex in booksDetails) {
const bookListInfo = document.createElement('li');
bookListInfo.setAttribute('id', bookIndex);
bookList.appendChild(bookListInfo);

const titleIn = document.createElement('h2');
bookListInfo.appendChild(titleIn);
titleIn.innerHTML = booksDetails[bookIndex].title;

const authorIn = document.createElement('h4');
bookListInfo.appendChild(authorIn);
authorIn.innerHTML = 'By : ' + booksDetails[bookIndex].author;

const yearIn = document.createElement('p');
bookListInfo.appendChild(yearIn);
yearIn.innerHTML = 'Published : ' + booksDetails[bookIndex].year;

const languageIn = document.createElement('p');
bookListInfo.appendChild(languageIn);
languageIn.innerHTML = 'Language : ' + booksDetails[bookIndex].language;
}

document.body.appendChild(bookList);
}


createBooksList();

const covers = {
a_river_dies_of_thirst: 'https://s31.postimg.cc/x3s2ees3f/a_river_dies_of_thirst.jpg',
in_the_presence_of_absence: 'https://s31.postimg.cc/c6vu9u9iz/in_the_presence_of_absence.jpg',
the_grate_gatsby: 'https://s31.postimg.cc/gg0kc17nf/The_Grate_Gatsby.jpg',
to_kill_a_mockingbird: 'https://s31.postimg.cc/vbz3jn67f/To_Kill_a_Mockingbird.jpg',
tell_me_a_Riddle: 'https://s31.postimg.cc/41dsbsvln/Tell_Me_a_Riddle.jpg',
triple_granada: 'https://s31.postimg.cc/frrpsqtej/Triple_Granada.jpg',
memory_of_the_body: 'https://s31.postimg.cc/9qu0vpwij/Memory_of_the_body.jpg',
great_expectations: 'https://s31.postimg.cc/hjkonqzxn/Great_Expectations.jpg',
war_and_peace: 'https://s31.postimg.cc/5ugozsw4b/War_and_Peace.jpg',
murder_on_the_orient_express: 'https://s31.postimg.cc/omsk3f2t7/Murder_on_the_Orient_Express.jpg',
};

function content() {

for (const keys in booksDetails) {
const addImage = document.createElement('img');
addImage.setAttribute('src', covers[keys]);
addImage.setAttribute('alt', 'This is the cover image of ' + keys + ' book');
document.getElementById(keys).appendChild(addImage);

}
}

content();

1 change: 0 additions & 1 deletion Week1/homework/style.css

This file was deleted.

1 change: 1 addition & 0 deletions Week2/homework/maartjes_work.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ const tuesday = [
const tasks = monday.concat(tuesday);

// Add your code here

2 changes: 2 additions & 0 deletions Week2/homework/map_filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
const numbers = [1, 2, 3, 4];

// Add your code here


0