Skip to content
Snippets Groups Projects
Commit 19ef2cbc authored by Victor Mougel's avatar Victor Mougel
Browse files

Compilation babel + corretion E.2 ou le nom des pizzas était Regina pour toutes

parent aed4b09e
No related branches found
No related tags found
No related merge requests found
{
"presets": ["@babel/env"]
}
"use strict";
var name = "Regina";
var url = "images/".concat(name.toLowerCase(), ".jpg");
console.log(url);
var html = ' ';
var data = [{
name: 'Regina',
base: 'tomate',
price_small: 6.5,
price_large: 9.95,
image: 'https://images.unsplash.com/photo-1532246420286-127bcd803104?fit=crop&w=500&h=300'
}, {
name: 'Napolitaine',
base: 'tomate',
price_small: 6.5,
price_large: 8.95,
image: 'https://images.unsplash.com/photo-1562707666-0ef112b353e0?&fit=crop&w=500&h=300'
}, {
name: 'Spicy',
base: 'crème',
price_small: 5.5,
price_large: 8,
image: 'https://images.unsplash.com/photo-1458642849426-cfb724f15ef7?fit=crop&w=500&h=300'
}]; //Methode foreEach
data.forEach(function (element) {
return html += "<article class=\"pizzaThumbnail\">\n <a href=\"".concat(element.image, "\">\n <img src=\"").concat(element.image, "\"/>\n <section>\n <h4>").concat(element.name, "</h4>\n <ul>\n <li>Prix petit format : ").concat(element.price_small + '0', " \u20AC</li>\n <li>Prix grand format : ").concat(element.price_large, " \u20AC</li>\n </ul>\n </section>\n </a>\n </article>");
});
document.querySelector('.pageContent').innerHTML = html;
\ No newline at end of file
{"version":3,"sources":["../src/main.js"],"names":["name","url","toLowerCase","console","log","html","data","base","price_small","price_large","image","forEach","element","document","querySelector","innerHTML"],"mappings":";;AAAA,IAAMA,IAAI,GAAC,QAAX;AACA,IAAMC,GAAG,oBAAWD,IAAI,CAACE,WAAL,EAAX,SAAT;AACAC,OAAO,CAACC,GAAR,CAAYH,GAAZ;AAEA,IAAII,IAAI,GAAC,GAAT;AAEA,IAAMC,IAAI,GAAG,CACZ;AACCN,EAAAA,IAAI,EAAE,QADP;AAECO,EAAAA,IAAI,EAAE,QAFP;AAGCC,EAAAA,WAAW,EAAE,GAHd;AAICC,EAAAA,WAAW,EAAE,IAJd;AAKCC,EAAAA,KAAK,EAAE;AALR,CADY,EAQZ;AACCV,EAAAA,IAAI,EAAE,aADP;AAECO,EAAAA,IAAI,EAAE,QAFP;AAGCC,EAAAA,WAAW,EAAE,GAHd;AAICC,EAAAA,WAAW,EAAE,IAJd;AAKCC,EAAAA,KAAK,EAAE;AALR,CARY,EAeZ;AACCV,EAAAA,IAAI,EAAE,OADP;AAECO,EAAAA,IAAI,EAAE,OAFP;AAGCC,EAAAA,WAAW,EAAE,GAHd;AAICC,EAAAA,WAAW,EAAE,CAJd;AAKCC,EAAAA,KAAK,EAAE;AALR,CAfY,CAAb,C,CAyBA;;AACAJ,IAAI,CAACK,OAAL,CAAa,UAAAC,OAAO;AAAA,SAAGP,IAAI,wFACYK,KADZ,6DAEiBA,KAFjB,8NAMwCF,WAAW,GAAC,GANpD,2FAOuCC,WAPvC,kLAAP;AAAA,CAApB;AAcAI,QAAQ,CAACC,aAAT,CAAuB,cAAvB,EAAuCC,SAAvC,GAAmDV,IAAnD","sourcesContent":["const name=\"Regina\";\r\nconst url=`images/${name.toLowerCase()}.jpg`;\r\nconsole.log(url);\r\n\r\nlet html=' ';\r\n\r\nconst data = [\r\n\t{\r\n\t\tname: 'Regina',\r\n\t\tbase: 'tomate',\r\n\t\tprice_small: 6.5,\r\n\t\tprice_large: 9.95,\r\n\t\timage: 'https://images.unsplash.com/photo-1532246420286-127bcd803104?fit=crop&w=500&h=300'\r\n\t},\r\n\t{\r\n\t\tname: 'Napolitaine',\r\n\t\tbase: 'tomate',\r\n\t\tprice_small: 6.5,\r\n\t\tprice_large: 8.95,\r\n\t\timage: 'https://images.unsplash.com/photo-1562707666-0ef112b353e0?&fit=crop&w=500&h=300'\r\n\t},\r\n\t{\r\n\t\tname: 'Spicy',\r\n\t\tbase: 'crème',\r\n\t\tprice_small: 5.5,\r\n\t\tprice_large: 8,\r\n\t\timage: 'https://images.unsplash.com/photo-1458642849426-cfb724f15ef7?fit=crop&w=500&h=300',\r\n\t}\r\n];\r\n\r\n\r\n//Methode foreEach\r\ndata.forEach(element =>html+=`<article class=\"pizzaThumbnail\">\r\n <a href=\"${image}\">\r\n <img src=\"${image}\"/>\r\n <section>\r\n <h4>Regina</h4>\r\n <ul>.\r\n <li>Prix petit format : ${(price_small+'0')} €</li>\r\n <li>Prix grand format : ${price_large} €</li>\r\n </ul>\r\n </section>\r\n </a>\r\n </article>`);\r\n\r\n\r\ndocument.querySelector('.pageContent').innerHTML = html;"],"file":"main.js"}
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<link rel="stylesheet" href="css/news.css"> <link rel="stylesheet" href="css/news.css">
<link rel="stylesheet" href="css/pizzaList.css"> <link rel="stylesheet" href="css/pizzaList.css">
<link rel="stylesheet" href="css/footer.css"> <link rel="stylesheet" href="css/footer.css">
<script src="src/main.js" defer></script> <script src="build/main.js" defer></script>
</head> </head>
<body> <body>
<header> <header>
......
This diff is collapsed.
{
"name": "pizzaland",
"version": "1.0.0",
"description": "<img src=\"images/readme/header.jpg\">",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@gitlab-ssh.univ-lille.fr:victor.mougel.etu/tp1.git"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/cli": "^7.16.8",
"@babel/core": "^7.16.12",
"@babel/preset-env": "^7.16.11"
}
}
const name="Regina";
const url=`images/${name.toLowerCase()}.jpg`;
console.log(url);
let html=' '; let html=' ';
const data = [ const data = [
...@@ -34,7 +30,7 @@ data.forEach(element =>html+=`<article class="pizzaThumbnail"> ...@@ -34,7 +30,7 @@ data.forEach(element =>html+=`<article class="pizzaThumbnail">
<a href="${element.image}"> <a href="${element.image}">
<img src="${element.image}"/> <img src="${element.image}"/>
<section> <section>
<h4>Regina</h4> <h4>${element.name}</h4>
<ul> <ul>
<li>Prix petit format : ${(element.price_small+'0')} €</li> <li>Prix petit format : ${(element.price_small+'0')} €</li>
<li>Prix grand format : ${element.price_large} €</li> <li>Prix grand format : ${element.price_large} €</li>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment