From 19c611b8f2d6ffa6405a1c325972bbe2ffb6565f Mon Sep 17 00:00:00 2001 From: Vaibhav Babele Date: Mon, 13 Jan 2025 13:28:53 +0530 Subject: [PATCH 1/3] ADD CONTRIBUTOR PAGE AND CONNECT TO OTHER PAGES --- contributors/contributor.css | 247 ++++++++++++++++++++++++++++++++++ contributors/contributor.html | 79 +++++++++++ contributors/contributor.js | 95 +++++++++++++ counting.html | 1 + feedback.html | 1 + login.html | 1 + signup.html | 1 + 7 files changed, 425 insertions(+) create mode 100644 contributors/contributor.css create mode 100644 contributors/contributor.html create mode 100644 contributors/contributor.js diff --git a/contributors/contributor.css b/contributors/contributor.css new file mode 100644 index 0000000..5da4b38 --- /dev/null +++ b/contributors/contributor.css @@ -0,0 +1,247 @@ +body { + margin: 0; + padding: 0; + font-family: 'Poppins', sans-serif; + color: #fff; + background: #637090; + overflow-x: hidden; + } + + /* Navbar */ + .navbar { + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px 20px; + background-image: linear-gradient(to right,#f3c3f9, #2a2a48,#c3d2f9); + position: sticky; + top: 0; + z-index: 1000; + height:90px; + width: 100%; + box-sizing: border-box; + border-bottom:#ffcc00 5px solid; + } + + .navbar-logo { + font-size: 25px; + font-weight: 600; + color: #FFD369; + } + + .navbar-links { + + display: flex; + gap: 30px; + list-style: none; + margin-right:20px; + } + + .navbar-link { + text-decoration: none; + color: #fff; + font-size: 20px; + font-weight: 300; + transition: color 0.3s ease; + + } + .navbar-link:hover{ + text-decoration: underline; + transition: color 0.3s ease; + } + + .navbar-link:hover { + color: #FFD369; + } + + h1 { + align-items: center; + justify-content: center; + font-size: 3rem; + color: #fff; + margin-bottom: 40px; + font-weight: bold; + letter-spacing: 2px; + } + + + h2{ + + text-align: center; + justify-content: center; + font-size: 3rem; + color: #fff; + margin: 40px; + font-weight: bold; + letter-spacing: 2px; + + } + + /* Contributor Card Grid */ + .contributors-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); + gap: calc(10px + 1vw); + justify-items: center; + align-items: center; + width: 100%; + } + + /* Contributor Card Styling */ + .contributor-card { + border:red 8px double; + background: #f8e6e6; + color: #333; + border-radius: 15px; + padding: 20px; + width: 250px; + box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1); + text-align: center; + transition: transform 0.3s ease, box-shadow 0.3s ease; + position: relative; + } + + .contributor-card:hover { + + transform: translateY(-10px); + box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2); + + } + + .contributor-card img { + width: 100px; + height: 100px; + border-radius: 50%; + border: 3px solid #121115; + margin-bottom: 15px; + } + + .contributor-card h3 { + font-size: 1.4rem; + font-weight: bold; + margin: 10px 0; + } + + .contributor-card a { + display: inline-block; + margin: 5px 0; + color: #d82de7; + font-weight: bold; + text-decoration: none; + transition: color 0.3s ease; + border-radius: 10px; + border: #f5cbcb 2px solid; + padding: 4px; + } + + .contributor-card a:hover { + color: #004e64; + text-decoration: none; + } + + /* Animated Button */ + .button { + background: #004e64; + color: #fff; + padding: 12px 24px; + font-size: 1rem; + border: none; + border-radius: 30px; + cursor: pointer; + margin-top: 30px; + transition: transform 0.2s ease, background 0.3s ease; + text-transform: uppercase; + } + + .button:hover { + transform: scale(1.05); + background: #004e64; + } + + .button:focus { + outline: none; + } + + /* Hamburger Menu */ + .hamburger { + display: none; + flex-direction: column; + cursor: pointer; + gap: 5px; + } + + .hamburger span { + display: block; + width: 25px; + height: 3px; + background-color: #fff; + border-radius: 5px; + } + + /* Responsive Design for Mobile */ + @media (max-width: 768px) { + + .navbar-logo { + font-size: 24px; + } + + .navbar-links { + + display: none; + flex-direction: column; + background-color: #1B1B2F; + position: absolute; + top: 65%; + right: 0; + width: 100%; + padding: 20px 0; + gap: 10px; + margin: 30px -5px; + width: 100%; + + } + + .navbar-link{ + padding: 5px 5px; + } + + .navbar-links.show { + display: flex; + + } + + .hamburger { + display: flex; + } + .container { + padding: 20px; + } + + h1 { + font-size: 2rem; + margin-bottom: 20px; + } + + /* Adjust the grid gap for mobile */ + .contributors-grid { + gap: calc(10px + 2vw); + } + } + + /* Responsive Design for Tablet/Desktop */ + @media (min-width: 768px) { + .contributors-grid { + gap: calc(10px + 1.5vw); + } + } + + + /* Footer */ + .footer { + border-top:#ffcc00 5px solid; + margin-top: 20px; + text-align: center; + padding: 20px; + background-color: #01070b; + color: #F3F4F6; + } \ No newline at end of file diff --git a/contributors/contributor.html b/contributors/contributor.html new file mode 100644 index 0000000..8a02c2e --- /dev/null +++ b/contributors/contributor.html @@ -0,0 +1,79 @@ + + + + + + + Contributors Page + + + + + + + + + + + + + + + + +
+

Meet Our Contributors

+

Admin/Mentor

+
+

Top 3 Contributors

+
+

remaining-contributors

+
+ + +
+ + + + + + + \ No newline at end of file diff --git a/contributors/contributor.js b/contributors/contributor.js new file mode 100644 index 0000000..4c5bda2 --- /dev/null +++ b/contributors/contributor.js @@ -0,0 +1,95 @@ +const REPO_OWNER = "Anjaliavv51"; +const REPO_NAME = "Matrubodhah"; +const GITHUB_TOKEN = ""; // Optional: Add your GitHub personal access token to avoid rate limits + +// Replace with actual GitHub usernames for Admin and Mentor +const ADMIN_USERNAME = REPO_OWNER; +const MENTOR_USERNAME = "mentor_username"; + +async function fetchContributors() { + const adminMentorContainer = document.getElementById("admin-mentor"); + const topContributorsContainer = document.getElementById("top-contributors"); + const remainingContributorsContainer = document.getElementById("remaining-contributors"); + + try { + // Fetch contributors from the GitHub API + const response = await fetch( + `https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/contributors`, + { + headers: GITHUB_TOKEN ? { Authorization: `token ${GITHUB_TOKEN}` } : {}, + } + ); + + if (!response.ok) throw new Error("Failed to fetch contributors"); + + const contributors = await response.json(); + + contributors.forEach((contributor, index) => { + // Create a card for each contributor + const card = document.createElement("div"); + card.className = "contributor-card"; + + // Profile image + const img = document.createElement("img"); + img.src = contributor.avatar_url; + img.alt = contributor.login; + + // GitHub username + const name = document.createElement("h3"); + name.textContent = contributor.login; + + // GitHub profile link + const githubLink = document.createElement("a"); + githubLink.href = contributor.html_url; + githubLink.target = "_blank"; + githubLink.textContent = "GitHub Profile"; + + // Append elements to card + card.appendChild(img); + card.appendChild(name); + card.appendChild(githubLink); + + // Admin/Mentor Section + if (contributor.login === ADMIN_USERNAME || contributor.login === MENTOR_USERNAME) { + if (adminMentorContainer.children.length === -1) { + + adminMentorContainer.appendChild(adminMentorHeader); + } + adminMentorContainer.appendChild(card); + } + // Top 3 Contributors + else if (index <= 3) { + if (topContributorsContainer.children.length === -1) { + + + topContributorsContainer.appendChild(topContributorsHeader); + } + topContributorsContainer.appendChild(card); + } + // Remaining Contributors + else { + if (remainingContributorsContainer.children.length === -1) { + + remainingContributorsContainer.appendChild(remainingContributorsHeader); + } + remainingContributorsContainer.appendChild(card); + } + }); + } catch (error) { + console.error("Error fetching contributors:", error); + + // Show error message on the page + const errorMessage = document.createElement("p"); + errorMessage.textContent = "Failed to load contributors. Please try again."; + adminMentorContainer.appendChild(errorMessage); + } +} + +// Fetch and render contributors on page load +fetchContributors(); + +// Hamburger menu toggle +document.querySelector('.hamburger').addEventListener('click', () => { + const navLinks = document.querySelector('.navbar-links'); + navLinks.classList.toggle('show'); +}); \ No newline at end of file diff --git a/counting.html b/counting.html index cfa1a2f..2d6319f 100644 --- a/counting.html +++ b/counting.html @@ -20,6 +20,7 @@