update bas les couilles
This commit is contained in:
@@ -24,3 +24,17 @@ footer {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.hiddenTable {
|
||||
max-height: 400px; /* Adjust this value as needed */
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.full-view {
|
||||
max-height: none;
|
||||
overflow-y: visible;
|
||||
}
|
||||
.sticky-header thead{
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
@@ -16,23 +16,26 @@
|
||||
rel="stylesheet"
|
||||
/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="section" class="container mt-5">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="buttons-container" style="float: left; width: 20%">
|
||||
<button id="projets" class="btn btn-primary">
|
||||
<button id="projets" >
|
||||
<span> Home </span>
|
||||
</button>
|
||||
</div>
|
||||
<h3 id="name_project" class="text-black" style="float: left; width: 50%"></h3>
|
||||
<h3
|
||||
id="name_project"
|
||||
class="text-black"
|
||||
style="float: left; width: 50%"
|
||||
></h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<table class="table table-striped" id="table-metrics">
|
||||
<thead class="bg-blue-600 text-black">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>date</th>
|
||||
<th>Hygrométrie</th>
|
||||
@@ -43,19 +46,36 @@
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<table class="table table-striped" id="table-image">
|
||||
<thead class="bg-blue-600 text-black">
|
||||
<div id="content1" class="hiddenTable">
|
||||
<table
|
||||
class="table table-striped scrollable sticky-header"
|
||||
id="table-image"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>images</th>
|
||||
<th>
|
||||
<button id="toggle-view">
|
||||
See all images
|
||||
</button>
|
||||
</th>
|
||||
<th><button>
|
||||
sort images
|
||||
</button></th>
|
||||
<th><button>
|
||||
export images
|
||||
</button></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="3" scope="col">images</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
<tbody id="imageSource"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<img id="my-image" alt="Description of the image" />
|
||||
<footer>
|
||||
<p>© 2024 Timelapse. All rights reserved.</p>
|
||||
</footer>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<body>
|
||||
<div id="section"></div>
|
||||
<div class="buttons-container">
|
||||
<button id="projets" class="btn btn-primary"><span>
|
||||
<button id="projets" ><span>
|
||||
Mes projets
|
||||
</span>
|
||||
</button>
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
<body>
|
||||
<div id="section" class="container mt-5">
|
||||
<div class="buttons-container mb-4">
|
||||
<button id="video" class="btn btn-primary"><span>Mes vidéos</span></button>
|
||||
<button id="download" class="btn btn-primary"><span>Download App</span></button>
|
||||
<button id="video" ><span>Mes vidéos</span></button>
|
||||
<button id="download" ><span>Download App</span></button>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped" id="table-projects">
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
function display_metrics(metrics_datas) {
|
||||
// Get data from API and then generate HTML code to display the data in a table
|
||||
const table = document.getElementById("table-metrics");
|
||||
let datas = `<tr>
|
||||
<th>Date</th>
|
||||
<th>Température</th>
|
||||
<th>Hygrométrie</th>
|
||||
let datas = `
|
||||
<tr><th>Date</th> <th>Température</th> <th>Hygrométrie</th>
|
||||
</tr>`;
|
||||
for (let i = 0; i < metrics_datas.length; i++) {
|
||||
datas += `<tr>
|
||||
datas += `
|
||||
<tr>
|
||||
<th>${formatDate(metrics_datas[i].date_metrique)}</th>
|
||||
<th>${metrics_datas[i].temperature}</th>
|
||||
<th>${metrics_datas[i].hygrometrie}</th>
|
||||
@@ -16,32 +15,14 @@ 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 = `<tr>
|
||||
// <th>Images</th>
|
||||
|
||||
// </tr> `;
|
||||
// for (let i = 0; i < images_datas.length; i+=3) {
|
||||
// if(i+2<images_datas.length)
|
||||
// datas += `<tr>
|
||||
// <th>${images_datas[i]}</th>
|
||||
// <th>${images_datas[i+1]}</th>
|
||||
// <th>${images_datas[i+2]}</th>
|
||||
// </tr>`;
|
||||
// }
|
||||
// table_image.innerHTML = datas;
|
||||
// }
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const projectId = urlParams.get("id");
|
||||
getDataProjectMetricsFromApi(projectId)
|
||||
.then(project_metrics => {
|
||||
.then((project_metrics) => {
|
||||
display_metrics(project_metrics);
|
||||
})
|
||||
.catch(error => {
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
document.getElementById("projets").addEventListener("click", () => {
|
||||
@@ -49,14 +30,44 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
current_project = "";
|
||||
});
|
||||
global_project_list = JSON.parse(localStorage.getItem("project_list"));
|
||||
document.getElementById("name_project").innerHTML=global_project_list[projectId-1].titre;
|
||||
document.getElementById("name_project").innerHTML =
|
||||
global_project_list[projectId - 1].titre;
|
||||
|
||||
fetch("https://timelapse.kerboul.me/api/smile")
|
||||
.then(response => response.blob())
|
||||
.then(blob => {
|
||||
.then((response) => response.blob())
|
||||
.then((blob) => {
|
||||
const url = URL.createObjectURL(blob);
|
||||
const imageElement = document.getElementById("my-image");
|
||||
imageElement.src = url;
|
||||
});
|
||||
let tableBody = document.getElementById("imageSource");
|
||||
let row = document.createElement("tr");
|
||||
|
||||
for (let i = 0; i < 1500; i++) {
|
||||
let imageTD = document.createElement("td");
|
||||
imageTD.innerHTML = `<img id="${i}" src="${url}" />`;
|
||||
row.appendChild(imageTD);
|
||||
|
||||
if ((i + 1) % 3 === 0 && i !== 0) {
|
||||
tableBody.appendChild(row);
|
||||
row = document.createElement("tr"); // Create a new row
|
||||
}
|
||||
}
|
||||
|
||||
// Append the last row if there are remaining images
|
||||
if (row.childNodes.length > 0) {
|
||||
tableBody.appendChild(row);
|
||||
}
|
||||
});
|
||||
|
||||
// Add event listener for the toggle button
|
||||
document.getElementById("toggle-view").addEventListener("click", () => {
|
||||
const tableImage = document.getElementById("content1");
|
||||
if (tableImage.classList.contains("hiddenTable")) {
|
||||
tableImage.classList.remove("hiddenTable");
|
||||
tableImage.classList.add("full-view");
|
||||
document.getElementById("toggle-view").innerHTML="See first images"
|
||||
} else {
|
||||
tableImage.classList.remove("full-view");
|
||||
tableImage.classList.add("hiddenTable");
|
||||
document.getElementById("toggle-view").innerHTML="See all images"
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user