Skip to content
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

feat: team image greyscale aniamtion #93

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions components/TeamCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,26 @@ function TeamCard(props: TeamCardProps): JSX.Element {

return (
<div className={styles['team-card']}>
{props.data.link ? (
<>
<a
data-tip
data-for={props.data.name}
target='_blank'
rel='noreferrer'
href={props.data.link}
>
{image}
</a>
<ReactTooltip id={props.data.name} className={styles['team-tooltip']} arrowColor='transparent' textColor='black' backgroundColor='#FFF740'>
{props.data.link.split('//').slice(-1)[0] + ' ↗'}
</ReactTooltip>
</>
) : (
image
)}
<div className={styles.profile}>
{props.data.link ? (
<>
<a
data-tip
data-for={props.data.name}
target='_blank'
rel='noreferrer'
href={props.data.link}
>
{image}
</a>
<ReactTooltip id={props.data.name} className={styles['team-tooltip']} arrowColor='transparent' textColor='black' backgroundColor='#FFF740'>
{props.data.link.split('//').slice(-1)[0] + ' ↗'}
</ReactTooltip>
</>
) : (
image
)}
</div>
<h4 className={styles['team-title']}>{props.data.name}</h4>
<p>{props.alumni ? 'ALUMNI' : `CLASS OF ${props.data.class}`}</p>
{props.data.roles.map((role) => (
Expand Down
26 changes: 26 additions & 0 deletions styles/Team.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,32 @@
object-fit: cover;
}

.profile {
height: 228px;
width: 228px;
position: relative;
overflow: hidden;

// this pseudo element allows us to animate the filter up
&::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;

// background-color + mix-blend-mode (color) allows for a colored filter (in our case its black)
background-color: #000;
mix-blend-mode: color;
transition: transform 0.2s ease-in-out;
}

&:hover::after {
transform: translateY(-100%);
}
}

@media only screen and (max-width: 1300px) {
.team-cards {
grid-template-columns: repeat(3, 33.33%);
Expand Down