Merge branch 'dev' into films

This commit is contained in:
rasoirnoir 2021-10-18 20:08:06 +02:00
commit 951d701a8e
No known key found for this signature in database
GPG Key ID: 995E4575ADB981A3
17 changed files with 15772 additions and 15813 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

BIN
assets/backgroung grogu.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

BIN
assets/backgroung mando.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

1
assets/images Normal file
View File

@ -0,0 +1 @@

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

BIN
assets/starry sky.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -5,7 +5,6 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles/style.css"> <link rel="stylesheet" href="styles/style.css">
<script src="scripts/util.js"></script>
<title>Accueil</title> <title>Accueil</title>
</head> </head>
<body> <body>

View File

@ -482,7 +482,7 @@
}, },
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"start": "parcel index.html" "start": "parcel planets.html"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -5,6 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles/style.css"> <link rel="stylesheet" href="styles/style.css">
<script src="scripts/planets.js" type="module" defer></script>
<title>Planets</title> <title>Planets</title>
</head> </head>
<body> <body>
@ -18,6 +19,10 @@
</ul> </ul>
</nav> </nav>
</section> </section>
<section class="results">
</section>
</body> </body>
</html> </html>

7
scripts/planets.js Normal file
View File

@ -0,0 +1,7 @@
import { api_call } from "./util";
console.log('planet.js loaded');
api_call("planets", console.log);

View File

@ -7,7 +7,7 @@ const URL = "https://swapi.dev/api";
* @param {string} endpoint l'endpoint à interroger (ex: planets) * @param {string} endpoint l'endpoint à interroger (ex: planets)
* @param {function} callback La fonction qui traitera la réponse JSON en retour * @param {function} callback La fonction qui traitera la réponse JSON en retour
*/ */
const api_call = (endpoint, callback) => { export const api_call = (endpoint, callback) => {
fetch(`${URL}/${endpoint}`) fetch(`${URL}/${endpoint}`)
.then(response => { .then(response => {
return response.json(); return response.json();
@ -15,4 +15,5 @@ const api_call = (endpoint, callback) => {
.then(jsonResp => { .then(jsonResp => {
callback(jsonResp); callback(jsonResp);
}); });
} }