From ef260296132b9d21b6530875f00fdeba06ecdc48 Mon Sep 17 00:00:00 2001 From: Adrian Date: Thu, 21 Jun 2018 19:42:29 -0400 Subject: [PATCH 1/8] Lol --- lab-01/index.html | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lab-01/index.html diff --git a/lab-01/index.html b/lab-01/index.html new file mode 100644 index 0000000..96e2441 --- /dev/null +++ b/lab-01/index.html @@ -0,0 +1,20 @@ + + + + + + Code Partners + + + + + +

You are Awesome!

+
+

What is your legendary pet's name?

+

What is your favorite food?

+

What is wrong in the whole world?

+

Where do you usually hang out?

+
+ + \ No newline at end of file From 09a95e24fe1c88c9b35bd9ff2791f54a537cde34 Mon Sep 17 00:00:00 2001 From: Adrian Date: Sat, 23 Jun 2018 10:12:50 -0400 Subject: [PATCH 2/8] extendedhw --- lab-01/main.css | 0 lab-01/main.js | 8 ++++++++ 2 files changed, 8 insertions(+) create mode 100644 lab-01/main.css create mode 100644 lab-01/main.js diff --git a/lab-01/main.css b/lab-01/main.css new file mode 100644 index 0000000..e69de29 diff --git a/lab-01/main.js b/lab-01/main.js new file mode 100644 index 0000000..7d571cb --- /dev/null +++ b/lab-01/main.js @@ -0,0 +1,8 @@ +let name = prompt("What's your name?"); +let origin = prompt('Where are you from?') +let coder = prompt('Are you a coder?') + +console.log(name) +console.log(origin) +console.log(coder) + From ebf13d4148458fa74542960390469e4d905dc18a Mon Sep 17 00:00:00 2001 From: Adrian Date: Thu, 28 Jun 2018 18:27:30 -0400 Subject: [PATCH 3/8] Extended About me --- lab-01/index.html | 39 ++++++++++++++++++++++++++++++--------- lab-01/main.css | 17 +++++++++++++++++ lab-01/main.js | 44 +++++++++++++++++++++++++++++++++++++++----- 3 files changed, 86 insertions(+), 14 deletions(-) diff --git a/lab-01/index.html b/lab-01/index.html index 96e2441..3e5f5c3 100644 --- a/lab-01/index.html +++ b/lab-01/index.html @@ -3,18 +3,39 @@ - Code Partners + About Me - + -

You are Awesome!

-
-

What is your legendary pet's name?

-

What is your favorite food?

-

What is wrong in the whole world?

-

Where do you usually hang out?

-
+

About Me

+ +
    +
  • Name: name

  • +
  • Do you like movies?: movies

  • Are you a coder?: coder

  • +
  • Favorite Number: faveNum

  • +
  • Do you play sports?: sports

  • +
  • Are you born in the United States?: born

  • +
  • What do you want to do? As a prospective job seeker, I want to consider adopting additional features that I have seen in the 'About Me' projects made by other, so that my 'About Me' can become more thorough and interesting than my original conception.

  • + +

    Top Ten Movies

    + +
      +
    1. John Wick 1 and 2

    2. +
    3. The Raid Redemption

    4. +
    5. Logan

    6. +
    7. Thor: Ragnarok

    8. +
    9. The Raid Berandal

    10. +
    11. Django Unchained

    12. +
    13. 27 Days later

    14. +
    15. A Quiet Place

    16. +
    17. Shawshank Redemption

    18. +
    19. The Fast and The Furious saga

    20. + +
    + +
+ \ No newline at end of file diff --git a/lab-01/main.css b/lab-01/main.css index e69de29..6d7a590 100644 --- a/lab-01/main.css +++ b/lab-01/main.css @@ -0,0 +1,17 @@ +body { + margin: 0 auto; + background-color: darkgray; +} + +h1 { + font-family: Verdana, Geneva, Tahoma, sans-serif; +} + +h2 { + font-family: Verdana, Geneva, Tahoma, sans-serif; +} + +li { + font-family: Verdana, Geneva, Tahoma, sans-serif; + margin: 0 auto; +} \ No newline at end of file diff --git a/lab-01/main.js b/lab-01/main.js index 7d571cb..a269ea9 100644 --- a/lab-01/main.js +++ b/lab-01/main.js @@ -1,8 +1,42 @@ +console.log(alert("Let's go")); + +//These are the prompts section (pop-ups) let name = prompt("What's your name?"); -let origin = prompt('Where are you from?') -let coder = prompt('Are you a coder?') +let movies = prompt('Do you like movies?'); +let coder = prompt('Are you a coder?'); +let faveNum = prompt('What is your favorite number?'); +let sports = prompt('Do you play sports?'); +let born = prompt('Are you born in the United States?'); + +//The "if" functions section +if(name){ + document.getElementById('name').innerText = name; +} + +if(movies){ + document.getElementById('movies').innerText = movies; +} + +if(coder){ + document.getElementById('coder').innerText = coder; +} + +if(faveNum){ + document.getElementById('faveNum').innerText = faveNum; +} + +if(sports){ + document.getElementById('sports').innerText = sports; +} + +if(born){ + document.getElementById('born').innerText = born; +} -console.log(name) -console.log(origin) -console.log(coder) +//This section is where I put my console.log(s) +console.log(name); +console.log(movies); +console.log(coder); +console.log(faveNum); +console.log(born); From ab5402c5fbbb6bf534b9421213ff4021826ad188 Mon Sep 17 00:00:00 2001 From: Adrian Date: Thu, 5 Jul 2018 19:44:24 -0400 Subject: [PATCH 4/8] Get started with cookies --- lab-04 cookies/index.html | 14 ++++++++++++ lab-04 cookies/main.css | 0 lab-04 cookies/main.js | 48 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 lab-04 cookies/index.html create mode 100644 lab-04 cookies/main.css create mode 100644 lab-04 cookies/main.js diff --git a/lab-04 cookies/index.html b/lab-04 cookies/index.html new file mode 100644 index 0000000..0affc85 --- /dev/null +++ b/lab-04 cookies/index.html @@ -0,0 +1,14 @@ + + + + + + Cookie Beatdown + + + + + + + + \ No newline at end of file diff --git a/lab-04 cookies/main.css b/lab-04 cookies/main.css new file mode 100644 index 0000000..e69de29 diff --git a/lab-04 cookies/main.js b/lab-04 cookies/main.js new file mode 100644 index 0000000..6f31965 --- /dev/null +++ b/lab-04 cookies/main.js @@ -0,0 +1,48 @@ +let storeOne = { + name: 'Chocolate Store', + product: 'Chocolate Cookies', + costumers: 150, + employees: 5, + location: 'Bethesda', + createCostumer: function() { + console.log(this.product); + } + +} + +let storeTwo = { + name: 'Vanilla Store', + product: 'Vanilla Cookies', + costumers: 200, + employees: 10, + location: 'Baltimore', + getProduct: function() { + console.log(this.product); + } +} + +//array of objects +let objArray = [storeOne, storeTwo]; + +//creating elements +let elBody = document.getElementById('myBody'); +let elTable = document.createElement('table'); +console.log(elTable); +elTable.setAttribute('class', 'class-table'); +elBody.appendChild(elTable); + +//looping through the array of objects +for(let i = 0; i < objArray.length; i++) { + let elRow = document.createElement('tr'); + elRow.textContent = objectArray[i].name; + + + + + 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].costumers; + console.log(objArray[i]); +} \ No newline at end of file From cdfb78f8cf8245bdd8b0861087be726725ffadff Mon Sep 17 00:00:00 2001 From: Adrian Date: Sat, 7 Jul 2018 14:06:51 -0400 Subject: [PATCH 5/8] constructor cookies --- lab-04 cookies/index.html | 2 +- lab-04 cookies/main.js | 90 ++++++++++++++++++++++----------------- 2 files changed, 52 insertions(+), 40 deletions(-) diff --git a/lab-04 cookies/index.html b/lab-04 cookies/index.html index 0affc85..96ac452 100644 --- a/lab-04 cookies/index.html +++ b/lab-04 cookies/index.html @@ -6,7 +6,7 @@ Cookie Beatdown - + diff --git a/lab-04 cookies/main.js b/lab-04 cookies/main.js index 6f31965..32689df 100644 --- a/lab-04 cookies/main.js +++ b/lab-04 cookies/main.js @@ -1,48 +1,60 @@ -let storeOne = { - name: 'Chocolate Store', - product: 'Chocolate Cookies', - costumers: 150, - employees: 5, - location: 'Bethesda', - createCostumer: function() { - console.log(this.product); - } - +function Store(name, location, product, costumers) { + this.storeName = name; + this.storeLoc = location; + this.storeProduct = product; + this.storeCostumers = costumers; } -let storeTwo = { - name: 'Vanilla Store', - product: 'Vanilla Cookies', - costumers: 200, - employees: 10, - location: 'Baltimore', - getProduct: function() { - console.log(this.product); - } -} +let storeOne = new Store('Vanilla Store', 'Baltimore', 'Vanilla Cookies', 150); +let storeTwo = new Store('Chocolate Store', 'Bethesda', 'Chocolate Cookies', 180); + +console.log(storeOne); +console.log(storeTwo); +// let storeOne = { +// name: 'Chocolate Store', +// product: 'Chocolate Cookies', +// costumers: 150, +// employees: 5, +// location: 'Bethesda', +// createCostumer: function() { +// console.log(this.product); +// } + +// } + +// let storeTwo = { +// name: 'Vanilla Store', +// product: 'Vanilla Cookies', +// costumers: 200, +// employees: 10, +// location: 'Baltimore', +// getProduct: function() { +// console.log(this.product); +// } +// } -//array of objects -let objArray = [storeOne, storeTwo]; +// //array of objects +// let objArray = [storeOne, storeTwo]; -//creating elements -let elBody = document.getElementById('myBody'); -let elTable = document.createElement('table'); -console.log(elTable); -elTable.setAttribute('class', 'class-table'); -elBody.appendChild(elTable); +// //creating elements +// let elBody = document.getElementById('myBody'); +// let elTable = document.createElement('table'); +// console.log(elTable); +// elTable.setAttribute('class', 'class-table'); +// elBody.appendChild(elTable); -//looping through the array of objects -for(let i = 0; i < objArray.length; i++) { - let elRow = document.createElement('tr'); - elRow.textContent = objectArray[i].name; +// //looping through the array of objects +// for(let i = 0; i < objArray.length; i++) { +// let elRow = document.createElement('tr'); +// elRow.textContent = objectArray[i].name; - 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].costumers; - console.log(objArray[i]); -} \ No newline at end of file +// 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].costumers; +// console.log(objArray[i]); +// } \ No newline at end of file From d8598100df4ee618a7c2c5726438719211b0e8f4 Mon Sep 17 00:00:00 2001 From: Adrian Date: Sat, 7 Jul 2018 14:52:08 -0400 Subject: [PATCH 6/8] constructor cookies --- lab-04 cookies/main.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lab-04 cookies/main.js b/lab-04 cookies/main.js index 32689df..4604666 100644 --- a/lab-04 cookies/main.js +++ b/lab-04 cookies/main.js @@ -8,6 +8,16 @@ function Store(name, location, product, costumers) { let storeOne = new Store('Vanilla Store', 'Baltimore', 'Vanilla Cookies', 150); let storeTwo = new Store('Chocolate Store', 'Bethesda', 'Chocolate Cookies', 180); +console.log(storeOne); +console.log(storeTwo); + +Store.prototype.price = 7.30; +Store.prototype.revenue = 0; + +Store.prototype.calRevenue = function(){ + this.revenue = this.costumers*this.price; +} + console.log(storeOne); console.log(storeTwo); // let storeOne = { From 26a8b21d681b58a81f675b41a6bf8fe1a4cf50ed Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 10 Jul 2018 20:29:50 -0400 Subject: [PATCH 7/8] cookieStoreForm --- cookie-stand/index.html | 30 ++++++++++++++++++++++++++++++ cookie-stand/main.css | 16 ++++++++++++++++ cookie-stand/main.js | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 cookie-stand/index.html create mode 100644 cookie-stand/main.css create mode 100644 cookie-stand/main.js diff --git a/cookie-stand/index.html b/cookie-stand/index.html new file mode 100644 index 0000000..12e051e --- /dev/null +++ b/cookie-stand/index.html @@ -0,0 +1,30 @@ + + + + + + Page Title + + + + + + + +

Cookie Stand Beatdown!

+ + +
+ Name:

+ Product:

+ Location:

+ Supplies:

+ Sold:

+ + + +
+ + + + \ No newline at end of file diff --git a/cookie-stand/main.css b/cookie-stand/main.css new file mode 100644 index 0000000..3d8670a --- /dev/null +++ b/cookie-stand/main.css @@ -0,0 +1,16 @@ +* { + background-color: darkgrey; + font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; +} + +.button { + background-color: lightgrey; + border-radius: 15px; + color: black; + padding: 15px 32px; + text-align: center; + text-decoration: none; + font-size: 13px; + margin: 0 auto; + cursor: pointer; +} \ No newline at end of file diff --git a/cookie-stand/main.js b/cookie-stand/main.js new file mode 100644 index 0000000..228ca2b --- /dev/null +++ b/cookie-stand/main.js @@ -0,0 +1,41 @@ +//Constructor +function Store(name, product, location, supplies, sold) { + this.name = name; + this.product = product; + this.location = location; + this.supplies = supplies; + this.sold = sold; + + this.checkSales = function() { + return this.supplies - this.sold; + }; +}; + +//Store Array +let storeArray = []; + +//getting element of form from html +let form = document.getElementById('storeInfo'); + +//Instances +let vanCookie = new Store ('Vanilla Store', 'Vanilla Cookies', 'Baltimore', 120, 58); +storeArray.push(vanCookie); +let choCookie = new Store ('Chocolate Store', 'Chocolate Cookies', 'Bethesda', 170, 110); +storeArray.push(choCookie); + +//form user variables +let userStoreName = form.storeName; +let userStoreProduct = form.storeProduct; +let userStoreLoc = form.storeLoc; +let userStoreSup = form.storeSup; +let userStoreSold = form.storeSold; + +//addEventListener +form.addEventListener('submit', function(event) { + event.preventDefault() + let newStore = new Store(userStoreName.value, userStoreProduct.value, userStoreLoc.value, userStoreSup.value, userStoreSold.value); + storeArray.push(newStore); + console.log(storeArray); +}); + +console.log(storeArray); From b135ad0e10d98e3e422c7af5153019d818344944 Mon Sep 17 00:00:00 2001 From: Adrian Date: Thu, 12 Jul 2018 20:48:46 -0400 Subject: [PATCH 8/8] july 12 lab --- cookie-stand/index.html | 36 ++++++++++++++++++++--------- cookie-stand/main.css | 33 ++++++++++++++++++++++++--- cookie-stand/main.js | 50 ++++++++++++++++++++++++++++++++--------- 3 files changed, 95 insertions(+), 24 deletions(-) diff --git a/cookie-stand/index.html b/cookie-stand/index.html index 12e051e..4efded9 100644 --- a/cookie-stand/index.html +++ b/cookie-stand/index.html @@ -3,28 +3,44 @@ - Page Title + Cookie Boogie - +

Cookie Stand Beatdown!

+
- Name:

- Product:

- Location:

- Supplies:

- Sold:

+
+ +

+ + Product: +

+ + Location: +

+ + Supplies: +

+ + Sold: +

+
+ - +
+ +
+
- - \ No newline at end of file + + \ No newline at end of file diff --git a/cookie-stand/main.css b/cookie-stand/main.css index 3d8670a..28d1354 100644 --- a/cookie-stand/main.css +++ b/cookie-stand/main.css @@ -1,5 +1,5 @@ * { - background-color: darkgrey; + background-color: gray; font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; } @@ -8,9 +8,36 @@ border-radius: 15px; color: black; padding: 15px 32px; - text-align: center; + text-align: right; text-decoration: none; font-size: 13px; margin: 0 auto; cursor: pointer; -} \ No newline at end of file + font-weight: bold; +} + +#formDiv { + border: 2px solid black; + margin: 10px; + padding: 20px; + width: 260px; + border-radius: 5px; +} + +.label { + width: 200px; + padding-right: 10px; +} + +.bars { + border: 2px solid red; + background-color: black; + color: white; + border-radius: 8px; +} + +#submit{ + width: 300px; + text-align: right; +} + diff --git a/cookie-stand/main.js b/cookie-stand/main.js index 228ca2b..9679c8c 100644 --- a/cookie-stand/main.js +++ b/cookie-stand/main.js @@ -8,34 +8,62 @@ function Store(name, product, location, supplies, sold) { this.checkSales = function() { return this.supplies - this.sold; + console.log(checkSales); }; }; +//getting element of form from html +let elStore = document.getElementById('storeInfo'); + +//form user variables +let userStoreName = elStore.storeName; +let userStoreProduct = elStore.storeProduct; +let userStoreLoc = elStore.storeLoc; +let userStoreSup = elStore.storeSup; +let userStoreSold = elStore.storeSold; + +//creating a table +let elBody = document.getElementById('newBody'); +let elTable = document.createElement('table'); +elBody.appendChild(elTable); +let elRow = document.createElement('tr'); +elTable.appendChild(elRow); +let elTh = document.createElement('th'); + +elRow.appendChild(elTh); +elTh.innerText = userStoreName.value; + +let elTd = document.createElement('td'); +elRow.appendChild(elTd); +elTd.innerText = userStoreProduct.value; + +let elTd2 = document.createElement('td'); +elRow.appendChild(elTd2); +elTd.innerText = userStoreLoc.value; + +let elTd3 = document.createElement('td'); +elRow.appendChild(elTd3); +elTd.innerText = userStoreSup.value; + //Store Array let storeArray = []; -//getting element of form from html -let form = document.getElementById('storeInfo'); - //Instances let vanCookie = new Store ('Vanilla Store', 'Vanilla Cookies', 'Baltimore', 120, 58); storeArray.push(vanCookie); let choCookie = new Store ('Chocolate Store', 'Chocolate Cookies', 'Bethesda', 170, 110); storeArray.push(choCookie); - -//form user variables -let userStoreName = form.storeName; -let userStoreProduct = form.storeProduct; -let userStoreLoc = form.storeLoc; -let userStoreSup = form.storeSup; -let userStoreSold = form.storeSold; +let cashCookie = new Store ('Cashew Store', 'Cashew Cookies', 'Rockville', 160, 90); +storeArray.push(cashCookie); //addEventListener -form.addEventListener('submit', function(event) { +elStore.addEventListener('submit', function(event) { event.preventDefault() let newStore = new Store(userStoreName.value, userStoreProduct.value, userStoreLoc.value, userStoreSup.value, userStoreSold.value); storeArray.push(newStore); console.log(storeArray); + console.log(newStore); }); console.log(storeArray); +