Skip to content

Commit 918ee05

Browse files
Priyanshu SinghPriyanshu Singh
authored andcommitted
chore: remove comments and clean ContributorCard component
1 parent bc57607 commit 918ee05

File tree

2 files changed

+207
-42
lines changed

2 files changed

+207
-42
lines changed
Lines changed: 139 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,114 @@
11
import React, { useState, useEffect } from "react";
2-
import { makeStyles } from "@material-ui/core/styles";
2+
import { makeStyles, useTheme } from "@material-ui/core/styles";
33
import Card from "@material-ui/core/Card";
44
import CardActions from "@material-ui/core/CardActions";
55
import CardContent from "@material-ui/core/CardContent";
66
import Button from "@material-ui/core/Button";
77
import Typography from "@material-ui/core/Typography";
88
import Avatar from "@material-ui/core/Avatar";
9-
import {contributorsUrl} from "../Constants/urlConfig"
9+
import {contributorsUrl} from "../Constants/urlConfig";
1010

11-
const useStyles = makeStyles({
12-
root: {
13-
// minWidth: 275,
14-
maxWidth: 400,
15-
padding: 10,
16-
margin: 10
17-
},
18-
bullet: {
19-
display: "inline-block",
20-
margin: "0 2px",
21-
transform: "scale(0.8)",
11+
// Helper function to check if a color is a gradient or image URL
12+
const isComplexBackground = (bg) => bg && (bg.includes('gradient') || bg.includes('url'));
13+
14+
15+
// 3. Update makeStyles to use SELECTED_THEME colors
16+
const useStyles = makeStyles(theme => ({
17+
root: {
18+
maxWidth: 650,
19+
padding: theme.spacing(3), // Use theme spacing for consistency (24px)
20+
margin: theme.spacing(2), // Use theme spacing for consistency (16px)
21+
22+
// MODERNIZED BACKGROUND GRADIENT
23+
background: theme.palette.type === 'dark'
24+
? 'linear-gradient(135deg, #1c2128 0%, #0d1117 100%)' // Slightly adjusted dark gradient
25+
: 'linear-gradient(135deg, #ffffff 0%, #f7f7f7 100%)', // Softer light gradient
26+
27+
borderRadius: 12, // Slightly reduced border radius for a modern feel
28+
transition: 'transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1)',
29+
border: theme.palette.type === 'dark' ? '1px solid #30363d' : '1px solid #e1e4e8', // Added subtle light mode border
30+
31+
'&:hover': {
32+
transform: 'translateY(-6px)', // Deeper lift on hover
33+
// MODERN SHADOW: Use a more diffused shadow for a 3D-pop effect
34+
boxShadow: theme.palette.type === 'dark'
35+
? '0 15px 30px rgba(0,0,0,0.45)'
36+
: '0 15px 30px rgba(0,0,0,0.15)',
37+
}
38+
},
39+
title: {
40+
fontSize: '1.75rem', // Larger, more impactful title
41+
fontWeight: 700, // Bolder font weight
42+
marginBottom: theme.spacing(1), // Reduced margin below for tighter grouping
43+
// SLIGHTLY BRIGHTER TEXT FOR DARK MODE CONTRAST
44+
color: theme.palette.type === 'dark' ? '#f0f6fc' : theme.palette.text.primary,
45+
textAlign: 'center'
46+
},
47+
subtitle: {
48+
fontSize: '1rem', // Standard font size
49+
// MORE SUBDUED TEXT FOR LIGHT MODE
50+
color: theme.palette.type === 'dark' ? theme.palette.text.secondary : '#6a737d',
51+
textAlign: 'center',
52+
marginBottom: theme.spacing(4), // Increased margin below subtitle
53+
},
54+
avatarContainer: {
55+
display: 'flex',
56+
flexWrap: 'wrap',
57+
justifyContent: 'center',
58+
gap: theme.spacing(1.5), // Tighter gap between avatars
59+
marginTop: theme.spacing(2),
60+
marginBottom: theme.spacing(3),
2261
},
23-
title: {
24-
fontSize: 14,
62+
avatar: {
63+
width: 50,
64+
height: 50,
65+
borderRadius: '50%', // Explicitly ensure circular
66+
border: theme.palette.type === 'dark' ? '2px solid #2ea043' : '2px solid #2196F3', // Subtle color ring
67+
transition: 'transform 0.2s ease, box-shadow 0.2s ease',
68+
'&:hover': {
69+
transform: 'scale(1.18)', // Slightly larger scale up
70+
boxShadow: '0 6px 12px rgba(0,0,0,0.3)', // Sharper shadow on individual hover
71+
zIndex: 1,
72+
}
2573
},
26-
pos: {
27-
marginBottom: 12,
74+
button: {
75+
borderRadius: 25, // More rounded, 'pill' shape
76+
padding: '10px 30px', // More vertical padding
77+
textTransform: 'none',
78+
fontWeight: 600,
79+
color: '#ffffff',
80+
81+
// UPDATED DARK MODE BUTTON TO SOFTER GREEN (More like GitHub actions)
82+
background: theme.palette.type === 'dark'
83+
? 'linear-gradient(45deg, #2ea043 30%, #34bf49 90%)' // Green gradient
84+
: 'linear-gradient(45deg, #1877f2 30%, #21a9f3 90%)', // Facebook-blue gradient for light mode
85+
86+
// MODERN SHADOW FOR BUTTON
87+
boxShadow: theme.palette.type === 'dark'
88+
? '0 6px 10px 0 rgba(46, 160, 67, 0.4)'
89+
: '0 6px 10px 0 rgba(33, 150, 243, 0.4)',
90+
91+
'&:hover': {
92+
// Slightly change gradient direction on hover
93+
background: theme.palette.type === 'dark'
94+
? 'linear-gradient(45deg, #34bf49 30%, #2ea043 90%)'
95+
: 'linear-gradient(45deg, #21a9f3 30%, #1877f2 90%)',
96+
boxShadow: theme.palette.type === 'dark'
97+
? '0 4px 8px 0 rgba(46, 160, 67, 0.6)'
98+
: '0 4px 8px 0 rgba(33, 150, 243, 0.6)',
99+
}
28100
},
29-
});
101+
cardActions: {
102+
justifyContent: 'center',
103+
padding: theme.spacing(2, 0), // Use theme spacing
104+
}
105+
}));
30106

31107
const ContributorsCard = () => {
32108
const [listOfContributors,setListOfContributors] = useState([]);
109+
const theme = useTheme();
110+
111+
const classes = useStyles();
33112

34113
useEffect(()=>{
35114
fetchContributors();
@@ -43,57 +122,79 @@ const ContributorsCard = () => {
43122
throw new Error('Failed to fetch contributors');
44123
}
45124
const data = await res.json();
46-
setListOfContributors(data);
125+
if (Array.isArray(data)) {
126+
setListOfContributors(data);
127+
} else {
128+
console.error('Fetched data is not an array:', data);
129+
setListOfContributors([]);
130+
}
47131
} catch (error) {
48132
console.error('Error fetching contributors:', error);
133+
setListOfContributors([]);
49134
}
50135
};
51136

52-
const classes = useStyles();
53-
54137
return (
55138
<div
56139
style={{
57140
display: "flex",
58-
margin:"10px",
141+
margin: "20px",
59142
justifyContent: "center",
60143
alignItems: "center",
61144
}}
62145
>
63146
<Card raised className={classes.root}>
64147
<CardContent>
65-
A Special Thanks To All The Contributors!
66-
<Typography variant="h5" component="h2">
67-
We are grateful{" "}
68-
<span role="img" aria-label="sheep">
148+
<Typography className={classes.title} variant="h5" component="h2">
149+
A Special Thanks To All The Contributors!{" "}
150+
<span
151+
role="img"
152+
aria-label="heart"
153+
style={{
154+
fontSize: '28px',
155+
// Added a slight filter for a modern glow in dark mode
156+
filter: theme.palette.type === 'dark' ? 'drop-shadow(0 0 4px #ff5050)' : 'none'
157+
}}
158+
>
69159
❤️
70160
</span>
71161
</Typography>
72-
<Typography className={classes.pos} color="textSecondary">
73-
To our {listOfContributors.length} contributors for helping in
74-
<br />
75-
bringing this project to life
162+
<Typography className={classes.subtitle} color="textSecondary">
163+
We are grateful to our {listOfContributors.length} amazing contributors
164+
for bringing this project to life
76165
</Typography>
77166

78-
<div style={{display:'flex',alignItems:'center'}}>
79-
167+
<div className={classes.avatarContainer}>
80168
{
81-
listOfContributors.slice(0,Math.min(listOfContributors.length,7)).map((contributor)=>{
169+
listOfContributors.slice(0, Math.min(listOfContributors.length, 8)).map((contributor) => {
82170
return(
83-
<Avatar key={contributor.id} style={{marginRight:'5px', marginLeft:'5px'}} alt={contributor.login} src={contributor.avatar_url} />
171+
<Avatar
172+
key={contributor.id}
173+
className={classes.avatar}
174+
alt={contributor.login}
175+
src={contributor.avatar_url}
176+
title={contributor.login}
177+
/>
84178
)
85179
})
86180
}
87181
</div>
88182
</CardContent>
89-
<CardActions>
90-
<a style={{textDecoration:"none"}} href="https://github.com/zhravan/github-readme-quotes/graphs/contributors">
91-
<Button variant="contained" color="primary" size="small">More Details Here</Button>
183+
<CardActions className={classes.cardActions}>
184+
<a style={{textDecoration:"none"}} href="https://github.com/zhravan/github-readme-quotes/graphs/contributors">
185+
<Button
186+
variant="contained"
187+
color="primary"
188+
className={classes.button}
189+
size="large"
190+
>
191+
View All Contributors
192+
</Button>
92193
</a>
93194
</CardActions>
94195
</Card>
95196
</div>
96197
);
97198
};
98199

99-
export default ContributorsCard;
200+
export default ContributorsCard;

src/themes/themes.js

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,72 @@ const themes = {
263263
quote_color: "#94ff29",
264264
author_color: "#3aff29",
265265
bg_color: "url('https://cdn.wallpapersafari.com/90/94/AmZe8I.jpg') center"
266-
}
267-
};
268-
266+
},
267+
268+
// ===================================
269+
// 10 NEW THEMES ADDED BELOW
270+
// ===================================
271+
272+
// 1. Popular editor theme
273+
"catppuccin-mocha": {
274+
quote_color: "#cba6f7", // Mauve
275+
author_color: "#a6e3a1", // Green
276+
bg_color: "#1e1e2e", // Base
277+
},
278+
// 2. Another popular editor theme
279+
"rose-pine": {
280+
quote_color: "#e0d1f7", // Rose Pine Fog
281+
author_color: "#9ccfd8", // Rose Pine Aqua
282+
bg_color: "#191724", // Rose Pine Base
283+
},
284+
// 3. Light mode variant
285+
"ayu-light": {
286+
quote_color: "#86b300", // Ayu Light 'Green'
287+
author_color: "#5c6773", // Ayu Light 'Text'
288+
bg_color: "#f8f8f8", // Ayu Light 'Background'
289+
},
290+
// 4. High-contrast, warm colors
291+
"fire-opal": {
292+
quote_color: "#ff6d00", // Deep Orange/Fire Opal
293+
author_color: "#00bfa5", // Teal Accent
294+
bg_color: "#1c1c1c", // Dark Gray
295+
},
296+
// 5. Classic Dark Terminal look
297+
"hacker-green": {
298+
quote_color: "#00ff41", // Bright Neon Green
299+
author_color: "#10c634", // Darker Green
300+
bg_color: "#000000",
301+
},
302+
// 6. Soft Lavender gradient
303+
"lavender-dawn": {
304+
quote_color: "#4a4e69", // Dark Text
305+
author_color: "#9a8c98", // Muted Author
306+
bg_color: "linear-gradient(to top right, #f2e9e4, #c9ada7)",
307+
},
308+
// 7. Azure Blue/Silver
309+
"azure": {
310+
quote_color: "#3498db", // Bright Azure Blue
311+
author_color: "#ecf0f1", // Silver
312+
bg_color: "#2c3e50", // Midnight Blue
313+
},
314+
// 8. Elegant sepia-toned light theme
315+
"old-book": {
316+
quote_color: "#5b4a3a", // Dark Brown Text
317+
author_color: "#8a735a", // Sepia Text
318+
bg_color: "#fff8e1", // Off-White/Cream
319+
},
320+
// 9. Retro-futuristic dark neon
321+
"neon-blaze": {
322+
quote_color: "#ff0099", // Neon Pink
323+
author_color: "#00ffff", // Neon Cyan
324+
bg_color: "#0a0a0a",
325+
},
326+
// 10. Earthy and muted
327+
"forest-path": {
328+
quote_color: "#4a7c59", // Deep Forest Green
329+
author_color: "#a8dadc", // Light Blue/Sky
330+
bg_color: "#373b3e", // Slate Gray
331+
},
332+
};
269333

270-
module.exports=themes;
334+
module.exports = themes;

0 commit comments

Comments
 (0)