-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
74 lines (72 loc) · 2.31 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
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
<!DOCTYPE html >
<html >
<head >
<title > FileWrite | Client-Server < /title >
</head >
<body >
<style type = "text/css" >
.center{
position: absolute
left: 5 %
top: 10 %
right: 5 %
bottom: 23 %
}
.text_area{
font-size: 45px
font-style: unset
text-align: center
border: none
}
.btn_ctr{
margin-left: 45 %
margin-top: 40 %
}
.btn{
border-radius: 8px
border: 4px solid # 008cba;
size: 10px
padding-top: 1 %
padding-bottom: 1 %
padding-right: 1 %
padding-left: 1 %
font-size: 25px
background-color: # ffffff;
font-style: monospace
outline: none
}
</style >
<div class = "center" id = "center" >
<textarea class = "text_area" id = "text_area" rows = "8" cols = "45" placeholder = "What's the content dude!" > </textarea >
</div >
<div class = "btn_ctr" >
<button onclick = "clicked()" class = "btn" type = "button" id = "btn" > Submit < /button >
</div >
<script type = "text/javascript" >
var area_text, btn_click
area_text = document.getElementById("text_area")
btn_click = document.getElementById("btn")
function clicked(){
write_that(area_text.value)
}
var write_that = function(ar){
fetch("/write?e="+ar).then(function(response){
response.json().then(function(data){
reflect(data)
})
})
}
var reflect = function(data){
if(!data.ok){
switch(data.msg){
case "Missing_Expression": area_text.value = "Expression is missing pal!"
case "Empty_Expression": area_text.value = "Dude , write the data for a file to store"
}
}
else{
area_text.value = "Congo , File Saved"
}
}
</script >
</body >
</html >