Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TP1 - Premiers pas en JS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eliott Collin
TP1 - Premiers pas en JS
Commits
b42e89ce
Commit
b42e89ce
authored
3 years ago
by
Eliott Collin
Browse files
Options
Downloads
Patches
Plain Diff
use build/main.js instead of src/main.js
parent
2b35018e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
index.html
+1
-1
1 addition, 1 deletion
index.html
src/main.js
+0
-51
0 additions, 51 deletions
src/main.js
with
1 addition
and
52 deletions
index.html
+
1
−
1
View file @
b42e89ce
...
...
@@ -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>
...
...
This diff is collapsed.
Click to expand it.
src/main.js
+
0
−
51
View file @
b42e89ce
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment