generated from Technigo/react-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from JohLeo/johanna
Button + location section
- Loading branch information
Showing
5 changed files
with
95 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
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,26 @@ | ||
import React from 'react'; | ||
import { LocationImg } from './lib/LinkCard' | ||
|
||
export const LocationSection = () => { | ||
return ( | ||
<div> | ||
<LocationImg | ||
src="https://i.postimg.cc/cLngP2Xc/apartments.png" | ||
alt="Apartments" | ||
ariaLabel="Find your new apartment" | ||
locationText="Apartments" /> | ||
|
||
<LocationImg | ||
src="https://i.postimg.cc/Bv58nDWL/house.png" | ||
alt="Houses" | ||
ariaLabel="Find your new House" | ||
locationText="Houses" /> | ||
|
||
<LocationImg | ||
src="https://i.postimg.cc/N0v9tDnv/vacationhome.png" | ||
alt="Holiday housing" | ||
ariaLabel="Find your new holiday house" | ||
locationText="Holiday homes" /> | ||
</div> | ||
) | ||
} |
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,23 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
const FadeButton = styled.button` | ||
position: relative; | ||
border: 1px solid black; | ||
background-color: transparent; | ||
padding: 8px 20px; | ||
font-size: 16px; | ||
cursor: pointer; | ||
transition: background-color 0.3s; | ||
&:hover { | ||
background-color: black; | ||
color: white; | ||
} | ||
`; | ||
|
||
const Button = ({ text }) => { | ||
return <FadeButton>{text}</FadeButton>; | ||
}; | ||
|
||
export default Button; |
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,39 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
const OverlayText = styled.div` | ||
position: relative; | ||
display: inline-block; | ||
`; | ||
|
||
const LinkImage = styled.img` | ||
width: 100%; | ||
max-width: 350px; | ||
height: 100%; | ||
margin: 10px; | ||
`; | ||
|
||
const LocationText = styled.div` | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
padding: 10px 5rem; | ||
background-color: rgba(255, 255, 255, 0.8); | ||
color: #414142; | ||
font-size: 14px; | ||
text-transform: uppercase; | ||
white-space: nowrap; | ||
`; | ||
|
||
export const LocationImg = ({ src, alt, ariaLabel, locationText }) => { | ||
return ( | ||
|
||
<OverlayText> | ||
<LinkImage src={src} alt={alt} aria-label={ariaLabel} /> | ||
<LocationText>{locationText}</LocationText> | ||
</OverlayText> | ||
|
||
); | ||
}; | ||
|
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