-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add full res preview to gallery; some refactoring
- Loading branch information
Showing
6 changed files
with
153 additions
and
91 deletions.
There are no files selected for viewing
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,46 @@ | ||
import React from 'react' | ||
import { Link } from 'react-router-dom' | ||
import styled from 'styled-components' | ||
import Card from '@mui/material/Card' | ||
|
||
|
||
type LinkCardProps = { | ||
title: string | ||
src: string | ||
link: string | ||
alt?: string | ||
description?: string | ||
} | ||
|
||
export default function ImageLinkCard(props: LinkCardProps) { | ||
const {title, src, link, alt} = props | ||
return ( | ||
<Root> | ||
<Card | ||
className="card z-0 relative" | ||
component={Link} | ||
to={link} | ||
> | ||
<img src={src} alt={alt} className="max-w-[256px] md:max-w-[220px] md:max-h-[220px]" /> | ||
<h3 className="text-white absolute left-4 bottom-0 z-10">{title}</h3> | ||
</Card> | ||
</Root> | ||
) | ||
} | ||
|
||
const Root = styled.div` | ||
.card::after { | ||
display: block; | ||
position: relative; | ||
background-image: linear-gradient(to bottom, transparent 0%, black 100%); | ||
margin-top: -110px; | ||
height: 110px; | ||
width: 100%; | ||
content: ''; | ||
} | ||
.card:hover h3 { | ||
color: rgb(121, 208, 255); | ||
text-decoration: underline; | ||
} | ||
` |
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