-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
185 lines (161 loc) · 5.21 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
<!DOCTYPE html><html lang="en"><head>
<meta charset="utf-8">
<title>Heroku Deployment</title>
<link rel="stylesheet" href="css/all.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
font-family: 'Roboto', sans-serif;
color: #fff;
background: linear-gradient(45deg, #ff0040, #8c00ff, #0044ff, #00c6ff, #00ff92, #ffeb00, #ff7700);
background-size: 400% 400%;
animation: gradientAnimation 6s infinite;
}
@keyframes gradientAnimation {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
.container {
text-align: center;
background: rgba(0, 0, 0, 0.8);
padding: 50px;
width: 500px;
border-radius: 20px;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
animation: scaleUp 1.5s ease-in-out;
}
.input {
width: 100%;
padding: 15px;
font-size: 17px;
color: #fff;
border: 2px solid #555;
border-radius: 10px;
margin-top: 15px;
background: rgba(255, 255, 255, 0.1);
transition: 0.3s;
}
.input:focus {
border-color: #00ff92;
outline: none;
box-shadow: 0 0 10px #00ff92;
}
.button {
width: 100%;
border: none;
padding: 15px;
font-size: 18px;
font-weight: bold;
color: #fff;
border-radius: 10px;
cursor: pointer;
margin-top: 20px;
background: linear-gradient(45deg, #ff0040, #8c00ff, #0044ff);
transition: 0.5s;
}
.button:hover {
background: linear-gradient(45deg, #00ff92, #ffeb00, #ff7700);
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
.fork-section {
margin-top: 20px;
display: none;
}
.fork-button {
padding: 15px;
font-size: 16px;
font-weight: bold;
color: white;
border: none;
background-color: #ff7700;
border-radius: 10px;
cursor: pointer;
text-decoration: none;
}
.fork-button:hover {
background-color: #ff0040;
}
</style>
</head>
<body>
<div class="container">
<h2>Welcome User</h2>
<form onsubmit="return handleUsernameInput();">
<input placeholder="Enter Your GitHub Username" class="input" id="githubUsername" type="text">
<div id="passwordSection" style="display: none;">
<input placeholder="Enter Password" class="input" id="passwordInput" type="password">
</div>
<button class="button" type="submit">Deploy to Heroku</button>
</form>
<div id="statusMessage" style="color: yellow; font-weight: bold; margin-top: 20px;"></div>
<div id="forkSection" class="fork-section">
<p>Make sure you have the latest forked version of the TOHID-AI repository.</p>
<a href="https://github.com/Tohidkhan6332/TOHID-AI/fork" target="_blank" class="fork-button">Fork TOHID-AI Repository</a>
</div>
</div>
<script>
const correctPassword = "shoro786";
async function doesGitHubRepoExist(owner, repo) {
const apiUrl = `https://api.github.com/repos/${owner}/${repo}`;
try {
const response = await fetch(apiUrl);
return response.status === 200;
} catch (error) {
console.error(`Error checking GitHub repository: ${error.message}`);
return false;
}
}
function handleUsernameInput() {
const usernameInput = document.getElementById("githubUsername");
const username = usernameInput.value.trim();
const passwordSection = document.getElementById("passwordSection");
const passwordInput = document.getElementById("passwordInput");
const statusMessage = document.getElementById("statusMessage");
const forkSection = document.getElementById("forkSection");
if (!username) {
statusMessage.textContent = "Please enter a valid GitHub username!";
return false;
}
if (username === "Tohidkhan6332") {
passwordSection.style.display = "block";
if (!passwordInput.value) {
statusMessage.textContent = "Please enter the password.";
return false;
}
if (passwordInput.value !== correctPassword) {
statusMessage.textContent = "Incorrect password. Please try again.";
return false;
}
statusMessage.textContent = "";
}
checkAndDeploy(username);
return false;
}
async function checkAndDeploy(username) {
const repoName = "TOHID-AI";
const statusMessage = document.getElementById("statusMessage");
const forkSection = document.getElementById("forkSection");
const repoExists = await doesGitHubRepoExist(username, repoName);
if (repoExists) {
const herokuURL = `https://dashboard.heroku.com/new-app?template=https://github.com/${username}/${repoName}`;
window.location.href = herokuURL;
} else {
statusMessage.textContent = "Repository not found. Please fork the TOHID-AI repository.";
forkSection.style.display = "block";
}
}
</script>
</body></html>