-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Homepage]
<IoHomeCaseStudies />
(#13190)
* adds <IoHomeCaseStudies /> * adds interface * animate gradient
- Loading branch information
1 parent
3ca0a44
commit 489562e
Showing
6 changed files
with
269 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import Image from 'next/image' | ||
import { IconArrowRight16 } from '@hashicorp/flight-icons/svg-react/arrow-right-16' | ||
import s from './style.module.css' | ||
|
||
interface IoHomeCaseStudiesProps { | ||
primary: Array<{ | ||
thumbnail: string | ||
alt: string | ||
link: string | ||
heading: string | ||
}> | ||
secondary: Array<{ | ||
link: string | ||
heading: string | ||
}> | ||
} | ||
|
||
export default function IoHomeCaseStudies({ | ||
primary, | ||
secondary, | ||
}: IoHomeCaseStudiesProps) { | ||
return ( | ||
<div className={s.caseStudies}> | ||
<ul className={s.primary}> | ||
{primary.map((item) => { | ||
return ( | ||
<li className={s.primaryItem}> | ||
<a className={s.card} href={item.link}> | ||
<h3 className={s.cardHeading}>{item.heading}</h3> | ||
<Image | ||
src={item.thumbnail} | ||
layout="fill" | ||
objectFit="cover" | ||
alt={item.alt} | ||
/> | ||
</a> | ||
</li> | ||
) | ||
})} | ||
</ul> | ||
|
||
<ul className={s.secondary}> | ||
{secondary.map((item) => { | ||
return ( | ||
<li className={s.secondaryItem}> | ||
<a className={s.link} href={item.link}> | ||
<span className={s.linkInner}> | ||
<h3 className={s.linkHeading}>{item.heading}</h3> | ||
<IconArrowRight16 /> | ||
</span> | ||
</a> | ||
</li> | ||
) | ||
})} | ||
</ul> | ||
</div> | ||
) | ||
} |
127 changes: 127 additions & 0 deletions
127
website/components/io-home-case-studies/style.module.css
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,127 @@ | ||
.caseStudies { | ||
--columns: 1; | ||
|
||
display: grid; | ||
grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); | ||
gap: 32px; | ||
|
||
@media (--medium-up) { | ||
--columns: 12; | ||
} | ||
} | ||
|
||
.primary { | ||
--columns: 1; | ||
|
||
grid-column: 1 / -1; | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
display: grid; | ||
grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); | ||
gap: 32px; | ||
|
||
@media (--medium-up) { | ||
--columns: 2; | ||
} | ||
|
||
@media (--large) { | ||
grid-column: 1 / 9; | ||
} | ||
} | ||
|
||
.primaryItem { | ||
display: flex; | ||
} | ||
|
||
.card { | ||
position: relative; | ||
overflow: hidden; | ||
display: flex; | ||
flex-direction: column; | ||
flex-grow: 1; | ||
justify-content: flex-end; | ||
padding: 32px; | ||
box-shadow: 0 8px 16px -10px rgba(101, 106, 118, 0.2); | ||
background-color: #000; | ||
border-radius: 6px; | ||
color: var(--white); | ||
transition: ease-in-out 0.2s; | ||
transition-property: box-shadow; | ||
min-height: 330px; | ||
|
||
&::before { | ||
content: ''; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
z-index: 10; | ||
background-image: linear-gradient( | ||
to bottom, | ||
rgba(0, 0, 0, 0), | ||
rgba(0, 0, 0, 0.45) | ||
); | ||
transition: opacity ease-in-out 0.2s; | ||
} | ||
|
||
&:hover { | ||
box-shadow: 0 2px 3px rgba(101, 106, 118, 0.15), | ||
0 16px 16px -10px rgba(101, 106, 118, 0.2); | ||
|
||
&::before { | ||
opacity: 0.75; | ||
} | ||
} | ||
} | ||
|
||
.cardHeading { | ||
margin: 0; | ||
composes: g-type-display-4 from global; | ||
z-index: 10; | ||
} | ||
|
||
.secondary { | ||
grid-column: 1 / -1; | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
|
||
@media (--large) { | ||
margin-top: -32px; | ||
grid-column: 9 / -1; | ||
} | ||
} | ||
|
||
.secondaryItem { | ||
border-bottom: 1px solid var(--gray-5); | ||
} | ||
|
||
.link { | ||
display: flex; | ||
width: 100%; | ||
color: var(--black); | ||
} | ||
|
||
.linkInner { | ||
display: flex; | ||
width: 100%; | ||
justify-content: space-between; | ||
padding-top: 32px; | ||
padding-bottom: 32px; | ||
transition: transform ease-in-out 0.2s; | ||
|
||
@nest .link:hover & { | ||
transform: translateX(4px); | ||
} | ||
|
||
& svg { | ||
flex-shrink: 0; | ||
} | ||
} | ||
|
||
.linkHeading { | ||
margin: 0 32px 0 0; | ||
composes: g-type-display-6 from global; | ||
} |
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