diff --git a/html/projet_detail.html b/html/projet_detail.html index a9abccb..71ebbd8 100644 --- a/html/projet_detail.html +++ b/html/projet_detail.html @@ -11,49 +11,58 @@ integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" /> +
-
+
-

+

- +
- - - + + +
date Hygrométrie température dateHygrométrietempérature
+
+ Description of the image - - - - diff --git a/index.html b/index.html index 9480dcf..bdab617 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,6 @@
-
@@ -43,9 +42,6 @@ document.getElementById("video").addEventListener('click', () => { window.location.href = 'html/videos.html'; }); - document.getElementById("projet").addEventListener('click', () => { - window.location.href = 'html/projet_detail.html'; - }); }); diff --git a/js/globals.js b/js/globals.js index 4795d66..2960a96 100644 --- a/js/globals.js +++ b/js/globals.js @@ -42,6 +42,17 @@ function getDataProjectMetricsFromApi(id) { }); } +function getDataProjectImagesFromApi(id) { + return $.ajax({ + url: api_url.concat(`/image/${id}`), + method: "GET", + dataType: "json", + }).then((data) => { + // If the request is successful, store the data in the cache and return it + return data; + }); +} + // Function to send data to API function sendDataFromApi(datas) { return $.ajax({ diff --git a/js/projet_detail.js b/js/projet_detail.js index 0648e5c..c24b1a1 100644 --- a/js/projet_detail.js +++ b/js/projet_detail.js @@ -16,12 +16,29 @@ function display_metrics(metrics_datas) { table.innerHTML = datas; } +// function display_metrics(images_datas) { +// // Get data from API and then generate HTML code to display the data in a table +// const table_image = document.getElementById("table-image"); +// let datas = ` +// + +// `; +// for (let i = 0; i < images_datas.length; i+=3) { +// if(i+2 +// +// +// +// `; +// } +// table_image.innerHTML = datas; +// } + document.addEventListener("DOMContentLoaded", () => { const urlParams = new URLSearchParams(window.location.search); const projectId = urlParams.get("id"); getDataProjectMetricsFromApi(projectId) .then(project_metrics => { - console.log(project_metrics) display_metrics(project_metrics); }) .catch(error => { @@ -33,5 +50,13 @@ document.addEventListener("DOMContentLoaded", () => { }); global_project_list=JSON.parse(localStorage.getItem("project_list")); document.getElementById("name_project").innerHTML=global_project_list[projectId-1].titre; + + fetch("https://timelapse.kerboul.me/api/smile") + .then(response => response.blob()) + .then(blob => { + const url = URL.createObjectURL(blob); + const imageElement = document.getElementById("my-image"); + imageElement.src = url; + }); });
Images
${images_datas[i]}${images_datas[i+1]}${images_datas[i+2]}