Skip to content

Commit

Permalink
fix(background image): cuts off at the bottom when scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
moodysalem committed Jun 12, 2020
1 parent 1f09757 commit 2fda2c8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/pages/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,6 @@ const BodyWrapper = styled.div`
z-index: 1;
`

const BackgroundGradient = styled.div`
width: 100%;
height: 170vh;
background: ${({ theme }) => `radial-gradient(50% 50% at 50% 50%, ${theme.primary1} 0%, ${theme.bg1} 100%)`};
position: absolute;
top: 0px;
left: 0px;
opacity: 0.1;
z-index: -1;
transform: translateY(-70vh);
@media (max-width: 960px) {
height: 300px;
width: 100%;
transform: translateY(-150px);
}
`

const Marginer = styled.div`
margin-top: 5rem;
`
Expand Down Expand Up @@ -109,7 +90,6 @@ export default function App() {
<Marginer />
<Footer />
</BodyWrapper>
<BackgroundGradient />
</AppWrapper>
</Router>
</Suspense>
Expand Down
12 changes: 12 additions & 0 deletions src/theme/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { transparentize } from 'polished'
import React, { useMemo } from 'react'
import styled, {
ThemeProvider as StyledComponentsThemeProvider,
Expand Down Expand Up @@ -197,4 +198,15 @@ html {
color: ${({ theme }) => theme.text1};
background-color: ${({ theme }) => theme.bg2};
}
body {
min-height: 100vh;
background-position: 0 -30vh;
background-repeat: no-repeat;
background-image: ${({ theme }) =>
`radial-gradient(50% 50% at 50% 50%, ${transparentize(0.9, theme.primary1)} 0%, ${transparentize(
1,
theme.bg1
)} 100%)`};
}
`

1 comment on commit 2fda2c8

@vercel
Copy link

@vercel vercel bot commented on 2fda2c8 Jun 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.