Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
yashrajnayak authored Dec 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
0 parents commit d8bcd5f
Showing 3 changed files with 154 additions and 0 deletions.
23 changes: 23 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GitHub Username Validator</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<div class="form-card">
<form id="githubForm">
<div class="input-group">
<label for="username">Enter your GitHub username</label>
<input type="text" id="username" name="username" required>
</div>
<button type="submit">Proceed</button>
</form>
</div>
</div>
<script src="script.js"></script>
</body>
</html>
18 changes: 18 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
document.getElementById('githubForm').addEventListener('submit', async function(event) {
event.preventDefault();
const username = document.getElementById('username').value;
const apiUrl = `https://api.github.com/users/${username}`;

try {
const response = await fetch(apiUrl);
if (!response.ok) {
alert('Invalid GitHub username');
return;
}
const data = await response.json();
window.location.href = 'https://github.com/features/copilot/plans';
} catch (error) {
console.error('Error:', error);
alert('Invalid GitHub username');
}
});
113 changes: 113 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/* Modern CSS Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

/* Custom Properties */
:root {
--bg-color: #0d1117;
--card-bg: #161b22;
--text-primary: #f0f6fc;
--text-secondary: #8b949e;
--accent: #238636;
--accent-hover: #2ea043;
--input-bg: #0d1117;
--input-border: #30363d;
--input-border-focus: #58a6ff;
}

/* Base Styles */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
background-color: var(--bg-color);
color: var(--text-primary);
line-height: 1.6;
min-height: 100vh;
}

.container {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 1rem;
}

.form-card {
background-color: var(--card-bg);
padding: 2rem;
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 400px;
}

h1 {
color: var(--text-primary);
margin-bottom: 1.5rem;
text-align: center;
font-size: 1.75rem;
}

.input-group {
margin-bottom: 1.5rem;
}

label {
display: block;
margin-bottom: 0.5rem;
color: var(--text-secondary);
font-size: 0.875rem;
text-align: center;
}

input {
width: 100%;
padding: 0.75rem 1rem;
background-color: var(--input-bg);
border: 1px solid var(--input-border);
border-radius: 6px;
color: var(--text-primary);
font-size: 1rem;
transition: border-color 0.2s ease;
}

input:focus {
outline: none;
border-color: var(--input-border-focus);
box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

button {
width: 100%;
padding: 0.75rem 1rem;
background-color: var(--accent);
color: white;
border: none;
border-radius: 6px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: background-color 0.2s ease;
}

button:hover {
background-color: var(--accent-hover);
}

/* Responsive Design */
@media (max-width: 480px) {
.form-card {
padding: 1.5rem;
}

h1 {
font-size: 1.5rem;
}

input, button {
padding: 0.625rem 0.875rem;
}
}

0 comments on commit d8bcd5f

Please sign in to comment.