house card overlay add
This commit is contained in:
parent
bd8c1d25a8
commit
521219bbbb
|
@ -3,6 +3,11 @@ import styled from 'styled-components';
|
||||||
|
|
||||||
const Image = styled.img`
|
const Image = styled.img`
|
||||||
display:block;
|
display:block;
|
||||||
|
width: inherit;
|
||||||
|
height: inherit;
|
||||||
|
border-radius: 40px;
|
||||||
|
box-shadow: none;
|
||||||
|
object-fit:cover;
|
||||||
`;
|
`;
|
||||||
const Tick = styled.input.attrs(props => ({
|
const Tick = styled.input.attrs(props => ({
|
||||||
type: "radio",
|
type: "radio",
|
||||||
|
@ -11,67 +16,68 @@ const Tick = styled.input.attrs(props => ({
|
||||||
}))`
|
}))`
|
||||||
|
|
||||||
`;
|
`;
|
||||||
const Overlay = styled.div`
|
const Hover = styled.div`
|
||||||
position: block;
|
height: inherit;
|
||||||
bottom: 0;
|
width: inherit;
|
||||||
background: rgb(0, 0, 0);
|
|
||||||
background: rgba(0, 0, 0, 0.5);
|
|
||||||
color: #f1f1f1;
|
|
||||||
width: 100%;
|
|
||||||
transition: .5s ease;
|
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
color: white;
|
transition: opacity 350ms ease;
|
||||||
font-size: 20px;
|
position: absolute;
|
||||||
padding: 20px;
|
`;
|
||||||
text-align: center;
|
const Overlay = styled.div`
|
||||||
margin-top: -90px;
|
height: inherit;
|
||||||
|
width: inherit;
|
||||||
|
transition: black 350ms ease;
|
||||||
|
background-color: transparent;
|
||||||
|
border-radius: 40px;
|
||||||
|
position: absolute;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
|
||||||
|
`;
|
||||||
|
const CardTitle = styled.h2`
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-left: 10px;
|
||||||
|
font-family: sans-serif;
|
||||||
|
box-shadow: none;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const Paragraph = styled.p`
|
||||||
|
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-left: 10px;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
|
||||||
|
`;
|
||||||
|
|
||||||
const Card = styled.div`
|
const Card = styled.div`
|
||||||
width: 300px;
|
width: 200px;
|
||||||
height: 300px;
|
height: 200px;
|
||||||
border-radius: 40px;
|
border-radius: 40px;
|
||||||
box-shadow: 4px 4px 5px 5px rgba(0,0,0,0.01), -2px -2px 5px 5px rgba(0,0,0,0.22);
|
box-shadow: 4px 4px 5px 5px rgba(0,0,0,0.01), -2px -2px 5px 5px rgba(0,0,0,0.22);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: 0.4s;
|
transition: 0.4s;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
background-image: url("skyscraper.png");
|
||||||
& .card_image ${Image} {
|
|
||||||
width: inherit;
|
|
||||||
height:inherit;
|
|
||||||
border-radius: 40px;
|
|
||||||
box-shadow: none;
|
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
&:hover ${Overlay} {
|
||||||
|
background-color: rgba(0,0,0,0.5);
|
||||||
}
|
}
|
||||||
|
&:hover ${CardTitle}, :hover ${Paragraph}{
|
||||||
& .card_title {
|
transform: translate3d(0,0,0);
|
||||||
text-align: center;
|
|
||||||
border-radius: 0px 0px 40px 40px;
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 30px;
|
|
||||||
margin-top: -80px;
|
|
||||||
height: 40px;
|
|
||||||
box-shadow: none;
|
|
||||||
color: #fff;
|
|
||||||
}
|
}
|
||||||
|
&:hover ${Hover}{
|
||||||
|
|
||||||
& .card_tick {
|
|
||||||
content:'asdf';
|
|
||||||
border-radius: 0px 0px 40px 40px;
|
|
||||||
margin-top: -90px;
|
|
||||||
height: 40px;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
&:hover {
|
|
||||||
|
|
||||||
box-shadow: 2px 2px 5px 5px rgba(0,0,0,0.22), -2px -2px 5px 5px rgba(0,0,0,0.11);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
&:hover .overlay{
|
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -85,10 +91,12 @@ const HouseCard = (props) => {
|
||||||
|
|
||||||
|
|
||||||
<Card>
|
<Card>
|
||||||
<Card className="card_image"> <Image src={props.img} alt="asdf" /></Card>
|
<Overlay>
|
||||||
<Card className="card_title">
|
<Hover>
|
||||||
<p>Card Title</p>
|
<CardTitle>asdf</CardTitle>
|
||||||
</Card>
|
<Paragraph>zxcv</Paragraph>
|
||||||
|
</Hover>
|
||||||
|
</Overlay>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,13 +5,13 @@ import Footer from "./Footer";
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
const CardList = styled.div`
|
const CardList = styled.div`
|
||||||
display:flex;
|
display: grid;
|
||||||
justify-content: space-around;
|
|
||||||
align-items: stretch;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: auto;
|
margin: 15px;
|
||||||
flex-direction: row;
|
grid-template-rows: repeat(auto-fill,minmax(200px,1fr));
|
||||||
flex-wrap: wrap;
|
grid-template-columns: repeat(auto-fill,minmax(200px,1fr));
|
||||||
|
grid-gap: 30px;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,6 +95,11 @@ export default function Options() {
|
||||||
<Card img="skyscraper.png"/>
|
<Card img="skyscraper.png"/>
|
||||||
<Card img="skyscraper.png"/>
|
<Card img="skyscraper.png"/>
|
||||||
<Card img="skyscraper.png"/>
|
<Card img="skyscraper.png"/>
|
||||||
|
<Card img="skyscraper.png"/>
|
||||||
|
<Card img="skyscraper.png"/>
|
||||||
|
<Card img="skyscraper.png"/>
|
||||||
|
<Card img="skyscraper.png"/>
|
||||||
|
<Card img="skyscraper.png"/>
|
||||||
</CardList>
|
</CardList>
|
||||||
<Footer />
|
<Footer />
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue