Skip to content

Commit 2fda2c8

Browse files
committed
fix(background image): cuts off at the bottom when scrolling
1 parent 1f09757 commit 2fda2c8

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

src/pages/App.tsx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,6 @@ const BodyWrapper = styled.div`
4949
z-index: 1;
5050
`
5151

52-
const BackgroundGradient = styled.div`
53-
width: 100%;
54-
height: 170vh;
55-
background: ${({ theme }) => `radial-gradient(50% 50% at 50% 50%, ${theme.primary1} 0%, ${theme.bg1} 100%)`};
56-
position: absolute;
57-
top: 0px;
58-
left: 0px;
59-
opacity: 0.1;
60-
z-index: -1;
61-
62-
transform: translateY(-70vh);
63-
64-
@media (max-width: 960px) {
65-
height: 300px;
66-
width: 100%;
67-
transform: translateY(-150px);
68-
}
69-
`
70-
7152
const Marginer = styled.div`
7253
margin-top: 5rem;
7354
`
@@ -109,7 +90,6 @@ export default function App() {
10990
<Marginer />
11091
<Footer />
11192
</BodyWrapper>
112-
<BackgroundGradient />
11393
</AppWrapper>
11494
</Router>
11595
</Suspense>

src/theme/index.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { transparentize } from 'polished'
12
import React, { useMemo } from 'react'
23
import styled, {
34
ThemeProvider as StyledComponentsThemeProvider,
@@ -197,4 +198,15 @@ html {
197198
color: ${({ theme }) => theme.text1};
198199
background-color: ${({ theme }) => theme.bg2};
199200
}
201+
202+
body {
203+
min-height: 100vh;
204+
background-position: 0 -30vh;
205+
background-repeat: no-repeat;
206+
background-image: ${({ theme }) =>
207+
`radial-gradient(50% 50% at 50% 50%, ${transparentize(0.9, theme.primary1)} 0%, ${transparentize(
208+
1,
209+
theme.bg1
210+
)} 100%)`};
211+
}
200212
`

0 commit comments

Comments
 (0)