js-restaurant/src/js/menu.js
2023-05-04 12:53:09 -07:00

118 lines
No EOL
5.2 KiB
JavaScript
Executable file

export function makeMenuWindow() {
// makes divs
const columnOne = document.createElement('div');
const colOneOne = document.createElement('div');
const colOneTwo = document.createElement('div');
const c12Item = document.createElement('div');
const c12Price = document.createElement('div');
const colOneThree = document.createElement('div');
const c13Item = document.createElement('div');
const c13Price = document.createElement('div');
const colOneFour = document.createElement('div');
const c14Image = document.createElement('img');
const columnTwo = document.createElement('div');
const columnTwoHeader = document.createElement('div');
const columnTwoContent = document.createElement('div');
const c22 = document.createElement('div');
const c22Item = document.createElement('div');
const c22Price = document.createElement('div');
const c23 = document.createElement('div');
const c23Item = document.createElement('div');
const c23Price = document.createElement('div');
const c24 = document.createElement('div');
const c24Item = document.createElement('div');
const c24Price = document.createElement('div');
const c25 = document.createElement('div');
const c25Item = document.createElement('div');
const c25Price = document.createElement('div');
const columnThree = document.createElement('div');
const c31 = document.createElement('div');
const columnThreeContent = document.createElement('div');
const c32 = document.createElement('div');
const c32Item = document.createElement('div');
const c32Price = document.createElement('div');
const c33 = document.createElement('div');
const c33Item = document.createElement('div');
const c33Price = document.createElement('div');
const c34 = document.createElement('div');
const c34Item = document.createElement('div');
const c34Price = document.createElement('div');
const c35 = document.createElement('div');
const c35Item = document.createElement('div');
const c35Price = document.createElement('div');
// sets attributes
columnOne.id = "column-one-menu";
columnTwo.id = "column-two-menu";
columnThree.id = "column-three-menu";
c12Item.textContent = "Fresh oysters (12x)";
c12Price.textContent = "$19.99";
c13Item.textContent = "Cedar plank smoked Terriyaki Salmon with Asian stir fry over white rice";
c13Price.textContent = "$29.99";
c14Image.title = "Photo by Alice Pasqual on Unsplash";
c14Image.src = "../src/img/salmon.jpg";
c14Image.id = "c14image";
columnTwoHeader.textContent = "menu";
columnTwoHeader.id = "columnTwoHeader";
columnTwoContent.id = "columnTwoContent";
c22Item.textContent = "Beer-battered Fish and Chips";
c22Price.textContent = "$19.99";
c23Item.textContent = "Baja-style fish tacos (3x)";
c23Price.textContent = "$14.99";
c24Item.textContent = "Local Sandabs with House Fries and Tartar Sauce";
c24Price.textContent = "$24.99";
c25Item.textContent = "Seared Ahi Tuna with Asian fusion salad over Japanese-style rice";
c25Price.textContent = "$29.99";
columnThreeContent.id = "columnThreeContent";
c32Item.textContent = "Baked Tilapia with zesty lemon over cauliflower rice and greens";
c32Price.textContent = "$24.99";
c33Item.textContent = "Halibut with scalloped potatoes and green beans";
c33Price.textContent = "$24.99";
c34Item.textContent = "Chef's Special";
c34Price.textContent = "$29.99";
c35Item.textContent = "Catch of the Day";
c35Price.textContent = "varies";
// appends divs to DOM
const cardBody = document.querySelector(".card-body");
cardBody.appendChild(columnOne);
columnOne.appendChild(colOneOne);
columnOne.appendChild(colOneTwo);
colOneTwo.appendChild(c12Item);
colOneTwo.appendChild(c12Price);
columnOne.appendChild(colOneThree);
colOneThree.appendChild(c13Item);
colOneThree.appendChild(c13Price);
columnOne.appendChild(colOneFour);
colOneFour.appendChild(c14Image);
cardBody.appendChild(columnTwo);
columnTwo.appendChild(columnTwoHeader);
columnTwo.appendChild(columnTwoContent);
columnTwoContent.appendChild(c22);
c22.appendChild(c22Item);
c22.appendChild(c22Price);
columnTwoContent.appendChild(c23);
c23.appendChild(c23Item);
c23.appendChild(c23Price);
columnTwoContent.appendChild(c24);
c24.appendChild(c24Item);
c24.appendChild(c24Price);
columnTwoContent.appendChild(c25);
c25.appendChild(c25Item);
c25.appendChild(c25Price);
cardBody.appendChild(columnThree);
columnThree.appendChild(c31);
columnThree.appendChild(columnThreeContent);
columnThreeContent.appendChild(c32);
c32.appendChild(c32Item);
c32.appendChild(c32Price);
columnThreeContent.appendChild(c33);
c33.appendChild(c33Item);
c33.appendChild(c33Price);
columnThreeContent.appendChild(c34);
c34.appendChild(c34Item);
c34.appendChild(c34Price);
columnThreeContent.appendChild(c35);
c35.appendChild(c35Item);
c35.appendChild(c35Price);
}