/
notepadlet.html
112 lines (106 loc) · 4.27 KB
/
notepadlet.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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<html onclick="" class=""><head><title>Notepadlet - Untitled</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
html {
padding: 0px 5px 40px;
background-color: #EEE;
background-image: repeating-linear-gradient(45deg, transparent 5px, hsla(197, 62%, 11%, 0.5) 5px, hsla(197, 62%, 11%, 0.5) 10px, hsla(5, 53%, 63%, 0) 10px, hsla(5, 53%, 63%, 0) 35px, hsla(5, 53%, 63%, 0.5) 35px, hsla(5, 53%, 63%, 0.5) 40px, hsla(197, 62%, 11%, 0.5) 40px, hsla(197, 62%, 11%, 0.5) 50px, hsla(197, 62%, 11%, 0) 50px, hsla(197, 62%, 11%, 0) 60px, hsla(5, 53%, 63%, 0.5) 60px, hsla(5, 53%, 63%, 0.5) 70px, hsla(35, 91%, 65%, 0.5) 70px, hsla(35, 91%, 65%, 0.5) 80px, hsla(35, 91%, 65%, 0) 80px, hsla(35, 91%, 65%, 0) 90px, hsla(5, 53%, 63%, 0.5) 90px, hsla(5, 53%, 63%, 0.5) 110px, hsla(5, 53%, 63%, 0) 110px, hsla(5, 53%, 63%, 0) 120px, hsla(197, 62%, 11%, 0.5) 120px, hsla(197, 62%, 11%, 0.5) 140px ), repeating-linear-gradient(135deg, transparent 5px, hsla(197, 62%, 11%, 0.5) 5px, hsla(197, 62%, 11%, 0.5) 10px, hsla(5, 53%, 63%, 0) 10px, hsla(5, 53%, 63%, 0) 35px, hsla(5, 53%, 63%, 0.5) 35px, hsla(5, 53%, 63%, 0.5) 40px, hsla(197, 62%, 11%, 0.5) 40px, hsla(197, 62%, 11%, 0.5) 50px, hsla(197, 62%, 11%, 0) 50px, hsla(197, 62%, 11%, 0) 60px, hsla(5, 53%, 63%, 0.5) 60px, hsla(5, 53%, 63%, 0.5) 70px, hsla(35, 91%, 65%, 0.5) 70px, hsla(35, 91%, 65%, 0.5) 80px, hsla(35, 91%, 65%, 0) 80px, hsla(35, 91%, 65%, 0) 90px, hsla(5, 53%, 63%, 0.5) 90px, hsla(5, 53%, 63%, 0.5) 110px, hsla(5, 53%, 63%, 0) 110px, hsla(5, 53%, 63%, 0) 140px, hsla(197, 62%, 11%, 0.5) 140px, hsla(197, 62%, 11%, 0.5) 160px );
}
body {
max-width: 800px;
margin: 10px auto;
background: #FAFAFA;
padding: 10px 26px 10px 97px;
box-sizing: border-box;
min-height: 110%;
font: 100 24px "American typewriter", serif;
box-shadow: 0px 4px 15px 0px rgba(0,0,0,0.15), 0px 0px 1px 1px rgba(0,0,0,0.1);
background-image: linear-gradient(90deg, transparent 79px, #abced4 79px, #abced4 81px, transparent 81px), linear-gradient(#F3F3F3 .1em, transparent .1em);
background-size: 100% 1.3em;
line-height: 1.3em;
background-position: 0px -3px;
}
h1 {
font-size: 1em;
text-align: center;
margin: 23px 0 32px;
font-weight: 400;
}
p {
margin: 1.3em 0px;
}
b {
font-weight: 500;
}
img {
max-width: 100%;
}
.dragover:before {
content: "";
position: fixed;
z-index: 1;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: rgba(0,0,0,0.4);
pointer-events: none;
}
.dragover:after {
pointer-events: none;
content: "Drop files here";
font: 200 30px "American Typewriter", sans;
position: fixed;
z-index: 1;
top: 50%;
left: 50%;
color: #FFF;
transform: translate(-50%, -50%);
border: 2px dashed rgba(255,255,255,0.8);
border-radius: 10px;
padding: 30px 50px;
}
</style><style type="text/css"></style></head><body contenteditable="">
<script>
document.body.onload = function() {
document.body.addEventListener('blur', function (event) {
var h1 = document.getElementsByTagName('h1');
h1.length && (document.title = "Notepadlet - " + h1[0].innerText);
window.location = 'data:text/html;base64,' + btoa(document.documentElement.outerHTML);
});
var p = document.getElementsByTagName("p")[0],
s = window.getSelection(),
r = document.createRange()
c = p.innerHTML;
p.innerHTML = '\u00a0';
r.selectNodeContents(p);
s.removeAllRanges();
s.addRange(r);
document.execCommand('delete', false, null);
p.innerHTML = c;
document.documentElement.addEventListener("dragover", function() {
document.documentElement.classList = "dragover";
});
document.documentElement.addEventListener("dragleave", function() {
document.documentElement.classList = "";
});
document.documentElement.addEventListener("drop", function(e) {
e.preventDefault();
document.documentElement.classList = "";
var files = e.target.files || e.dataTransfer.files;
for (var i = 0, f; f = files[i]; i++) {
AddFile(f);
}
});
var reader = new FileReader();
reader.addEventListener("load", function () {
var newImage = new Image();
newImage.src = reader.result;
document.body.appendChild(newImage);
}, false);
function AddFile(file) {
reader.readAsDataURL(file);
}
}
</script><h1>Untitled</h1>
<p><br></p></body></html>