forked from GanerCodes/videoEditBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
202 lines (179 loc) · 4.38 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
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
<html>
<head>
<title>VideoEditBot</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
<style>
:root {
--transitionTiming: cubic-bezier(1, 0.1, 1, 0.1);
--fontFamily: Roboto, Segoe UI, sans-serif;
}
body {
background-color: #000;
color: white;
font-size: 30px;
flex-direction: column;
font-family: var(--fontFamily);
}
.container {
top: 35%;
left: 50%;
text-align: center;
position: absolute;
display: flex;
transform: translate(-50%, -50%);
}
.flex2 {
display: flex;
flex-direction: row;
align-items: center;
text-align: center;
padding-top: 80px;
}
.enterButton {
color: #42a5f5;
background-color: transparent;
border: none;
transition: color 0.05s var(--transitionTiming);
cursor: pointer;
margin-left: 5px;
/* Box */
background-color: #222;
color:#2AD7FE;
height:68px;
border-radius: 5px;
}
.enterButton > i {
font-size: 48px;
}
.enterButton:hover, .enterButton:focus {
color: #32CD32;
outline: none;
}
.userName {
border: none;
font-size: 40px;
padding: 10px;
background-color: #212121;
color: #fff;
border: 3px solid #666;
border-radius: 5px;
transition: border 0.1s var(--transitionTiming);
}
.userName:focus {
border-color: #2196F3;
outline: none;
}
.userName::placeholder {
font-family: var(--fontFamily);
}
.tmp {
margin-right: 10px;
color: white;
font-size: 50px;
}
.mainText {
font-size: 40px;
padding-bottom: 16px;
width: 100%;
position: absolute;
}
.otherText {
font-size: 48px;
color: #FF0000;
}
.status {
position: fixed;
bottom: 10px;
left: 0px;
text-align: center;
width: 100%;
font-size: 18px;
vertical-align: middle
}
.status i {
vertical-align: middle;
margin-top: -5px;
}
.status u {
text-decoration: none;
padding-left: 5px;
padding-right: 16px;
}
</style>
</head>
<body>
<div class="container">
<text class="mainText">Enter your Twitter handle</text>
<div class="flex2">
<text class="tmp">@</text>
<input class="userName" placeholder="Username" id="myInput" value="">
<button class="enterButton" id="myBtn" onclick="javascript:redirect()">
<i class="material-icons">arrow_forward</i>
</button>
<script>
function redirect(loc) {
var re = /(\w){1,15}$/;
var inn = document.getElementById("myInput").value.replace(/ /g, "");
if(inn[inn.length - 1] == '/') {
inn = inn.slice(0, -1)
}
var twitterHandle = inn.match(re)[0].toLowerCase()
var URL = '/' + twitterHandle;
if (UrlExists(URL)) {
location.href = URL
}else{
document.querySelector(".otherText").innerHTML = "Error finding that profile!";
}
}
function UrlExists(url) {
var http = new XMLHttpRequest();
http.open("HEAD", url, false);
try {
http.send();
} catch {
return false;
}
if (http.status == 200) {
return true;
}else{
return false;
}
}
var input = document.getElementById("myInput");
input.addEventListener("keyup", function(event) {
if (event.keyCode === 13) {
event.preventDefault();
document.getElementById("myBtn").click();
}
});
</script>
</div>
</div>
<text class="otherText"> </text>
<div class="status">
<i class="material-icons">memory</i>
<b>CPU</b>
<u class="cpu">Loading...</u>
<b>Memory</b>
<u class="memory">Loading...</u>
<i class="material-icons">storage</i>
<b>Storage</b>
<u class="storage">Loading...</u>
</div>
<script>
function updateStats() {
fetch(location.origin + "/@stats?" + Date.now())
.then(response => response.json())
.then(data => {
document.querySelector(".cpu").innerText = data.cpu + "%";
document.querySelector(".memory").innerText = data.ramUsed + " of " + data.totalRam;
document.querySelector(".storage").innerText = data.diskused + " of " + data.disksize;
});
}
setInterval(updateStats, 2000);
updateStats();
</script>
</body>
</html>