diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..e764c11 Binary files /dev/null and b/.DS_Store differ diff --git a/MAIN3.js b/MAIN3.js new file mode 100644 index 0000000..996f7dc --- /dev/null +++ b/MAIN3.js @@ -0,0 +1,26 @@ + +//creating a constructor function, (template, blueprint) +let Store = function(name, location, customers){ + this.name = name; + this.location = location; + this.customers = customers; +}; + +let storeArray = [] +let storeOne = new Store('Chocolate Store', 'Bethesda', 4) +let storeTwo = new Store('Vanilla Store', 'Baltimore', 6) + +storeArray.push(storeOne) +storeArray.push(storeTwo) + + + + +Store.prototype.price = 10; +Store.prototype.revenue =(storeTwo) + +Store.prototype.revenue = function (){ + console.log(this.consumers * this.price); +} + +console.log(storeArray) diff --git a/index2.html b/index2.html new file mode 100644 index 0000000..b84c516 --- /dev/null +++ b/index2.html @@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ Page Title ++ ++ ++ ++ ++
++
++
++
++ ++ ++ ++ ++ \ No newline at end of file diff --git a/lab-01/26.jpg b/lab-01/26.jpg new file mode 100644 index 0000000..5521304 Binary files /dev/null and b/lab-01/26.jpg differ diff --git a/lab-01/Aqa.jpg.png b/lab-01/Aqa.jpg.png new file mode 100644 index 0000000..b6a0160 Binary files /dev/null and b/lab-01/Aqa.jpg.png differ diff --git a/lab-01/congo.png b/lab-01/congo.png new file mode 100644 index 0000000..f1a0c08 Binary files /dev/null and b/lab-01/congo.png differ diff --git a/lab-01/index.html b/lab-01/index.html new file mode 100644 index 0000000..de8c369 --- /dev/null +++ b/lab-01/index.html @@ -0,0 +1,108 @@ + + + + + + Page Title + + + + + + +

All About Me

+ + + + + + + + +
+ Twenty + + Steak + + Congo + + Aquarius +
+ + + + +
    +
  1. Name: George

  2. + +
  3. Seven Samurai

  4. + +
  5. Restrepo

  6. +
  7. 3:10 to Yuma

  8. +
  9. The Matrix

  10. +
  11. Boondocks Saint

  12. +
  13. The Faculty

  14. +
  15. The Warrior

  16. +
  17. Crouching Tiger Hidden Dragon

  18. +
  19. Saving Silverman

  20. +
  21. The Hobbit

  22. +
+

Are you in America?.

+ + + + + + + +function myFunction() { + confirm("Are you American!"); +} + +

Are you getting old, are you?.

+ + + + +

Are you Happy?.

+ + + + +

Do you have a middle name?.

+ + + + +

Are you the oldest?.

+ + + + + + + \ No newline at end of file diff --git a/lab-01/index.html-1 b/lab-01/index.html-1 new file mode 100644 index 0000000..2ceaedd --- /dev/null +++ b/lab-01/index.html-1 @@ -0,0 +1,3 @@ +let myFUnction = function() { + console.log('hello world') +} \ No newline at end of file diff --git a/lab-01/main.css b/lab-01/main.css new file mode 100644 index 0000000..9714bf5 --- /dev/null +++ b/lab-01/main.css @@ -0,0 +1,4 @@ +body { + margin: 0 auto; + background-color: blue; +} diff --git a/lab-01/main.js b/lab-01/main.js new file mode 100644 index 0000000..dab9c75 --- /dev/null +++ b/lab-01/main.js @@ -0,0 +1,33 @@ + let name = prompt("what is your name?"); + let country = prompt("What is your orgin?"); + let age = prompt("how old are you?"); + let food = prompt("what is your fravorite food?"); +let language = prompt("What languages do you speak?"); + +let myArray = ['soccer', 'basketball', 'lakers']; +let emptyArray = []; +let checkHuman; + +for(let i = 0; i < myArray.length; i++) { + checkHuman = confirm('Do you play ' + myArray[i]); + if(checkHuman) { + emptyArray.push(myArray[i]); + } +} + +if(myArray === emptyArray) { + alert('Welcome Human'); +} + +if(name){ + document.getElementById('userName').innerText = name; +} + + + + +console.log(name); +console.log(country); +console.log(age); +console.log(food); +console.log(language); \ No newline at end of file diff --git a/lab-01/main.js-2 b/lab-01/main.js-2 new file mode 100644 index 0000000..e69de29 diff --git a/lab-01/main2.js b/lab-01/main2.js new file mode 100644 index 0000000..83ae1f5 --- /dev/null +++ b/lab-01/main2.js @@ -0,0 +1,24 @@ +let myStore = { + product : 'chocolate cookies', + customers: 100, + employees: 3 + location: 'Bethesda', + getproduct: function(){ + console.log(this.product) + } +} + +let id= document.getElementById('body') +body.innerText = 'Hello World' + +let class = document.getElementsByClassName('myClass') +for(let i = 0; i < elClass.length; i++) +elClass + + + +let elTable = document.createElement('table'); +let elRow = document.createElement('tr') +elRow.textContent = objArray[i].name + + diff --git a/lab-01/main3.js b/lab-01/main3.js new file mode 100644 index 0000000..3d4beba --- /dev/null +++ b/lab-01/main3.js @@ -0,0 +1,126 @@ +function Store(name, location, product, customers){ + this.storeName = name; + this.storeLoc = location; + this.storeProduct = products; + this.storeCustomers = customers; +} +let storeOne = new Store('Vanilla Store' , 'Baltimore' , 'Vanilla Cookies' , 200) +let storeTwo = new Store('Chocolate Store' , 'Bethesda' , 'Chocolate Cookies' , 100) + +console.log(storeOne); +console.log(storeTwo); + +Store.prototype.price = 10 +Store.prototype.revenue = 0 + +Store.prototype.calRevenue = function() { + this.revenue = this.customers * this.price +} + +console.log(storeOne) +console.log(storeTwo) + + + +// let storeOne = { +// name: 'Chocolate Store', +// product : 'chocolate cookies', +// customers: 40, +// employees: 3, +// location: 'Bethesda', +// createCustomer: function() { +// this.customers += 100 +// } +// } + +// let storeTwo = { +// name: 'Vanilla Store', +// product : 'vanilla cookies', +// customers: 200, +// employees: 10, +// location: 'Baltimore', +// getProduct: function() { +// console.log(this.product) +// } +// } + +// //array of objects +// let objArray = [storeOne, storeTwo] +// console.log = (storeOne)= 'Bethesda' +// console.log = (storeTwo)= 'Baltimore' +// //creating elements +// let elBody = document.getElementById('table-container') +// let elTable = document.createElement('table') + +// //setting a class to the new table we just created +// elTable.setAttribute('id', 'id-table') + +// //appending our table to the body +// elBody.appendChild(elTable) + +// //looping through the array of objects +// for(let i = 0; i < objArray.length; i++) { +// let elRow = document.createElement('tr') +// elTable.appendChild(elRow) +// let elTh = document.createElement('th') +// elTh.innerText = objArray[i].name +// elRow.appendChild(elTh) +// let product = document.createElement('td') +// product.innerText = objArray[i].product +// elRow.appendChild(product) +// let location = document.createElement('td') +// location.innerText = objArray[i].location +// elRow.appendChild(location) + + +// // console.log(objArray[i].name) +// // console.log(objArray[i].location) +// // console.log(objArray[i].employees) +// // objArray[i].price = 10 +// // objArray[i].revenue = objArray[i].price * objArray[i].customers +// // console.log(objArray[i].revenue) +// // console.log(objArray[i]) +// } + + +// // storeTwo.hours = '9-5' + +// // let myBody = document.getElementById('myBody') + +// // let storeOneTitle = document.createElement('h1') +// // myBody.appendChild(storeOneTitle) +// // storeOneTitle.setAttribute('class', 'store') +// // storeOneTitle.innerText = storeOne.name + +// // let storeOneLocation = document.createElement('p') +// // myBody.appendChild(storeOneLocation) +// // storeOneLocation.setAttribute('id', 'store-one-location') +// // storeOneLocation.innerText = storeOne.location + +// // let storeOneCustomers = document.createElement('p') +// // myBody.appendChild(storeOneCustomers) +// // storeOneCustomers.innerText = `# of customers ${storeOne.customers} in ${storeOne.location}` +// // '# of customers ' + storeOne.customers + + + + + + +// // let heading = document.createElement('h1') +// // heading.setAttribute('class', 'newClass') +// // myBody.appendChild(heading) +// // heading.textContent = 'Heading' + +// // console.log(heading) + +// // let elClass = document.getElementsByClassName('myClass') +// // for(let i = 0; i < elClass.length; i++) { +// // elClass[i].textContent = 'Hello Again' +// // } + +// // console.log(elClass) + +// // let elId = document.getElementById('myId') +// // elId.innerText = 'Hello world' + diff --git a/lab-01/steak.jpg b/lab-01/steak.jpg new file mode 100644 index 0000000..cb5cf85 Binary files /dev/null and b/lab-01/steak.jpg differ