-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
40 lines (32 loc) · 1.23 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!doctype html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Chilanka&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<h1 style= "font-family: 'Chilanka', cursive;">Micro Note</h1>
</head>
<body style= "font-family: 'Chilanka', cursive;">
<!-- This is a comment -->
<div id="note" contenteditable> </div>
<script src="https://unpkg.com/filer/dist/filer.min.js"></script>
<script>
const fs = new Filer.FileSystem();
window.addEventListener('DOMContentLoaded', (event) => {
console.log('DOM fully loaded and parsed');
fs.readFile('/note', 'utf8', function(err, data) {
if (err) {
document.querySelector('#note').innerHTML = "Welcome to my notepad!";
}
if (data) {
document.querySelector('#note').innerHTML = data;
}
});
});
window.setInterval(noteSave, 300, "Save Completed");
function noteSave(verification) {
fs.writeFile('/note', document.querySelector('#note').innerHTML);
console.log(verification);
}
</script>
</body>
</html>