-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
129 lines (123 loc) · 3.71 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pico WIFI-Duck</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #36393e;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.form {
background-color:#2f3136;
height: 400px;
width: 400px;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
}
textarea {
color: #bfbfbf;
resize: vertical;
width: 100%;
height: 400px;
padding: 15px;
border: none;
border-radius: 4px;
background: #36393e;
font-family: "Courier New", Courier, monospace;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
button {
background-color: #ffc107;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
}
button:hover {
background-color: #9f7e1c;
}
h1 {
font-size: 1.4rem;
margin-top: 1rem;
background:
#bfbfbf;
padding: 10px;
border-radius: 4px;
border-left: solid #20c20e 5px;
font-weight: 100;
letter-spacing: 5px;
}
footer {
background-color: #2f3136;
color: white;
text-align: center;
padding: 10px;
position: fixed;
bottom: 0;
width: 100%;
}
.title {
font-size: 1.5rem;
margin-bottom: 1rem;
color: balck;
position: absolute;
top: 60px;
left: 50%;
transform: translateX(-50%);
}
</style>
</head>
<body>
<script>
function sendHttpRequest(data) {
console.log(data);
var url = "http://192.168.4.1/api" ;
var xhr = new XMLHttpRequest();
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.onreadystatechange = function () {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
// Request was successful
console.log("Request sent successfully!");
} else {
// Request failed
console.error("Request failed. Status:", xhr.status);
}
}
};
xhr.send(JSON.stringify(data));
};
function main(){
var payload = document.getElementById("payload").value ;
var data = {username : "Payload" , content : payload} ;
sendHttpRequest(data) ;
}
</script>
<div class="title"><h1>Pico WiFi Duck</h1></div>
<div class="form">
<h1>Editor <a class="reload" id="editorReload"></a></h1>
<textarea id="payload" name="content" placeholder="Enter text here..."></textarea>
<button onclick="main()">RUN</button></div>
<footer style="background-color: #2f3136; color: white; text-align: center; padding: 10px;">
© <span id="currentYear"></span> Majd Sassi | <a href="https://github.com/majdsassi/pico-wifi-duck">Github</a>
</footer>
</body>
</html>