-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #252 from MastanSayyad/mains
Create "Our Contributors" Page for the website
- Loading branch information
Showing
6 changed files
with
276 additions
and
45 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
.contributors-container { | ||
width: 100%; | ||
height: 100%; | ||
padding-top: 2rem; | ||
overflow: hidden; | ||
|
||
} | ||
|
||
.github-icon { | ||
margin-right: 0.5rem; | ||
vertical-align: middle; | ||
fill: white; /* Adjust color as needed */ | ||
} | ||
|
||
|
||
.contributors-title { | ||
margin-top: 0rem; | ||
text-align: center; | ||
color: #0077b6; | ||
font-size: 2.5rem; | ||
font-weight: bold; | ||
margin-bottom: 2rem; | ||
text-transform: uppercase; | ||
} | ||
|
||
.contributors-grid { | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: center; | ||
gap: 2rem; | ||
margin-bottom: 4rem; | ||
} | ||
|
||
.contributor-card { | ||
position: relative; | ||
width: 100%; | ||
max-width: 25%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
background-color: rgb(0,0,85); | ||
border: 1px solid #6969ff; | ||
border-radius: 0.5rem; | ||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); | ||
padding: 1rem; | ||
overflow: hidden; | ||
transition: transform 0.4s ease, box-shadow 0.3s ease; | ||
} | ||
|
||
.contributor-card:hover { | ||
transform: scale(1.05); | ||
box-shadow: 0 4px 6px rgba(5, 205, 208, 0.752); | ||
} | ||
|
||
.contributor-card:hover p { | ||
text-shadow: 1px 1px 2px rgb(0, 225, 255), 0 0 0.2em rgb(0, 191, 255), 0 0 0.8em rgb(135, 206, 235); | ||
color: rgb(0, 0, 0); | ||
font-weight: 500; | ||
} | ||
|
||
.contributor-card:hover h2 { | ||
text-shadow: 1px 1px 2px rgba(237, 9, 176, 0.926), 0 0 0.2em rgb(0, 191, 255), 0 0 0.8em rgb(135, 206, 235); | ||
color: white; | ||
font-size: 1.04rem; | ||
font-weight: 600; | ||
text-decoration: wavy; | ||
} | ||
|
||
.contributor-card:hover .contributor-avatar { | ||
border: 3.5px solid #89e6f0; | ||
width: 5.2rem; | ||
box-shadow: -2px 4px 10px 1px rgba(1, 41, 218, 0.75); | ||
height: 5.2rem; | ||
} | ||
|
||
.contributor-card::before { | ||
content: ''; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background: linear-gradient(152deg, #0077b6 50%, #023e8a 50%); | ||
transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; | ||
transform: translate(-100%, -100%); | ||
opacity: 0; | ||
z-index: -1; | ||
} | ||
|
||
.contributor-card:hover::before { | ||
transform: translate(0, 0); | ||
opacity: 1; | ||
} | ||
|
||
|
||
.contributor-link { | ||
display: block; | ||
} | ||
|
||
.contributor-avatar { | ||
width: 5rem; | ||
height: 5rem; | ||
border-radius: 50%; | ||
object-fit: cover; | ||
margin-bottom: 1rem; | ||
border: 2px solid #00b4d8; | ||
transition: border 0.4s ease-in-out, height 0.4s ease-in-out, width 0.4s ease-in-out, box-shadow 0.3s ease-in-out; | ||
} | ||
|
||
|
||
.contributor-name { | ||
font-size: 1rem; | ||
font-weight: 600; | ||
color: #f3f4f6; | ||
margin-bottom: 0.5rem; | ||
transition: text-shadow 0.4s ease-in-out, font-size 0.5s ease-in-out, text-decoration 0.4s ease-in-out; | ||
} | ||
|
||
.contributor-contributions { | ||
color: #d1d5db; | ||
transition: text-shadow 0.4s ease-in-out; | ||
} | ||
|
||
/* Media Queries for Responsiveness */ | ||
@media (max-width: 1200px) { | ||
.contributor-card { | ||
max-width: 33.333%; | ||
} | ||
} | ||
|
||
@media (max-width: 992px) { | ||
.contributor-card { | ||
max-width: 50%; | ||
} | ||
} | ||
|
||
@media (max-width: 768px) { | ||
.contributor-card { | ||
max-width: 97%; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import axios from 'axios'; | ||
import './Contributors.css'; | ||
import Preloader from '../Components/Preloader'; | ||
|
||
function Contributors() { | ||
const [contributors, setContributors] = useState([]); | ||
const [loading, setLoading] = useState(true); | ||
const [error, setError] = useState(null); // Added error state | ||
|
||
useEffect(() => { | ||
async function fetchContributors() { | ||
let allContributors = []; | ||
let page = 1; | ||
|
||
try { | ||
while (true) { | ||
const response = await axios.get( | ||
`https://api.github.com/repos/Trisha-tech/OnlineBookSales/contributors`, | ||
{ | ||
params: { | ||
per_page: 100, | ||
page, | ||
}, | ||
} | ||
); | ||
const data = response.data; | ||
if (data.length === 0) { | ||
break; | ||
} | ||
allContributors = [...allContributors, ...data]; | ||
page++; | ||
} | ||
setContributors(allContributors); | ||
} catch (error) { | ||
console.error('Error fetching contributors:', error.message); | ||
setError('Failed to load contributors. Please try again later.'); // Set error message | ||
} finally { | ||
setLoading(false); | ||
} | ||
} | ||
fetchContributors(); | ||
}, []); | ||
|
||
if (loading) { | ||
return <Preloader />; // Show preloader while loading | ||
} | ||
|
||
if (error) { | ||
return ( | ||
<div className="error-message"> | ||
<p>{error}</p> | ||
</div> | ||
); // Show error message if there's an error | ||
} | ||
|
||
return ( | ||
<div className="contributors-container"> | ||
<h1 className="contributors-title">Our Contributors</h1> | ||
<div className="contributors-grid"> | ||
{contributors.length > 0 ? ( | ||
contributors.map((contributor) => ( | ||
<div key={contributor.id} className="contributor-card"> | ||
<a | ||
href={contributor.html_url} | ||
className="contributor-link" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<img | ||
src={contributor.avatar_url} | ||
alt={contributor.login} | ||
className="contributor-avatar" | ||
/> | ||
</a> | ||
<h2 className="contributor-name">{contributor.login}</h2> | ||
<p className="contributor-contributions"> | ||
Contributions: {contributor.contributions} | ||
</p> | ||
</div> | ||
)) | ||
) : ( | ||
<p>No contributors found.</p> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default Contributors; |