From 446f4bb101539b488274d5345392d5c6f1c4eede Mon Sep 17 00:00:00 2001 From: efshaperveen Date: Sun, 12 Jan 2025 15:54:59 +0530 Subject: [PATCH 1/3] Added the contributors page --- assets/about/about.html | 1 + assets/contact/contact.html | 1 + assets/contributors/contributor.css | 99 ++++++++++++++++++++++++++++ assets/contributors/contributor.html | 81 +++++++++++++++++++++++ assets/contributors/contributor.js | 60 +++++++++++++++++ assets/pastevents/pastevents.html | 1 + index.html | 1 + 7 files changed, 244 insertions(+) create mode 100644 assets/contributors/contributor.css create mode 100644 assets/contributors/contributor.html create mode 100644 assets/contributors/contributor.js diff --git a/assets/about/about.html b/assets/about/about.html index e1f4baf..b557cf0 100644 --- a/assets/about/about.html +++ b/assets/about/about.html @@ -29,6 +29,7 @@
  • About
  • Upcoming Events
  • Past Events
  • +
  • Contributors
  • Contact
  • diff --git a/assets/contact/contact.html b/assets/contact/contact.html index cd3cff9..1c8ed5b 100644 --- a/assets/contact/contact.html +++ b/assets/contact/contact.html @@ -29,6 +29,7 @@
  • About
  • Upcoming Events
  • Past Events
  • +
  • Contributors
  • Contact
  • diff --git a/assets/contributors/contributor.css b/assets/contributors/contributor.css new file mode 100644 index 0000000..3b2f53b --- /dev/null +++ b/assets/contributors/contributor.css @@ -0,0 +1,99 @@ +body { + margin: 0; + font-family: 'Poppins', sans-serif; + background-color: #f7f8fa; + color: #333; + line-height: 1.6; +} + +.ctnr { + text-align: center; + max-width: 1200px; + width: 100%; + padding: 35px; + margin: 0 auto; + display: flex; + flex-direction: column; + align-items: center; + } + + + h1 { + font-size: 3rem; + color: #1da1f2; + margin-top: 100px; + margin-bottom: 30px; + 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 { + background: #ffffff; + 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 #1da1f2; + margin-bottom: 15px; + } + + .contributor-card h3 { + font-size: 1.4rem; + margin: 10px 0; + } + + .contributor-card a { + display: inline-block; + margin: 5px 0; + color: #1da1f2; + font-weight: bold; + text-decoration: none; + transition: color 0.3s ease; + } + + .contributor-card a:hover { + color: #004e64; + text-decoration: none; + } + + +footer { + margin-top: 30px; + text-align: center; + padding: 15px 20px; + background-color: #333; + color: white; + font-size: 1em; +} + + @media (min-width: 768px) { + .contributors-grid { + gap: calc(10px + 1.5vw); + } + } \ No newline at end of file diff --git a/assets/contributors/contributor.html b/assets/contributors/contributor.html new file mode 100644 index 0000000..3183152 --- /dev/null +++ b/assets/contributors/contributor.html @@ -0,0 +1,81 @@ + + + + + + + + + + + + Eventica | Contributor Page + + + + + +
    +

    Meet Our Contributors

    +
    +
    + + +
    + +
    + + + + + + + + + + + \ No newline at end of file diff --git a/assets/contributors/contributor.js b/assets/contributors/contributor.js new file mode 100644 index 0000000..c03dfc4 --- /dev/null +++ b/assets/contributors/contributor.js @@ -0,0 +1,60 @@ +const REPO_OWNER = "Rakesh9100"; +const REPO_NAME = "Eventica"; +const GITHUB_TOKEN = ""; // Optional: Add your GitHub personal access token to avoid rate limits + +async function fetchContributors() { + const contributorsContainer = document.getElementById("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) => { + // 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); + + // Append card to container + contributorsContainer.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."; + contributorsContainer.appendChild(errorMessage); + } +} + +// Fetch and render contributors on page load +fetchContributors(); \ No newline at end of file diff --git a/assets/pastevents/pastevents.html b/assets/pastevents/pastevents.html index 36c9684..ddb7065 100644 --- a/assets/pastevents/pastevents.html +++ b/assets/pastevents/pastevents.html @@ -35,6 +35,7 @@
  • About
  • Upcoming Events
  • Past Events
  • +
  • Contributors
  • Contact
  • diff --git a/index.html b/index.html index 7b1bec1..048975f 100644 --- a/index.html +++ b/index.html @@ -40,6 +40,7 @@
  • About
  • Upcoming Events
  • Past Events
  • +
  • Contributors
  • Contact
  • From c152d9510bb73d29f95d1506cb4c17baa26dacf4 Mon Sep 17 00:00:00 2001 From: Efsha Perveen <149947236+efshaperveen@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:30:20 +0530 Subject: [PATCH 2/3] Update contributor.js --- assets/contributors/contributor.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/contributors/contributor.js b/assets/contributors/contributor.js index c03dfc4..3a4341a 100644 --- a/assets/contributors/contributor.js +++ b/assets/contributors/contributor.js @@ -17,8 +17,12 @@ async function fetchContributors() { if (!response.ok) throw new Error("Failed to fetch contributors"); const contributors = await response.json(); + // Filter out the repository owner + const filteredContributors = contributors.filter( + (contributor) => contributor.login !== REPO_OWNER + ); - contributors.forEach((contributor) => { + filteredContributors.forEach((contributor) => { // Create a card for each contributor const card = document.createElement("div"); card.className = "contributor-card"; @@ -57,4 +61,4 @@ async function fetchContributors() { } // Fetch and render contributors on page load -fetchContributors(); \ No newline at end of file +fetchContributors(); From def4dbbce8c5fb46fa1ff1f490e96572af3d0e75 Mon Sep 17 00:00:00 2001 From: Rakesh Roshan Date: Tue, 14 Jan 2025 18:46:20 +0530 Subject: [PATCH 3/3] Fixed the indentation --- assets/contributors/contributor.css | 91 ++++++++++++--------------- assets/contributors/contributor.html | 12 ++-- assets/contributors/contributor.js | 93 ++++++++++++++-------------- 3 files changed, 94 insertions(+), 102 deletions(-) diff --git a/assets/contributors/contributor.css b/assets/contributors/contributor.css index 3b2f53b..19a7413 100644 --- a/assets/contributors/contributor.css +++ b/assets/contributors/contributor.css @@ -11,34 +11,33 @@ body { max-width: 1200px; width: 100%; padding: 35px; - margin: 0 auto; - display: flex; + margin: 0 auto; + display: flex; flex-direction: column; - align-items: center; - } - + align-items: center; +} - h1 { +h1 { font-size: 3rem; color: #1da1f2; margin-top: 100px; margin-bottom: 30px; font-weight: bold; letter-spacing: 2px; - } - - /* Contributor Card Grid */ - .contributors-grid { +} + +.contributors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); - gap: calc(10px + 1vw); - justify-items: center; + gap: calc(10px + 1vw); + justify-items: center; align-items: center; - width: 100%; - } - - /* Contributor Card Styling */ - .contributor-card { + width: 100%; +} + +/* Contributor card Css */ + +.contributor-card { background: #ffffff; color: #333; border-radius: 15px; @@ -48,52 +47,42 @@ body { text-align: center; transition: transform 0.3s ease, box-shadow 0.3s ease; position: relative; - } - - .contributor-card:hover { - transform: translateY(-10px); +} + +.contributor-card:hover { + transform: translateY(-10px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2); - } - - .contributor-card img { +} + +.contributor-card img { width: 100px; height: 100px; border-radius: 50%; - border: 3px solid #1da1f2; + border: 3px solid #1da1f2; margin-bottom: 15px; - } - - .contributor-card h3 { +} + +.contributor-card h3 { font-size: 1.4rem; margin: 10px 0; - } - - .contributor-card a { +} + +.contributor-card a { display: inline-block; margin: 5px 0; color: #1da1f2; font-weight: bold; text-decoration: none; transition: color 0.3s ease; - } - - .contributor-card a:hover { - color: #004e64; - text-decoration: none; - } +} - -footer { - margin-top: 30px; - text-align: center; - padding: 15px 20px; - background-color: #333; - color: white; - font-size: 1em; +.contributor-card a:hover { + color: #004e64; + text-decoration: none; } - - @media (min-width: 768px) { - .contributors-grid { - gap: calc(10px + 1.5vw); - } - } \ No newline at end of file + +@media (min-width: 768px) { + .contributors-grid { + gap: calc(10px + 1.5vw); + } +} \ No newline at end of file diff --git a/assets/contributors/contributor.html b/assets/contributors/contributor.html index 3183152..b1c3fb9 100644 --- a/assets/contributors/contributor.html +++ b/assets/contributors/contributor.html @@ -5,17 +5,17 @@ - + - - Eventica | Contributor Page + + Eventica | Contributors + +

    Meet Our Contributors

    @@ -74,8 +76,8 @@

    Meet Our Contributors

    - + \ No newline at end of file diff --git a/assets/contributors/contributor.js b/assets/contributors/contributor.js index 3a4341a..55dd78c 100644 --- a/assets/contributors/contributor.js +++ b/assets/contributors/contributor.js @@ -3,62 +3,63 @@ const REPO_NAME = "Eventica"; const GITHUB_TOKEN = ""; // Optional: Add your GitHub personal access token to avoid rate limits async function fetchContributors() { - const contributorsContainer = document.getElementById("contributors"); + const contributorsContainer = document.getElementById("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}` } : {}, - } - ); + 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"); + if (!response.ok) throw new Error("Failed to fetch contributors"); - const contributors = await response.json(); - // Filter out the repository owner - const filteredContributors = contributors.filter( - (contributor) => contributor.login !== REPO_OWNER - ); + const contributors = await response.json(); + // Filter out the repository owner + const filteredContributors = contributors.filter( + (contributor) => contributor.login !== REPO_OWNER + ); - filteredContributors.forEach((contributor) => { - // Create a card for each contributor - const card = document.createElement("div"); - card.className = "contributor-card"; + filteredContributors.forEach((contributor) => { + // 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; + // 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 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"; + // 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); + // Append elements to card + card.appendChild(img); + card.appendChild(name); + card.appendChild(githubLink); - // Append card to container - contributorsContainer.appendChild(card); - }); - } catch (error) { - console.error("Error fetching contributors:", error); + // Append card to container + contributorsContainer.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."; - contributorsContainer.appendChild(errorMessage); - } + // Show error message on the page + const errorMessage = document.createElement("p"); + errorMessage.textContent = "Failed to load contributors. Please try again."; + contributorsContainer.appendChild(errorMessage); + } } // Fetch and render contributors on page load -fetchContributors(); +fetchContributors(); \ No newline at end of file