first commit

This commit is contained in:
mrtoine 2025-09-12 16:45:43 +02:00
parent dc9fbfea37
commit f3e4bc391b
3 changed files with 120 additions and 0 deletions

33
KeepToine/generic.css Normal file
View file

@ -0,0 +1,33 @@
*, html, body{
margin: auto;
}
table{
width: 90%;
}
.s10 {
width: 10%;
}
.s20 {
width: 20%;
}
.s30 {
width: 30%;
}
.s40 {
width: 40%;
}
.debug {
position: fixed;
display: block;
bottom: 0;
width: 100%;
padding: 15px;
background-color: rgba(200, 10, 10, 0.5);
color: rgba(255, 255, 255, 1);
}

22
KeepToine/index.html Normal file
View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Keep</title>
<script src="keep.js" defer></script>
<link rel="stylesheet" href="./generic.css">
</head>
<body>
<h1 id="extension-title"></h1>
<p id="extension-description"></p>
<table id="primary-table">
<tr>
<th id="pt_th-id" class="s10"></th>
<th id="pt_th-name"></th>
<th id="pt_th-actions" class="s30"></th>
</tr>
</table>
</body>
</html>

65
KeepToine/keep.js Normal file
View file

@ -0,0 +1,65 @@
document.addEventListener('DOMContentLoaded', () => {
const EXTENSION_TITLE = "KeepNote";
const EXTENSION_DESC = "Application de prise de note.";
const PT_TH_ID = "Numéro de note";
const PT_TH_NAME = "Nom";
const PT_TH_ACTIONS = "Actions";
//const DATA_FILE = "keep.json";
let DEBUG_TXT = "";
const BODY = document.querySelector("body");
const LoadData = () => {
return fetch("./data.json")
.then((response) => response.json())
.then((result) => {
return {
id: result.id,
name: result.name,
};
});
};
DEBUG_TXT += LoadData;
GenerateDisplay();
GenerateDebug();
function GenerateDisplay(){
// |-> On selectionne les élement HTML à implémenter
// Le titre et la description de l'app
let title = document.querySelector("#extension-title");
let desc = document.querySelector("#extension-description");
// Le tableau regroupant les notes
let pt_th_id = document.querySelector("#pt_th-id");
let pt_th_name = document.querySelector("#pt_th-name");
let pt_th_actions = document.querySelector("#pt_th-actions");
// |-> On applique les changements
// le titre et la description de l'app
title.innerText = EXTENSION_TITLE;
desc.innerText = EXTENSION_DESC;
// Le tableau regroupant les notes
pt_th_id.innerText = PT_TH_ID;
pt_th_name.innerText = PT_TH_NAME;
pt_th_actions.innerText = PT_TH_ACTIONS;
}
function GenerateDebug(){
if(DEBUG_TXT === "" || DEBUG_TXT == null) return;
// |-> On ajoute les infos de debug
debug_txt = document.createElement("div");
debug_txt.classList += "debug";
debug_txt.innerHTML = `<i>${DEBUG_TXT}</i>`;
BODY.appendChild(debug_txt);
}
});