-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhw-bot.html
More file actions
269 lines (231 loc) · 9.02 KB
/
Copy pathhw-bot.html
File metadata and controls
269 lines (231 loc) · 9.02 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>HW Bot</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600&display=swap');
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Space Grotesk', system-ui, sans-serif;
background: #080808;
color: #e8e8e8;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
overflow: hidden;
}
.bg {
position: fixed; inset: 0; z-index: 0;
background: radial-gradient(ellipse at 20% 50%, #0d1f3c 0%, transparent 60%),
radial-gradient(ellipse at 80% 20%, #1a0a2e 0%, transparent 50%),
#080808;
}
.grid-lines {
position: fixed; inset: 0; z-index: 0;
background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
background-size: 40px 40px;
}
.card {
position: relative; z-index: 1;
background: rgba(255,255,255,0.03);
border: 1px solid rgba(255,255,255,0.08);
border-radius: 20px;
padding: 2.5rem;
width: 100%;
max-width: 420px;
backdrop-filter: blur(20px);
}
.logo {
display: flex; align-items: center; gap: 10px;
margin-bottom: 2rem;
}
.logo-icon {
width: 38px; height: 38px; border-radius: 10px;
background: linear-gradient(135deg, #4f8ef7, #a855f7);
display: flex; align-items: center; justify-content: center;
font-size: 18px;
}
.logo-text { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.02em; }
.logo-sub { font-size: 11px; color: #555; letter-spacing: 0.05em; text-transform: uppercase; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 12px; color: #666; margin-bottom: 6px; letter-spacing: 0.03em; }
.field input, .field select {
width: 100%;
background: rgba(255,255,255,0.04);
border: 1px solid rgba(255,255,255,0.08);
border-radius: 10px;
color: #e8e8e8;
padding: 11px 14px;
font-size: 14px;
font-family: inherit;
outline: none;
transition: border-color 0.2s, background 0.2s;
appearance: none;
}
.field input:focus, .field select:focus {
border-color: rgba(79,142,247,0.5);
background: rgba(79,142,247,0.05);
}
.field select {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 14px center;
padding-right: 36px;
cursor: pointer;
}
.field select option { background: #111; }
button {
width: 100%;
margin-top: 0.5rem;
padding: 12px;
border-radius: 10px;
border: none;
font-family: inherit;
font-size: 14px;
font-weight: 500;
cursor: pointer;
background: linear-gradient(135deg, #4f8ef7, #a855f7);
color: #fff;
letter-spacing: 0.02em;
transition: opacity 0.2s, transform 0.1s;
}
button:hover { opacity: 0.9; }
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.result {
margin-top: 1.25rem;
padding: 14px;
border-radius: 10px;
font-size: 13px;
display: none;
animation: fadeIn 0.3s ease;
}
.result.success {
background: rgba(74,222,128,0.07);
border: 1px solid rgba(74,222,128,0.2);
color: #4ade80;
}
.result.error {
background: rgba(248,113,113,0.07);
border: 1px solid rgba(248,113,113,0.2);
color: #f87171;
}
.result-label { font-size: 11px; opacity: 0.6; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.result-value { font-size: 15px; font-weight: 500; word-break: break-all; }
.status-dot {
display: inline-block;
width: 7px; height: 7px;
border-radius: 50%;
background: #4ade80;
margin-right: 6px;
animation: pulse 1.5s infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.3; }
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(6px); }
to { opacity: 1; transform: translateY(0); }
}
</style>
</head>
<body>
<div class="bg"></div>
<div class="grid-lines"></div>
<div class="card">
<div class="logo">
<div class="logo-icon">🤖</div>
<div>
<div class="logo-text">HW Bot</div>
<div class="logo-sub">Homework Automation</div>
</div>
</div>
<div class="field">
<label>SOFTWARE</label>
<select id="software">
<option value="Mathspace">Mathspace</option>
<option value="Education Perfect">Education Perfect</option>
</select>
</div>
<div class="field">
<label>EMAIL</label>
<input id="email" type="email" placeholder="you@example.com" />
</div>
<div class="field">
<label>PASSWORD</label>
<div style="position:relative;">
<input id="password" type="password" placeholder="••••••••" style="padding-right:42px;" />
<button type="button" onclick="togglePassword()" id="eyeBtn" style="position:absolute; right:0; top:0; height:100%; width:42px; background:transparent; border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; color:#555; transition:color 0.2s; margin:0; padding:0; border-radius:0 10px 10px 0;">
<svg id="eyeIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>
</button>
</div>
</div>
<button id="btn" onclick="submit()">Run Bot</button>
<div class="result" id="result">
<div class="result-label" id="resultLabel"></div>
<div class="result-value" id="resultValue"></div>
</div>
</div>
<script>
async function submit() {
const software = document.getElementById('software').value;
const email = document.getElementById('email').value.trim();
const password = document.getElementById('password').value;
const btn = document.getElementById('btn');
const result = document.getElementById('result');
const resultLabel = document.getElementById('resultLabel');
const resultValue = document.getElementById('resultValue');
if (!email || !password) { alert('Please fill in all fields'); return; }
btn.textContent = 'Running...';
btn.disabled = true;
result.style.display = 'none';
try {
const res = await fetch('https://wandering-brook-94d0.zdstudio12345.workers.dev/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ software, email, password })
});
const id = res.headers.get('ID') || res.headers.get('id') || null;
const body = await res.clone().json().catch(() => ({}));
const taskId = id || body.instance || body.id || null;
if (res.ok) {
result.className = 'result success';
resultLabel.innerHTML = '<span class="status-dot"></span>Running';
resultValue.innerHTML = taskId ? 'Bot is running!<br><br>Your Task ID number is <strong>' + taskId + '</strong> — keep this safe!' : 'Bot started successfully!';
} else {
result.className = 'result error';
resultLabel.textContent = 'Error ' + res.status;
resultValue.textContent = id || 'Something went wrong.';
}
result.style.display = 'block';
} catch (err) {
result.className = 'result error';
resultLabel.textContent = 'Failed to connect';
resultValue.textContent = err.message;
result.style.display = 'block';
}
btn.textContent = 'Run Bot';
btn.disabled = false;
}
function togglePassword() {
const input = document.getElementById('password');
const btn = document.getElementById('eyeBtn');
const isHidden = input.type === 'password';
input.type = isHidden ? 'text' : 'password';
btn.style.color = isHidden ? '#4f8ef7' : '#555';
document.getElementById('eyeIcon').innerHTML = isHidden
? '<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"/><path d="M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"/><line x1="1" y1="1" x2="23" y2="23"/>'
: '<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>';
}
document.addEventListener('keydown', e => {
if (e.key === 'Enter') submit();
});
</script>
</body>
</html>