-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpicrust.html
384 lines (326 loc) · 10.7 KB
/
picrust.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src = "https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
<!--
old version of picrust in one page
-->
<link href="data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAYoetAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEREREREREREREREREREREREREREREREREREREAEREREREREQAREREREQAREREAEREREAEREAEREQERAAAAERARABERERERABEQABEREQABEBEQABEAAREAAREQAAEREAEAEREREREAERABEREREAEREQABERAAEREREQAAABEREAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" rel="icon" type="image/x-icon" />
<title>PI CRUST</title>
</head>
<body>
<div id = "ipbutton" class = "wifi"></div>
<!--hexidecimal 📶 is decmial 📶 is wifi emoji-->
<input id = "ipaddressinput"/>
<textarea id = "wall" spellcheck="false"></textarea>
<div id = "qrcode"></div>
<div id = "brandbox"><a style = "color:#ff2cb4;background-color:black" href = "index.html">HOME</a></div>
<div id = "imagescroll">
<a style = "position:absolute;right:0px;top:0px;display:none;" href= "imagefeed.html">DESTROYER</a>
<form id = "uploadform" style = "margin-top:10px;display:none;" action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Image" name="submit">
</form>
</div>
<div id = "mediascroll">
<a style = "position:absolute;right:0px;top:0px;display:none;" href= "mediadestroyer.html">DESTROYER</a>
<a href = "webpages.html">WEB PAGE EDITOR</a>
<form id = "uploadform" style = "margin-top:10px;color:#00ff00;display:none;" action="uploadmedia.php" method="post" enctype="multipart/form-data">
Select media file to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Media File" name="submit">
</form>
</div>
<script>
wall = "";
var httpc = new XMLHttpRequest();
httpc.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
wall = this.responseText;
document.getElementById("wall").value = wall;
}
};
httpc.open("GET", "fileloader.php?filename=data/wall.txt", true);
httpc.send();
document.getElementById("wall").onkeyup = function() {
wall = this.value;
var httpc = new XMLHttpRequest();
var url = "filesaver.php";
httpc.open("POST", url, true);
httpc.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
httpc.send("data="+encodeURIComponent(wall)+"&filename=data/wall.txt");//send text to filesaver.php
}
uploadImages = [];
var httpcUpload = new XMLHttpRequest();
httpcUpload.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
uploadImages = JSON.parse(this.responseText);
loadimagefeed();
}
};
httpcUpload.open("GET", "dir.php?filename=uploadimages", true);
httpcUpload.send();
function loadimagefeed(){
for(var index = uploadImages.length - 1;index >= 0;index--) {
var newimg = document.createElement("IMG");
newimg.src = "uploadimages/" + uploadImages[index];
document.getElementById("imagescroll").appendChild(newimg);
}
}
media = [];
var httpcUpload = new XMLHttpRequest();
httpcUpload.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
media = JSON.parse(this.responseText);
loadmediafeed();
}
};
httpcUpload.open("GET", "dir.php?filename=media", true);
httpcUpload.send();
mediadir = [];
dirname = "";
function loadmediafeed(){
for(var index = 0;index < media.length;index++) {
if(media[index].includes(".")){
var newa = document.createElement("A");
newa.innerHTML = media[index];
newa.href = "media/" + media[index];
document.getElementById("mediascroll").appendChild(newa);
}
else{
//directory
var newdiv = document.createElement("DIV");
newdiv.className = "new";
var newh1 = document.createElement("H1");
newh1.innerHTML = media[index] + "/";
newdiv.id = "dir" + media[index];
newdiv.appendChild(newh1);
document.getElementById("mediascroll").appendChild(newdiv);
newh1.onclick = function(){
if(this.parentNode.className == "new"){
this.parentNode.className = "visible";
dirname = this.innerHTML.substring(0,this.innerHTML.length-1);
var httpcUpload2 = new XMLHttpRequest();
httpcUpload2.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
dirmedia = JSON.parse(this.responseText);
for(var dirindex = 0;dirindex < dirmedia.length;dirindex++){
var newa = document.createElement("A");
newa.innerHTML = dirmedia[dirindex];
newa.href = "media/" + dirname + "/" +dirmedia[dirindex];
document.getElementById("dir" + dirname).appendChild(newa);
}
}
};
httpcUpload2.open("GET", "dir.php?filename=media/" + dirname, true);
httpcUpload2.send();
}
else{
if(this.parentNode.className == "visible"){
var filelist = this.parentNode.getElementsByTagName("A");
for(fileindex = 0;fileindex < filelist.length;fileindex++){
filelist[fileindex].style.display = "none";
}
}
if(this.parentNode.className == "hidden"){
var filelist = this.parentNode.getElementsByTagName("A");
for(fileindex = 0;fileindex < filelist.length;fileindex++){
filelist[fileindex].style.display = "block";
}
}
if(this.parentNode.className == "visible"){
this.parentNode.className = "hidden";
}
else{
this.parentNode.className = "visible";
}
}
}
}
}
}
globalurl = window.location.href;
//globalurl = "http://10.0.0.138/picrust.html";
if(innerWidth> innerHeight){
codesquaresize = 0.5*innerHeight - 100;
}
else{
codesquaresize = 0.5*innerWidth - 100;
}
drawqrcode();
function drawqrcode(){
qrcode = new QRCode(document.getElementById("qrcode"), {
text: globalurl,
width: codesquaresize,
height: codesquaresize,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});
qrcode.makeCode(globalurl);
}
/*
ipaddress = "";
var httpc = new XMLHttpRequest();
httpc.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
ipaddress = this.responseText;
if(ipaddress.includes(":")){
//ipv6
globalurl = "http://[" + ipaddress + "]/";
}
else{
globalurl = "http://" + ipaddress;
}
drawqrcode();
document.getElementById("ipaddressinput").value = ipaddress;
}
};
httpc.open("GET", "fileloader.php?filename=data/ipaddress.txt", true);
httpc.send();
document.getElementById("ipaddressinput").onchange = function(){
ipaddress = this.value;
var httpc = new XMLHttpRequest();
var url = "filesaver.php";
httpc.open("POST", url, true);
httpc.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
httpc.send("data="+encodeURIComponent(ipaddress)+"&filename=data/ipaddress.txt");//send text to filesaver.php
}
document.getElementById("ipaddressinput").style.display = "none";
ipaddressvisible = false;
document.getElementById("ipbutton").onclick = function(){
ipaddressvisible = !ipaddressvisible;
if(ipaddressvisible){
document.getElementById("ipaddressinput").style.display = "block";
}
else{
document.getElementById("ipaddressinput").style.display = "none";
}
}
*/
</script>
<style>
body{
overflow:hidden;
/* background-color:#F8DEB8;*/
background-color:#ad8762;
}
#ipbutton{
position:absolute;
right:0px;
top:0px;
font-size:20px;
cursor:pointer;
display:none;
}
#ipaddressinput{
display:none;
position:absolute;
top:0px;
right:50px;
z-index:10;
font-family:courier;
color:#00ff00;
background-color:black;
font-size:18px;
border-color:black;
width:300px;
}
#wall{
position:absolute;
top:0px;
width:50%;
left:0px;
height:50%;
background-color:black;
color:#00ff00;
font-family:courier;
font-size:1em;
}
#brandbox{
position:absolute;
top:0px;
left:51%;
font-family:courier;
font-size:2em;
}
#qrcode{
position:absolute;
right:50px;
top:50px;
z-index:3;
font-size:2em;
}
#imagescroll{
position:absolute;
left:0px;
bottom:0px;
width:50%;
overflow-y:scroll;
height:50%;
/* background-color:#F8DEB8;*/
background-color:#ad8762;
}
#imagescroll img{
max-width:70%;
display:block;
margin:auto;
margin-top:1em;
margin-bottom:1em;
}
#mediascroll{
position:absolute;
right:0px;
bottom:0px;
width:50%;
overflow:scroll;
height:50%;
background-color:#101010;
}
#mediascroll a,span{
display:block;
margin:auto;
margin-top:0.5em;
margin-bottom:0.5em;
color:#ff2cb4;
margin-left:1em;
font-family:courier;
}
#mediascroll h1{
color:#ff2cb4;
font-family:courier;
border:solid;
border-radius:5px;
border-color:#ff2cb4;
margin-top:2px;
margin-bottom:2px;
cursor:pointer;
}
#mediascroll span{
border:solid;
border-color:#ff2cb4;
cursor:pointer;
}
#mediascroll div{
border:solid;
border-color:#ff2cb4;
margin: 0.5em 0.5em 0.5em 0.5em;
}
.wifi {
padding: 4px;
}
.wifi, .wifi:before {
display: inline-block;
border: 12px double transparent;
border-top-color: currentColor;
border-radius: 50%;
}
.wifi:before {
content: '';
width: 0; height: 0;
}
</style>
</body>
</html>