From 827de7467d6eebca239866aed8b03c1c07bcd7b5 Mon Sep 17 00:00:00 2001 From: Andrea Bianchi Date: Tue, 12 May 2026 19:41:49 +0900 Subject: [PATCH] localstorage --- w11_localstorage/files.js | 28 ++++++++++++++++++++++++++++ w11_localstorage/index.html | 16 ++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 w11_localstorage/files.js create mode 100644 w11_localstorage/index.html diff --git a/w11_localstorage/files.js b/w11_localstorage/files.js new file mode 100644 index 0000000..90806fb --- /dev/null +++ b/w11_localstorage/files.js @@ -0,0 +1,28 @@ +const peopleData = [ + { name: 'John', age: 23 }, + { name: 'Amy', age: 18 }, + { name: 'Hannah', age: 32 }, + { name: 'Peter', age: 12 }, + { name: 'Mary', age: 27 }, +]; + +function setup() { + createCanvas(400, 300); + createButton('Save').position(100, 100).size(60).mousePressed(saveData); + createButton('Load').position(200, 100).size(60).mousePressed(loadData); + + const input = createFileInput(); + input.position(100, 200); +} + +function draw() { + background(200); +} + +function saveData() { + console.log(save); +} + +function loadData() { + console.log(load); +} diff --git a/w11_localstorage/index.html b/w11_localstorage/index.html new file mode 100644 index 0000000..48a9118 --- /dev/null +++ b/w11_localstorage/index.html @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + \ No newline at end of file