Sure! Below is a complete HTML file that includes embedded CSS and JavaScript to create a modern, responsive, and visually stunning webpage displaying the contributors of the GitHub repository kvcops/KV-Nexus. This webpage features smooth animations, interactive elements, and a professional UI/UX design.
Features:
- Responsive Design: Adapts seamlessly to various screen sizes, including mobile devices.
- Animations: Smooth fade-in effects, hover animations on contributor cards, and interactive elements.
- Modern UI/UX: Clean layout with a stylish color scheme, intuitive navigation, and professional aesthetics.
- Dynamic Data Fetching: Uses GitHub's API to fetch and display real-time contributor information.
- Enhanced Visuals: Includes a visually appealing header, card layouts for contributors, and subtle background effects.
Complete Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>KV-Nexus Contributors</title>
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">
<!-- Font Awesome for Icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" integrity="sha512-Fo3rlrZj/k7ujTTXABk9I1cN6E4eUzBwW1nI/xN/Zz1uwIRI3g9KlW0f59Ua6eVd3ZwXPNI6tLOQrI+LWM/Xkw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
/* Reset & Base Styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', sans-serif;
background: linear-gradient(135deg, #1e3c72, #2a5298);
color: #fff;
min-height: 100vh;
display: flex;
flex-direction: column;
}
/* Header */
header {
padding: 2rem 1rem;
text-align: center;
background: rgba(0, 0, 0, 0.3);
position: sticky;
top: 0;
z-index: 1000;
backdrop-filter: blur(10px);
}
header h1 {
font-size: 2.5rem;
margin-bottom: 0.5rem;
animation: fadeInDown 1s ease-out both;
}
header p {
font-size: 1.1rem;
animation: fadeInUp 1s ease-out 0.5s both;
}
/* Main Content */
main {
flex: 1;
padding: 2rem 1rem;
display: flex;
flex-direction: column;
align-items: center;
}
.contributors-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.5rem;
width: 100%;
max-width: 1200px;
margin-top: 2rem;
}
.card {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
padding: 1.5rem;
border-radius: 15px;
text-align: center;
transition: transform 0.3s, box-shadow 0.3s;
position: relative;
overflow: hidden;
animation: fadeInUp 1s ease-out;
}
.card:hover {
transform: translateY(-10px);
box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3);
}
.card::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: rgba(255, 255, 255, 0.05);
transform: rotate(45deg);
transition: all 0.5s;
}
.card:hover::before {
transform: rotate(0deg);
}
.avatar {
width: 100px;
height: 100px;
border-radius: 50%;
margin-bottom: 1rem;
border: 3px solid #fff;
object-fit: cover;
transition: transform 0.3s;
}
.card:hover .avatar {
transform: scale(1.1);
}
.username {
font-size: 1.2rem;
font-weight: 600;
margin-bottom: 0.5rem;
}
.contributions {
font-size: 1rem;
color: #d1d5db;
}
/* Footer */
footer {
padding: 1rem;
text-align: center;
background: rgba(0, 0, 0, 0.3);
backdrop-filter: blur(10px);
position: sticky;
bottom: 0;
}
footer a {
color: #fff;
margin: 0 0.5rem;
transition: color 0.3s;
}
footer a:hover {
color: #1e90ff;
}
/* Animations */
@keyframes fadeInDown {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Responsive */
@media (max-width: 600px) {
header h1 {
font-size: 2rem;
}
.avatar {
width: 80px;
height: 80px;
}
.username {
font-size: 1rem;
}
.contributions {
font-size: 0.9rem;
}
}
</style>
</head>
<body>
<header>
<h1>KV-Nexus Contributors</h1>
<p>Meet the amazing individuals who built KV-Nexus</p>
</header>
<main>
<div class="contributors-grid" id="contributors">
<!-- Contributor cards will be injected here -->
</div>
</main>
<footer>
<p>Built with ❤️ by KV-Nexus Team</p>
<div>
<a href="https://github.com/kvcops/KV-Nexus" target="_blank"><i class="fab fa-github fa-lg"></i></a>
<a href="https://twitter.com/" target="_blank"><i class="fab fa-twitter fa-lg"></i></a>
<a href="https://linkedin.com/" target="_blank"><i class="fab fa-linkedin fa-lg"></i></a>
</div>
</footer>
<script>
const contributorsContainer = document.getElementById('contributors');
async function fetchContributors() {
try {
const response = await fetch('https://api.github.com/repos/kvcops/KV-Nexus/contributors');
if (!response.ok) {
throw new Error('Network response was not ok');
}
const contributors = await response.json();
displayContributors(contributors);
} catch (error) {
console.error('Error fetching contributors:', error);
contributorsContainer.innerHTML = '<p style="color: #ffdddd;">Failed to load contributors. Please try again later.</p>';
}
}
function displayContributors(contributors) {
contributorsContainer.innerHTML = '';
contributors.forEach(contributor => {
const card = document.createElement('div');
card.classList.add('card');
const avatar = document.createElement('img');
avatar.src = contributor.avatar_url;
avatar.alt = `${contributor.login}'s avatar`;
avatar.classList.add('avatar');
const username = document.createElement('div');
username.classList.add('username');
username.textContent = contributor.login;
const contributions = document.createElement('div');
contributions.classList.add('contributions');
contributions.textContent = `${contributor.contributions} contributions`;
card.appendChild(avatar);
card.appendChild(username);
card.appendChild(contributions);
contributorsContainer.appendChild(card);
});
}
// Initial fetch
fetchContributors();
</script>
</body>
</html>
How It Works:
-
HTML Structure:
- Header: Displays the title and a brief description.
- Main: Contains a
contributors-grid where contributor cards will be dynamically injected.
- Footer: Includes social media icons linking to GitHub, Twitter, and LinkedIn (you can update these links as needed).
-
CSS Styling:
- Utilizes a modern color scheme with a gradient background.
- Implements responsive grid layout using CSS Grid.
- Adds smooth hover animations to contributor cards and avatar images.
- Includes keyframe animations (
fadeInDown, fadeInUp) for engaging entrance effects.
- Ensures the design is mobile-friendly with media queries.
-
JavaScript Functionality:
- Fetch Contributors: Uses the GitHub API to retrieve contributors from the specified repository.
- Display Contributors: Dynamically creates and inserts contributor cards into the DOM.
- Error Handling: Displays an error message if the API request fails.
-
Enhancements & Features:
- Animations: Smooth transitions on hover and when elements load.
- Interactive Elements: Hover effects on cards and avatars to enhance user engagement.
- Icons: Uses Font Awesome for social media icons in the footer.
- Accessibility: Alt attributes for images and semantic HTML elements.
Customization:
- Social Media Links: Update the links in the footer to point to the actual social profiles of your team or project.
- Color Scheme: Feel free to adjust the gradient and other color properties in the CSS to match your branding.
- Additional Information: You can add more details to each contributor card, such as their role, bio, or links to their profiles.
Deployment:
To deploy this webpage:
- Save the Code: Copy the above code into a file named
index.html.
- Host the File: You can host it on platforms like GitHub Pages, Netlify, Vercel, or any web hosting service.
- Access the Page: Visit the hosted URL to see the contributors displayed beautifully.
Final Notes:
This webpage provides a dynamic and visually appealing way to showcase the contributors of your GitHub repository. By leveraging modern web design techniques and the power of the GitHub API, it ensures that your contributors are presented in a professional and engaging manner.
Feel free to further enhance this template with additional features such as search functionality, filtering, sorting, or integrating animations libraries like AOS for more advanced animations.