Skip to content

Commit

Permalink
Create QuizBackground component
Browse files Browse the repository at this point in the history
  • Loading branch information
TheeDouglasAM3 committed Jan 25, 2021
1 parent 1fc0f9b commit 95b4df6
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions pokemon-quiz-nextjs/src/components/QuizBackground/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// src/components/QuizBackground/index.js
import styled from 'styled-components';

const QuizBackground = styled.div`
width: 100%;
background-size: cover;
background-position: center;
background-image: url(${({ backgroundImage }) => backgroundImage});
background-color: ${({ theme }) => theme.colors.mainBg};
flex: 1;
@media screen and (max-width: 500px) {
background-image: none;
&:after {
content: "";
background-size: cover;
background-position: center;
background-image:
linear-gradient(transparent, ${({ theme }) => theme.colors.mainBg}),
url(${({ backgroundImage }) => backgroundImage});
display: block;
width: 100%;
height: 210px;
position: absolute;
top: 0;
left: 0;
right: 0;
z-index: 1;
}
*:first-child {
position: relative;
z-index: 10;
}
}
`;

export default QuizBackground;

0 comments on commit 95b4df6

Please sign in to comment.