Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit 6642b05

Browse files
committed
17.01.2020 1-3-4
1 parent 5f9e431 commit 6642b05

12 files changed

Lines changed: 195 additions & 0 deletions

File tree

‎Week1/js-exercises/aboutMe/2aboutMe.html‎

Whitespace-only changes.

‎Week1/js-exercises/aboutMe/2aboutMe.js‎

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
11+
<script src="1booksList.js"></script>
12+
</body>
13+
</html>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
function bookList(){
2+
const books = [
3+
{
4+
title: 'The Design of Everyday Things',
5+
author: 'Don Norman',
6+
alreadyRead: false,
7+
src: "https://productdork.com/uploads/default/original/1X/ddbda1150301e89cdf0119d84f2a7fb8930beffb.png"
8+
},
9+
{
10+
title: 'The Most Human Human',
11+
author: 'Brian Christian',
12+
alreadyRead: false,
13+
src: "https://i.gr-assets.com/images/S/compressed.photo.goodreads.com/books/1295465264l/8884400.jpg"
14+
},
15+
{
16+
title: 'Angels & Demons',
17+
author: 'Dan Brown',
18+
alreadyRead: true,
19+
src: "https://covers.openlibrary.org/w/id/8398165-L.jpg"
20+
}
21+
];
22+
var paragraf = document.createElement("p");
23+
24+
for (let i=0; i<books.length; i++) {
25+
let ulist = document.createElement("ul");
26+
let titleli = document.createElement("li");
27+
let authorli = document.createElement("li");
28+
let readli = document.createElement("li");
29+
let bookimg = document.createElement("img");
30+
31+
document.body.appendChild(ulist);
32+
33+
let title = document.createTextNode(books[i].title);
34+
let author = document.createTextNode(books[i].author);
35+
let alreadyRead = document.createTextNode("Already Read: " + books[i].alreadyRead);
36+
37+
titleli.appendChild(title);
38+
ulist.appendChild(titleli);
39+
40+
authorli.appendChild(author);
41+
ulist.appendChild(authorli);
42+
43+
44+
readli.appendChild(alreadyRead);
45+
ulist.appendChild(readli);
46+
47+
bookimg.src = books[i].src;
48+
ulist.appendChild(bookimg);
49+
50+
bookimg.style.height = "300px";
51+
}
52+
53+
}
54+
bookList();
55+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
<img id="googlelogo" src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png">
11+
<script src="3logoHijack.js"></script>
12+
</body>
13+
</html>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function hijackGoogleLogo(){
2+
var logo = document.getElementById('googlelogo');
3+
logo.src = 'https://www.hackyourfuture.dk/static/logo-dark.svg';
4+
}
5+
hijackGoogleLogo();

‎Week1/js-exercises/theCatWalk/5theCatWalk.html‎

Whitespace-only changes.

‎Week1/js-exercises/theCatWalk/5theCatWalk.js‎

Whitespace-only changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
<script src="4whatistheTime.js"></script>
11+
</body>
12+
</html>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
function showCurrentTime() {
2+
var today = new Date();
3+
var h = today.getHours();
4+
var m = today.getMinutes();
5+
var s = today.getSeconds();
6+
m = checkTime(m);
7+
s = checkTime(s);
8+
document.body.innerHTML =
9+
h + ":" + m + ":" + s;
10+
var t = setTimeout(showCurrentTime, 1000);
11+
}
12+
function checkTime(i) {
13+
if (i < 10) {i = "0" + i};
14+
return i;
15+
}
16+
17+
showCurrentTime();

0 commit comments

Comments
 (0)