diff --git a/cookie-stand/index.html b/cookie-stand/index.html new file mode 100644 index 0000000..4efded9 --- /dev/null +++ b/cookie-stand/index.html @@ -0,0 +1,46 @@ + + + + + + Cookie Boogie + + + + + + + +

Cookie Stand Beatdown!

+ + + +
+ +
+ +

+ + 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..28d1354 --- /dev/null +++ b/cookie-stand/main.css @@ -0,0 +1,43 @@ +* { + background-color: gray; + 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: right; + text-decoration: none; + font-size: 13px; + margin: 0 auto; + cursor: pointer; + 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 new file mode 100644 index 0000000..9679c8c --- /dev/null +++ b/cookie-stand/main.js @@ -0,0 +1,69 @@ +//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; + 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 = []; + +//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); +let cashCookie = new Store ('Cashew Store', 'Cashew Cookies', 'Rockville', 160, 90); +storeArray.push(cashCookie); + +//addEventListener +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); + diff --git a/lab-01/index.html b/lab-01/index.html new file mode 100644 index 0000000..3e5f5c3 --- /dev/null +++ b/lab-01/index.html @@ -0,0 +1,41 @@ + + + + + + About Me + + + + + +

About Me

+ + + + + \ No newline at end of file diff --git a/lab-01/main.css b/lab-01/main.css new file mode 100644 index 0000000..6d7a590 --- /dev/null +++ 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 new file mode 100644 index 0000000..a269ea9 --- /dev/null +++ b/lab-01/main.js @@ -0,0 +1,42 @@ +console.log(alert("Let's go")); + +//These are the prompts section (pop-ups) +let name = prompt("What's your name?"); +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; +} + +//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); + diff --git a/lab-04 cookies/index.html b/lab-04 cookies/index.html new file mode 100644 index 0000000..96ac452 --- /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..4604666 --- /dev/null +++ b/lab-04 cookies/main.js @@ -0,0 +1,70 @@ +function Store(name, location, product, costumers) { + this.storeName = name; + this.storeLoc = location; + this.storeProduct = product; + this.storeCostumers = 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 = { +// 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