Skip to content
Snippets Groups Projects
Commit b42e89ce authored by Eliott Collin's avatar Eliott Collin
Browse files

use build/main.js instead of src/main.js

parent 2b35018e
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@
<link rel="stylesheet" href="css/pizzaList.css">
<link rel="stylesheet" href="css/footer.css">
<script src="src/main.js" defer></script>
<script src="build/main.js" defer></script>
</head>
<body>
<header>
......
const data = [
{
name: 'Regina',
......@@ -22,55 +21,6 @@ const data = [
image: 'https://images.unsplash.com/photo-1458642849426-cfb724f15ef7?fit=crop&w=500&h=300',
}
];
/*
const html = data.map(pizza => {
const url = pizza.image;
return `<article class="pizzaThumbnail">
<a href="${url}">
<img src="${url}" alt="${pizza.name}"/>
<section>
<h4>${pizza.name}</h4>
<ul>
<li>Prix petit format : ${pizza.price_small} €</li>
<li>Prix grand format : ${pizza.price_large} €</li>
</ul>
</section>
</a>
</article>`;
});
html.forEach(element => document.querySelector('.pageContent').innerHTML += element);
*/
/*
const html = data.map(name => {
const url = `images/${name.toLowerCase()}.jpg`;
return `<article class="pizzaThumbnail">
<a href="${url}">
<img src="${url}" alt="${name}"/>
<section>${name}</section>
</a>
</article>`;
});
html.forEach(element => document.querySelector('.pageContent').innerHTML += element);
*/
/*
data.forEach(name => {
const url = `images/${name.toLowerCase()}.jpg`;
document.querySelector('.pageContent').innerHTML += `<article class="pizzaThumbnail">
<a href="${url}">
<img src="${url}" alt="${name}"/>
<section>${name}</section>
</a>
</article>`;
});
*/
const html = data.reduce((previous, current) => {
return previous + `<article class="pizzaThumbnail">
......@@ -87,5 +37,4 @@ const html = data.reduce((previous, current) => {
</article>`;
}, "");
console.log(html);
document.querySelector('.pageContent').innerHTML = html;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment