odin-restaurant/src/pages/about.js

32 lines
1.5 KiB
JavaScript

import generateElement from "../modules/generateElement"
import aboutImg from '../img/about.jpg';
export default function() {
const contentDiv = document.createElement("div");
contentDiv.id = "content";
const start = generateElement({element:"section", id: "start"});
let aboutImgTag = new Image();
aboutImgTag.src = aboutImg;
const titleH1 = generateElement({element:"h1", textContent: "About"});
let span = generateElement({element:"span", textContent: "Lorem ipsum, dolor sit amet consectetur adipisicing elit. Doloribus pariatur eum ipsa necessitatibus explicabo sapiente illum! Iusto maxime veniam nihil deserunt quia soluta, doloremque beatae distinctio totam quibusdam quisquam velit?"});
start.append(aboutImgTag, titleH1, span);
contentDiv.append(start);
for (let i = 0; i < 4; i++) {
let s = generateElement({element:"section", className: "showcase"});
let aboutImgTag = new Image();
aboutImgTag.src = aboutImg;
let span = generateElement({element:"span", textContent: "Lorem ipsum, dolor sit amet consectetur adipisicing elit. Doloribus pariatur eum ipsa necessitatibus explicabo sapiente illum! Iusto maxime veniam nihil deserunt quia soluta, doloremque beatae distinctio totam quibusdam quisquam velit?"});
if (i % 2 == 0) {
s.append(aboutImgTag, span);
} else {
s.append(span, aboutImgTag);
}
contentDiv.append(s);
}
return contentDiv;
}