Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Norah Alessa #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Binary file added .DS_Store
Binary file not shown.
Binary file added code/.DS_Store
Binary file not shown.
20 changes: 20 additions & 0 deletions code/Creating-Random-Images/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
console.log("it's Working");

//type of the event
const eventType='click';
//the target of the event
const myButton=document.querySelector('button');

const widthInput=document.querySelector('.width');
const heightInput=document.querySelector('.height');

const newImageRand=function(){
//ToDO....
const newImage=document.createElement('img');
newImage.setAttribute('src',"https://source.unsplash.com/user/erondu/600x600");
const newImageDiv=document.querySelector('.image');
newImageDiv.appendChild(newImage);

}

myButton.addEventListener('click',newImageRand);
30 changes: 30 additions & 0 deletions code/Creating-Random-Images/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>

<body>

<div>
<label>
Width:
<input type="number" class="width" />
</label>
<label>
Height:
<input type="number" class="height" />
</label>
<button id="randomize">Get random image!</button>
</div>

<div class="image"></div>

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

</html>
48 changes: 48 additions & 0 deletions code/more-dom-manipulation/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//changing the font family
const bodyFont=document.querySelector('body');
bodyFont.style.fontFamily="Arial, sans-serif";

//

const nickname = document.querySelector('#nickname');
const favorite = document.querySelector('#favorite');
const hometown = document.querySelector('#hometown');
nickname.innerHTML = 'Norah';
favorite.innerHTML = 'Dogs';
hometown.innerHTML = 'Riyadh';
const lists = document.querySelectorAll('li');
lists.forEach(function(list){
list.setAttribute('class', 'listitem');
list.style.color = 'rebeccapurple';
})
const imageProfile = document.createElement('img');
imageProfile.setAttribute('src','Norah.jpg');
const profileDiv = document.querySelector('.profilePicture');
profileDiv.append(imageProfile);
var books = [
{
title: "The Design of Everyday Things",
author: "Don Norman",
alreadyRead: false
},
{
title: "The Most Human Human",
author: "Brian Christian",
alreadyRead: true
},
{
title: "In Search of Lost Time",
author: "Marcel Proust",
alreadyRead: true
},
{
title: "Ulysses",
author: "James Joyce",
alreadyRead: true
},
{
title: "The Great Gatsby",
author: "F. Scott Fitzgerald",
alreadyRead: true
}
];
27 changes: 27 additions & 0 deletions code/more-dom-manipulation/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>More DOM Manipulation</title>
</head>

<body>

<h1>About Me</h1>

<div class="profilePicture"></div>

<ul>
<li>Nickname: <span id="nickname"></span></li>
<li>Favorite Animal: <span id="favorite"></span></li>
<li>Hometown: <span id="hometown"></span></li>
</ul>

<div class="favoriteBooks"></div>
<script src="app.js"></script>
</body>

</html>