-
Notifications
You must be signed in to change notification settings - Fork 322
feat(ui): make project cards interactive #509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,7 +10,9 @@ import { Container } from '@/components/Container'; | |||||||||||||||||||||||||||||
| import { Banner } from '@/components/Banner'; | ||||||||||||||||||||||||||||||
| import { useRouter } from 'next/router'; | ||||||||||||||||||||||||||||||
| import Image from 'next/image'; | ||||||||||||||||||||||||||||||
| import projects from '@/helper/projects' | ||||||||||||||||||||||||||||||
| import projects from '@/helper/projects'; | ||||||||||||||||||||||||||||||
| import Link from 'next/link'; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| function LinkIcon(props) { | ||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||
| <svg viewBox="0 0 24 24" aria-hidden="true" {...props}> | ||||||||||||||||||||||||||||||
|
|
@@ -22,77 +24,90 @@ function LinkIcon(props) { | |||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // Define the Cards component here | ||||||||||||||||||||||||||||||
| const Cards = () => { | ||||||||||||||||||||||||||||||
| const router = useRouter(); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||
| <Grid container spacing={4} sx={{ paddingTop: '40px', justifyContent: 'center' }}> | ||||||||||||||||||||||||||||||
| {projects.map((project, index) => ( | ||||||||||||||||||||||||||||||
| <Grid item xs={12} sm={6} md={4} key={index}> | ||||||||||||||||||||||||||||||
| <MuiCard | ||||||||||||||||||||||||||||||
| className='dark:bg-[#2A2A2A] dark:border-white' | ||||||||||||||||||||||||||||||
| sx={{ | ||||||||||||||||||||||||||||||
| height: 400, | ||||||||||||||||||||||||||||||
| borderRadius: 2, | ||||||||||||||||||||||||||||||
| border: '1px solid', | ||||||||||||||||||||||||||||||
| borderColor: '#3c982c', | ||||||||||||||||||||||||||||||
| boxShadow: '0px 4px 4px #00000040', | ||||||||||||||||||||||||||||||
| backdropFilter: 'blur(4px) brightness(100%)', | ||||||||||||||||||||||||||||||
| display: 'flex', | ||||||||||||||||||||||||||||||
| flexDirection: 'column', | ||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||
| <CardContent sx={{ flexGrow: 1, textAlign: 'center' }}> | ||||||||||||||||||||||||||||||
| <Image | ||||||||||||||||||||||||||||||
| src={project.logo} | ||||||||||||||||||||||||||||||
| alt={`${project.title} image`} | ||||||||||||||||||||||||||||||
| width={80} | ||||||||||||||||||||||||||||||
| height={80} | ||||||||||||||||||||||||||||||
| style={{ margin: '0 auto 16px', objectFit: 'contain' }} | ||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||
| <Typography | ||||||||||||||||||||||||||||||
| variant="h5" | ||||||||||||||||||||||||||||||
| className="mt-6 font-mono text-green-600 dark:text-yellow-400" | ||||||||||||||||||||||||||||||
| sx={{ | ||||||||||||||||||||||||||||||
| fontFamily: 'Nunito-Bold', | ||||||||||||||||||||||||||||||
| color: '#3c982c', | ||||||||||||||||||||||||||||||
| textAlign: 'center', | ||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||
| {project.name} | ||||||||||||||||||||||||||||||
| </Typography> | ||||||||||||||||||||||||||||||
| {projects.map((project, index) => { | ||||||||||||||||||||||||||||||
| const projectUrl = (project.link && project.link.url) ? project.link.url : '#'; | ||||||||||||||||||||||||||||||
| const linkLabel = (project.link && project.link.label) ? project.link.label : 'View'; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| <Typography | ||||||||||||||||||||||||||||||
| variant="body1" | ||||||||||||||||||||||||||||||
| className="text-zinc-600 dark:text-zinc-400 text-lg font-mono leading-7 text-center" | ||||||||||||||||||||||||||||||
| sx={{ | ||||||||||||||||||||||||||||||
| fontFamily: 'Nunito-Light', | ||||||||||||||||||||||||||||||
| color: 'black', | ||||||||||||||||||||||||||||||
| mt: 2, | ||||||||||||||||||||||||||||||
| overflow: 'hidden', | ||||||||||||||||||||||||||||||
| textOverflow: 'ellipsis', | ||||||||||||||||||||||||||||||
| display: '-webkit-box', | ||||||||||||||||||||||||||||||
| WebkitBoxOrient: 'vertical', | ||||||||||||||||||||||||||||||
| WebkitLineClamp: 4, | ||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||
| {project.description} | ||||||||||||||||||||||||||||||
| </Typography> | ||||||||||||||||||||||||||||||
| </CardContent> | ||||||||||||||||||||||||||||||
| <CardActions sx={{ justifyContent: 'center' }}> | ||||||||||||||||||||||||||||||
| <p className="relative z-10 mt-6 flex text-md font-semibold font-mono text-zinc-600 transition group-hover:text-[#00843D] dark:group-hover:text-yellow-400 dark:text-zinc-200"> | ||||||||||||||||||||||||||||||
| <LinkIcon className="h-6 w-6 flex-none scale-110" /> | ||||||||||||||||||||||||||||||
| <span className="ml-2">{project.link.label}</span> | ||||||||||||||||||||||||||||||
| </p> | ||||||||||||||||||||||||||||||
| </CardActions> | ||||||||||||||||||||||||||||||
| </MuiCard> | ||||||||||||||||||||||||||||||
| </Grid> | ||||||||||||||||||||||||||||||
| )) | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| </Grid > | ||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||
| <Grid item xs={12} sm={6} md={4} key={index}> | ||||||||||||||||||||||||||||||
| <Link href={projectUrl} passHref legacyBehavior> | ||||||||||||||||||||||||||||||
| <a target="_blank" rel="noopener noreferrer" style={{ textDecoration: 'none', display: 'block', height: '100%' }}> | ||||||||||||||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||
| <MuiCard | ||||||||||||||||||||||||||||||
| className='dark:bg-[#2A2A2A] dark:border-white group' | ||||||||||||||||||||||||||||||
| sx={{ | ||||||||||||||||||||||||||||||
| height: 400, | ||||||||||||||||||||||||||||||
| borderRadius: 2, | ||||||||||||||||||||||||||||||
| border: '1px solid', | ||||||||||||||||||||||||||||||
| borderColor: '#3c982c', | ||||||||||||||||||||||||||||||
| boxShadow: '0px 4px 4px #00000040', | ||||||||||||||||||||||||||||||
| backdropFilter: 'blur(4px) brightness(100%)', | ||||||||||||||||||||||||||||||
| display: 'flex', | ||||||||||||||||||||||||||||||
| flexDirection: 'column', | ||||||||||||||||||||||||||||||
| transition: 'all 0.3s ease-in-out', | ||||||||||||||||||||||||||||||
| cursor: 'pointer', | ||||||||||||||||||||||||||||||
| ':hover': { | ||||||||||||||||||||||||||||||
| transform: 'translateY(-8px)', | ||||||||||||||||||||||||||||||
| boxShadow: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)', | ||||||||||||||||||||||||||||||
| borderColor: '#facc15', | ||||||||||||||||||||||||||||||
| backgroundColor: '#FEFCE8', | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||
| <CardContent sx={{ flexGrow: 1, textAlign: 'center' }}> | ||||||||||||||||||||||||||||||
| <Image | ||||||||||||||||||||||||||||||
| src={project.logo} | ||||||||||||||||||||||||||||||
| alt={`${project.title} image`} | ||||||||||||||||||||||||||||||
| width={80} | ||||||||||||||||||||||||||||||
| height={80} | ||||||||||||||||||||||||||||||
| style={{ margin: '0 auto 16px', objectFit: 'contain' }} | ||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||
|
Comment on lines
71
to
78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix incorrect property in alt text. Line 64 uses 🔎 Proposed fix <Image
src={project.logo}
- alt={`${project.title} image`}
+ alt={`${project.name} logo`}
width={80}
height={80}
style={{ margin: '0 auto 16px', objectFit: 'contain' }}
/>Note: Changed "image" to "logo" for more accurate description. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| <Typography | ||||||||||||||||||||||||||||||
| variant="h5" | ||||||||||||||||||||||||||||||
| className="mt-6 font-mono text-green-600 dark:text-yellow-400" | ||||||||||||||||||||||||||||||
| sx={{ | ||||||||||||||||||||||||||||||
| fontFamily: 'Nunito-Bold', | ||||||||||||||||||||||||||||||
| color: '#3c982c', | ||||||||||||||||||||||||||||||
| textAlign: 'center', | ||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||
| {project.name} | ||||||||||||||||||||||||||||||
| </Typography> | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| <Typography | ||||||||||||||||||||||||||||||
| variant="body1" | ||||||||||||||||||||||||||||||
| className="text-zinc-600 dark:text-zinc-400 text-lg font-mono leading-7 text-center" | ||||||||||||||||||||||||||||||
| sx={{ | ||||||||||||||||||||||||||||||
| fontFamily: 'Nunito-Light', | ||||||||||||||||||||||||||||||
| color: 'black', | ||||||||||||||||||||||||||||||
| mt: 2, | ||||||||||||||||||||||||||||||
| overflow: 'hidden', | ||||||||||||||||||||||||||||||
| textOverflow: 'ellipsis', | ||||||||||||||||||||||||||||||
| display: '-webkit-box', | ||||||||||||||||||||||||||||||
| WebkitBoxOrient: 'vertical', | ||||||||||||||||||||||||||||||
| WebkitLineClamp: 4, | ||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||
| {project.description} | ||||||||||||||||||||||||||||||
| </Typography> | ||||||||||||||||||||||||||||||
| </CardContent> | ||||||||||||||||||||||||||||||
| <CardActions sx={{ justifyContent: 'center' }}> | ||||||||||||||||||||||||||||||
| <p className="relative z-10 mt-6 flex text-md font-semibold font-mono text-zinc-600 transition-colors group-hover:text-[#00843D] dark:group-hover:text-yellow-400 dark:text-zinc-200"> | ||||||||||||||||||||||||||||||
| <LinkIcon className="h-6 w-6 flex-none scale-110" /> | ||||||||||||||||||||||||||||||
| <span className="ml-2">{linkLabel}</span> | ||||||||||||||||||||||||||||||
| </p> | ||||||||||||||||||||||||||||||
| </CardActions> | ||||||||||||||||||||||||||||||
| </MuiCard> | ||||||||||||||||||||||||||||||
| </a> | ||||||||||||||||||||||||||||||
| </Link> | ||||||||||||||||||||||||||||||
| </Grid> | ||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||
| })} | ||||||||||||||||||||||||||||||
| </Grid> | ||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
@@ -152,4 +167,4 @@ export default function Projects() { | |||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||
| </> | ||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.