-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathchecker2.html
More file actions
166 lines (146 loc) · 4.39 KB
/
checker2.html
File metadata and controls
166 lines (146 loc) · 4.39 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>NOTHING | QR WEB</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
margin: 0;
font-family: Arial, sans-serif;
background-image: url("https://files.catbox.moe/fvoajt.jpg");
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}
.hidden {
display: none;
}
h1, input, button {
color: white;
margin: 10px 0;
}
input, button {
width: 90%;
padding: 10px;
border: none;
border-radius: 5px;
font-size: 16px;
}
input {
background: rgba(255, 255, 255, 0.7);
color: #000;
}
button {
background: #00aaff;
color: #fff;
cursor: pointer;
transition: background 0.3s;
}
button:hover {
background: #0088cc;
}
.result {
margin-top: 20px;
font-weight: bold;
}
.warning-box {
background: rgba(255, 165, 0, 0.2);
color: #ffa500;
border: 1px solid #ffa500;
padding: 15px 20px;
border-radius: 8px;
margin-top: 20px;
font-size: 16px;
backdrop-filter: blur(5px);
max-width: 90%;
text-align: center;
animation: fadeIn 0.8s ease;
}
.warning-box a {
color: #ffffff;
background: #ffa500;
padding: 6px 12px;
border-radius: 5px;
text-decoration: none;
font-weight: bold;
margin-top: 10px;
display: inline-block;
transition: background 0.3s ease;
}
.warning-box a:hover {
background: #e69500;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
</style>
</head>
<body>
<!-- صفحه اول -->
<div id="welcome-screen">
<h1>First Time?</h1>
<p style="color: white; font-size: 18px;">Please fork the repo first.</p>
<a href="https://github.com/NOTHING-MD420/Ben-bot/fork" target="_blank">
<button>Click Here to Fork</button>
</a>
<button onclick="goToMain()">Back Here</button>
</div>
<!-- اپلیکیشن اصلی -->
<div id="main-app" class="hidden">
<h1>BEN-BOT - Fork Checker</h1>
<input type="text" id="username" placeholder="Enter GitHub Username" />
<button onclick="checkFork()">Check Fork</button>
<div class="result" id="result"></div>
</div>
<script>
function goToMain() {
document.getElementById('welcome-screen').classList.add('hidden');
document.getElementById('main-app').classList.remove('hidden');
}
async function checkFork() {
const username = document.getElementById('username').value;
const resultDiv = document.getElementById('result');
if (!username) {
resultDiv.textContent = "Please enter a username.";
resultDiv.style.color = "red";
return;
}
const owner = "NOTHING-MD420";
const repo = "Ben-bot";
try {
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}/forks`);
if (!response.ok) {
throw new Error(`Error: ${response.status}`);
}
const forks = await response.json();
const isForked = forks.some(fork => fork.owner.login === username);
if (isForked) {
resultDiv.textContent = `Yes, ${username} has forked the repository. Wait...`;
resultDiv.style.color = "green";
setTimeout(() => {
window.location.href = "../qr420";
}, 2000);
} else {
resultDiv.innerHTML = `
<div class="warning-box">
<strong>No, <span style="color: white;">${username}</span> has NOT forked the repository.</strong><br>
Please fork it from the link below:<br>
<a href="https://github.com/${owner}/${repo}/fork" target="_blank">Fork Repository</a>
</div>
`;
}
} catch (error) {
resultDiv.textContent = `An error occurred: ${error.message}`;
resultDiv.style.color = "red";
}
}
</script>
</body>
</html>