-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtempnote.html
More file actions
82 lines (73 loc) Β· 2 KB
/
tempnote.html
File metadata and controls
82 lines (73 loc) Β· 2 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Temp Note</title>
<style>
html,
body {
height: 100%;
margin: 0;
padding: 8px;
box-sizing: border-box;
background: #f6f7f8;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
textarea {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 20px;
border: none;
resize: none;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
font-size: 16px;
line-height: 1.6;
background: #ffffff;
box-shadow: 0 6px 24px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
border-radius: 6px;
overflow: auto;
-webkit-text-size-adjust: 100%;
-webkit-appearance: none;
}
textarea:focus {
outline: none;
box-shadow: 0 6px 24px rgba(17, 24, 39, 0.06);
-webkit-tap-highlight-color: transparent;
-webkit-focus-ring-color: transparent;
}
textarea::-webkit-search-decoration,
textarea::-webkit-search-cancel-button,
textarea::-webkit-search-results-button,
textarea::-webkit-search-results-decoration {
display: none;
}
</style>
</head>
<body>
<textarea name="note" placeholder="Please input..." maxlength="65536" autofocus>{SAFE_NOTE}</textarea>
<script>
const textarea = document.querySelector('textarea')
let timer = null
let lastNote = textarea.value
textarea.addEventListener('input', () => {
clearTimeout(timer)
timer = setTimeout(() => {
if (textarea.value !== lastNote) {
fetch(window.location.href, {
method: 'POST',
headers: {
'Content-Type': 'text/plain'
},
body: textarea.value
}).then(() => {
lastNote = textarea.value
})
}
}, 500)
})
</script>
</body>
</html>