Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pokemon-filter
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
Container 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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MAHDIR Safaa
pokemon-filter
Commits
c55ae7a2
Commit
c55ae7a2
authored
2 months ago
by
MAHDIR Safaa
Browse files
Options
Downloads
Plain Diff
Merge branch 'tache1' into 'main'
feat: affichage d'une liste statique de 5 Pokémon Closes
#1
See merge request
!1
parents
824cd134
c222495f
No related branches found
No related tags found
1 merge request
!1
feat: affichage d'une liste statique de 5 Pokémon
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
index.html
+14
-0
14 additions, 0 deletions
index.html
script.js
+21
-0
21 additions, 0 deletions
script.js
styles.css
+18
-0
18 additions, 0 deletions
styles.css
with
53 additions
and
0 deletions
index.html
0 → 100644
+
14
−
0
View file @
c55ae7a2
<!DOCTYPE html>
<html
lang=
"fr"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
Pokémon Filter
</title>
<link
rel=
"stylesheet"
href=
"styles.css"
>
</head>
<body>
<h1>
Liste de Pokémon
</h1>
<ul
id=
"pokemon-list"
></ul>
<script
src=
"script.js"
></script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
script.js
0 → 100644
+
21
−
0
View file @
c55ae7a2
const
pokemons
=
[
{
name
:
"
Beedrill
"
,
weight
:
29.5
,
height
:
1
},
{
name
:
"
Blastoise
"
,
weight
:
85.5
,
height
:
1.6
},
{
name
:
"
Bulbasaur
"
,
weight
:
6.9
,
height
:
0.7
},
{
name
:
"
Butterfree
"
,
weight
:
32
,
height
:
1.1
},
{
name
:
"
Caterpie
"
,
weight
:
2.9
,
height
:
0.3
}
];
function
displayPokemonList
()
{
const
listElement
=
document
.
getElementById
(
"
pokemon-list
"
);
listElement
.
innerHTML
=
""
;
pokemons
.
forEach
(
pokemon
=>
{
const
listItem
=
document
.
createElement
(
"
li
"
);
listItem
.
textContent
=
`
${
pokemon
.
name
}
- Poids:
${
pokemon
.
weight
}
kg - Taille:
${
pokemon
.
height
}
m`
;
listElement
.
appendChild
(
listItem
);
});
}
// Afficher la liste au chargement de la page
document
.
addEventListener
(
"
DOMContentLoaded
"
,
displayPokemonList
);
This diff is collapsed.
Click to expand it.
styles.css
0 → 100644
+
18
−
0
View file @
c55ae7a2
body
{
font-family
:
Georgia
,
sans-serif
;
}
h1
{
color
:
darkcyan
;
}
ul
{
list-style-type
:
none
;
padding
:
0
;
}
li
{
margin
:
10px
;
padding
:
10px
;
border-radius
:
5px
;
}
\ 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