Skip to content

Commit c3c2391

Browse files
committed
feat(card): fix card design
1 parent 3196516 commit c3c2391

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

pages/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ const IndexPage: NextPage = (props: Props) => {
3131

3232
<style jsx>
3333
{`
34-
.cards-deck { display: grid; grid-column-gap: 1rem; grid-template-columns: 1fr 1fr 1fr 1fr; grid-template-rows: auto;}`
34+
.cards-deck { display: grid; grid-column-gap: 1rem; grid-template-columns: 1fr 1fr 1fr 1fr; grid-template-rows: auto; rid-row-gap: 1rem;}
35+
`
3536
}
3637
</style>
3738
</Layout>

shared/components/card/index.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,29 @@ const Card: FunctionComponent<Props> = ({info}) => {
77
return (
88
<Fragment>
99
<div className="card">
10-
<div className="card-header">
11-
12-
</div>
13-
10+
<div className="card-header"/>
1411
<div className="card-body">
1512
<h3>{info.title}</h3>
1613
<p>{info.description}</p>
1714
</div>
1815

1916
<div className="card-actions">
17+
<button className="card-actions__button">Explore</button>
2018
</div>
2119
</div>
2220
<style jsx>{`
2321
.card { height: 400px; width: 340px; background: #FFFFFF; box-shadow: 0 20px 20px 0 rgba(0,0,0,0.07); border-radius: 4px; overflow: hidden; };
22+
.card:hover { box-shadow:0 40px 40px 0 rgba(0,0,0,0.2); cursor: pointer; }
2423
.card-header {
2524
height: 40%;
2625
background-image: url(${info.heroImage});
27-
background: linear-gradient(248deg, rgba(27,21,140,0.56) 0%, rgba(50,176,201,0.56) 100%), url(${info.heroImage}) no-repeat;
26+
background: linear-gradient(45deg, rgba(18, 40, 76, 0.56), rgba(39, 173, 213, 0.56), rgba(79, 192, 176, 0.56)), url(${info.heroImage}) no-repeat;
2827
background-size: 100%;
2928
};
3029
.card-body {padding: 1rem;};
30+
.card-actions {display: flex; justify-content: center;};
31+
.card-actions__button {background-image: linear-gradient(90deg, #0CB2E2 0%, #4FC0B0 100%); border-radius: 2px; color: #ffffff; padding: 1rem 4rem; border: none;};
32+
.card-actions__button:hover {cursor: pointer};
3133
`}
3234
</style>
3335
</Fragment>

0 commit comments

Comments
 (0)