Skip to content

Instantly share code, notes, and snippets.

@apple-juice
Last active July 8, 2020 08:15
Show Gist options
  • Save apple-juice/241c7d1f1a134e4ce29b0c6f71a1a88d to your computer and use it in GitHub Desktop.
Save apple-juice/241c7d1f1a134e4ce29b0c6f71a1a88d to your computer and use it in GitHub Desktop.
import styled from "styled-components"
const Image = styled.div`
width: 64px;
height: 64px;
margin: 0 auto 20px;
border-radius: 50px;
background: #fafbfc no-repeat center / contain;
`
const Title = styled.div`
color: #00030e;
font-weight: 500;
`
const Subtitle = styled.div`
margin-top: 5px;
`
const Content = styled.div`
font-size: 16px;
line-height: 1;
transition: transform 0.3s ease;
`
const Inner = styled.div`
position: relative;
margin: auto;
text-align: center;
z-index: 2;
`
const Wrapper = styled.div`
position: relative;
display: flex;
height: 192px;
padding: 20px;
cursor: pointer;
&:before {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
content: "";
background-color: #ffffff;
box-shadow: 0 2px 4px 0 rgba(125, 132, 153, 0.04),
0 4px 18px 0 rgba(125, 132, 153, 0.2);
transition: transform 0.3s ease;
}
&:hover {
&:before {
transform: scale(1.1);
}
${Image} {
transform: scale(1.2);
}
${Content} {
transform: translate3d(0, 10px, 0);
}
}
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment