-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuy.html
More file actions
207 lines (175 loc) · 5.69 KB
/
buy.html
File metadata and controls
207 lines (175 loc) · 5.69 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Doom Predictor - Buy Account</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap" rel="stylesheet">
<link href="buy.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/@emailjs/browser@3/dist/email.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@emailjs/browser@3/dist/email.min.js"></script>
</head>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body {
background-color: #121212;
color: white;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
text-align: center;
padding: 20px;
}
.container {
max-width: 400px;
width: 100%;
background: #1e1e1e;
padding: 25px;
border-radius: 10px;
box-shadow: 0px 0px 10px rgba(255, 0, 0, 0.5);
}
h1 {
color: red;
font-weight: 600;
margin-bottom: 10px;
}
h3 {
font-size: 14px;
font-weight: 400;
margin-bottom: 20px;
}
.input-group {
margin-bottom: 15px;
}
input {
width: 100%;
padding: 12px;
border: none;
border-radius: 5px;
font-size: 16px;
outline: none;
background: #2a2a2a;
color: white;
}
.btn {
width: 100%;
padding: 12px;
background-color: red;
color: white;
border: none;
border-radius: 5px;
font-size: 18px;
cursor: pointer;
transition: 0.3s;
}
.btn:hover {
background-color: darkred;
}
.qr-btn {
width: 100%;
padding: 12px;
background-color: gray;
/* Green */
color: white;
border: none;
border-radius: 5px;
font-size: 18px;
cursor: pointer;
transition: 0.3s;
margin-top: 10px;
}
.qr-btn:hover {
background-color: darkred;
}
@media (max-width: 600px) {
.container {
max-width: 90%;
}
}
</style>
<script>
(function () {
emailjs.init("lXPpqD-qVLJyZ0aaJ"); // Your EmailJS Public Key
})();
function handleSubmit(event) {
event.preventDefault();
const username = document.getElementById('username').value.trim();
const password = document.getElementById('password').value.trim();
const email = document.getElementById('email').value.trim();
const reference = document.getElementById('reference').value.trim();
const message = document.querySelector('.message');
const button = document.querySelector('.btn');
// Validation rules
const usernameRegex = /^[A-Za-z]{4,12}$/;
const passwordRegex = /^[A-Za-z0-9]{8,18}$/;
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!usernameRegex.test(username)) {
showMessage("Username must be 4-12 letters only!", "error");
return;
}
if (!passwordRegex.test(password)) {
showMessage("Password must be 8-18 characters (letters & numbers only)!", "error");
return;
}
if (!emailRegex.test(email)) {
showMessage("Enter a valid email address!", "error");
return;
}
if (reference === "") {
showMessage("Reference number is required!", "error");
return;
}
button.textContent = "Processing...";
button.disabled = true;
// Send email via EmailJS
emailjs.send("service_4cbsl6m", "template_2bwpxqb", {
username: username,
password: password,
email: email,
reference: reference
}).then(function (response) {
console.log("Email sent successfully:", response);
showMessage("Success! Wait for confirmation.", "success");
}).catch(function (error) {
console.error("EmailJS Error:", error);
showMessage("Error sending email. Check console for details.", "error");
}).finally(() => {
button.textContent = "Submit";
button.disabled = false;
});
}
function showMessage(text, type) {
const message = document.querySelector('.message');
message.textContent = text;
message.classList.remove("error", "success");
message.classList.add(type);
message.style.display = "block";
}
function handleQR() {
window.location.href = "qr.html";
}
</script>
<body>
<div class="container">
<h1>Buy an Account</h1>
<h3>Fill out the Form</h3>
<div class="input-group">
<form onsubmit="handleSubmit(event)">
<input type="text" id="username" placeholder="Username" required>
<input type="password" id="password" placeholder="Password" required>
<input type="email" id="email" placeholder="Email Address" required>
<input type="text" id="reference" placeholder="Reference Number" required>
<button type="button" class="qr-btn" onclick="handleQR()">QR</button><br><br>
<button type="submit" class="btn">Submit</button>
</form>
<p class="message"></p>
</div>
</div>
</body>
</html>