localstorage
This commit is contained in:
28
w11_localstorage/files.js
Normal file
28
w11_localstorage/files.js
Normal file
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user