structure refacto & file documentation
All checks were successful
Deploy Sokko G / deploy (push) Successful in 7s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 7s
This commit is contained in:
parent
d7871736c8
commit
895fec2b40
84 changed files with 2629 additions and 2313 deletions
|
|
@ -1,3 +1,4 @@
|
|||
// Rôle : bloque le scroll de page derrière les modales actives.
|
||||
export function lockBodyScroll() {
|
||||
const currentLocks = Number(document.body.dataset.modalLocks || 0);
|
||||
document.body.dataset.modalLocks = String(currentLocks + 1);
|
||||
|
|
|
|||
11
website/src/utils/imageCompression.js
Normal file
11
website/src/utils/imageCompression.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Rôle : compresse les images utilisateur avant stockage IndexedDB.
|
||||
export async function compressImage(file) {
|
||||
const bitmap = await createImageBitmap(file);
|
||||
const maxSide = 1400;
|
||||
const ratio = Math.min(1, maxSide / Math.max(bitmap.width, bitmap.height));
|
||||
const canvas = document.createElement("canvas");
|
||||
canvas.width = Math.round(bitmap.width * ratio);
|
||||
canvas.height = Math.round(bitmap.height * ratio);
|
||||
canvas.getContext("2d").drawImage(bitmap, 0, 0, canvas.width, canvas.height);
|
||||
return canvas.toDataURL("image/jpeg", 0.78);
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// Rôle : encapsule les opérations IndexedDB génériques utilisées par les toolboxes.
|
||||
const DB_NAME = "sokkog";
|
||||
const DB_VERSION = 1;
|
||||
const KV_STORE = "kv";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue