Commit 1aba4fbc authored by Mike Grabowski's avatar Mike Grabowski Committed by GitHub

feat: add glow to landing page (#5636)

* chore: adjust z-index on the linear gradient

* feat: add blur

* fix: heights and paddings

* chore: abstract values into sep variable

* chore: remove bg

* chore: tweaks
parent 714d215c
...@@ -24,7 +24,7 @@ const MobileBottomBar = styled.div` ...@@ -24,7 +24,7 @@ const MobileBottomBar = styled.div`
left: 0; left: 0;
justify-content: space-between; justify-content: space-between;
padding: 4px 8px; padding: 4px 8px;
height: 56px; height: ${({ theme }) => theme.mobileBottomBarHeight}px;
background: ${({ theme }) => theme.backgroundSurface}; background: ${({ theme }) => theme.backgroundSurface};
border-top: 1px solid ${({ theme }) => theme.backgroundOutline}; border-top: 1px solid ${({ theme }) => theme.backgroundOutline};
...@@ -33,6 +33,13 @@ const MobileBottomBar = styled.div` ...@@ -33,6 +33,13 @@ const MobileBottomBar = styled.div`
} }
` `
const Nav = styled.nav`
padding: 20px 12px;
width: 100%;
height: ${({ theme }) => theme.navHeight}px;
z-index: 2;
`
interface MenuItemProps { interface MenuItemProps {
href: string href: string
id?: NavLinkProps['id'] id?: NavLinkProps['id']
...@@ -91,7 +98,7 @@ const Navbar = () => { ...@@ -91,7 +98,7 @@ const Navbar = () => {
return ( return (
<> <>
<nav className={styles.nav}> <Nav>
<Box display="flex" height="full" flexWrap="nowrap" alignItems="stretch"> <Box display="flex" height="full" flexWrap="nowrap" alignItems="stretch">
<Box className={styles.leftSideContainer}> <Box className={styles.leftSideContainer}>
<Box className={styles.logoContainer}> <Box className={styles.logoContainer}>
...@@ -135,7 +142,7 @@ const Navbar = () => { ...@@ -135,7 +142,7 @@ const Navbar = () => {
</Row> </Row>
</Box> </Box>
</Box> </Box>
</nav> </Nav>
<MobileBottomBar> <MobileBottomBar>
<PageTabs /> <PageTabs />
<Box marginY="4"> <Box marginY="4">
......
...@@ -3,20 +3,6 @@ import { style } from '@vanilla-extract/css' ...@@ -3,20 +3,6 @@ import { style } from '@vanilla-extract/css'
import { subhead } from '../../nft/css/common.css' import { subhead } from '../../nft/css/common.css'
import { sprinkles, vars } from '../../nft/css/sprinkles.css' import { sprinkles, vars } from '../../nft/css/sprinkles.css'
export const nav = style([
sprinkles({
paddingX: '20',
paddingY: '12',
width: 'full',
height: '72',
zIndex: '2',
background: 'backgroundFloating',
}),
{
backdropFilter: 'blur(24px)',
},
])
export const logoContainer = style([ export const logoContainer = style([
sprinkles({ sprinkles({
display: 'flex', display: 'flex',
......
...@@ -11,30 +11,58 @@ import styled from 'styled-components/macro' ...@@ -11,30 +11,58 @@ import styled from 'styled-components/macro'
import { BREAKPOINTS } from 'theme' import { BREAKPOINTS } from 'theme'
import { Z_INDEX } from 'theme/zIndex' import { Z_INDEX } from 'theme/zIndex'
const PageWrapper = styled.div<{ isDarkMode: boolean }>` const PageWrapper = styled.div`
height: 100%;
width: 100%; width: 100%;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
height: ${({ theme }) => `calc(100vh - ${theme.navHeight + theme.mobileBottomBarHeight}px)`};
@media screen and (min-width: ${({ theme }) => theme.breakpoint.md}px) {
height: ${({ theme }) => `calc(100vh - ${theme.navHeight}px)`};
}
`
const Gradient = styled.div<{ isDarkMode: boolean }>`
position: absolute; position: absolute;
top: 0;
bottom: 0; bottom: 0;
width: 100%;
background: ${({ isDarkMode }) => background: ${({ isDarkMode }) =>
isDarkMode isDarkMode
? 'linear-gradient(rgba(8, 10, 24, 0) 9.84%, rgb(8 10 24 / 86%) 35.35%)' ? 'linear-gradient(rgba(8, 10, 24, 0) 9.84%, rgb(8 10 24 / 86%) 35.35%)'
: 'linear-gradient(rgba(8, 10, 24, 0) 9.84%, rgb(255 255 255 / 86%) 35.35%)'}; : 'linear-gradient(rgba(8, 10, 24, 0) 9.84%, rgb(255 255 255 / 86%) 35.35%)'};
z-index: ${Z_INDEX.sticky}; z-index: ${Z_INDEX.dropdown};
display: flex;
flex-direction: column;
justify-content: end;
align-items: center;
padding: 32px;
transition: 250ms ease opacity;
pointer-events: none; pointer-events: none;
`
const Glow = styled.div`
position: absolute;
top: 68px;
bottom: 0;
background: radial-gradient(72.04% 72.04% at 50% 3.99%, #ff37eb 0%, rgba(166, 151, 255, 0) 100%);
filter: blur(72px);
border-radius: 24px;
max-width: 480px;
width: 100%;
`
const ContentWrapper = styled.div<{ isDarkMode: boolean }>`
width: 100%;
max-width: min(720px, 90%);
position: absolute;
bottom: 0;
z-index: ${Z_INDEX.dropdown};
padding: 32px 0;
transition: ${({ theme }) => `${theme.transition.duration.medium} ${theme.transition.timing.ease} opacity`};
* { * {
pointer-events: auto; pointer-events: auto;
} }
@media screen and (min-width: ${BREAKPOINTS.sm}px) { @media screen and (min-width: ${BREAKPOINTS.sm}px) {
padding: 64px; padding: 64px 0;
} }
` `
...@@ -124,10 +152,6 @@ const ButtonCTAText = styled.p` ...@@ -124,10 +152,6 @@ const ButtonCTAText = styled.p`
} }
` `
const TitleWrapper = styled.span`
max-width: 720px;
`
const ActionsWrapper = styled.span` const ActionsWrapper = styled.span`
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -168,23 +192,25 @@ export default function Landing() { ...@@ -168,23 +192,25 @@ export default function Landing() {
return ( return (
<Trace page={PageName.LANDING_PAGE} shouldLogImpression> <Trace page={PageName.LANDING_PAGE} shouldLogImpression>
<PageWrapper isDarkMode={isDarkMode}> <PageWrapper>
<TitleWrapper> <Swap />
<Glow />
<Gradient isDarkMode={isDarkMode} />
<ContentWrapper isDarkMode={isDarkMode}>
<TitleText isDarkMode={isDarkMode}>Trade crypto & NFTs with confidence.</TitleText> <TitleText isDarkMode={isDarkMode}>Trade crypto & NFTs with confidence.</TitleText>
<SubTextContainer> <SubTextContainer>
<SubText>Buy, sell, and explore tokens and NFTs </SubText> <SubText>Buy, sell, and explore tokens and NFTs </SubText>
</SubTextContainer> </SubTextContainer>
</TitleWrapper> <ActionsWrapper>
<ActionsWrapper> <ButtonCTA as={Link} to="/swap">
<ButtonCTA as={Link} to="/swap"> <ButtonCTAText>Continue</ButtonCTAText>
<ButtonCTAText>Continue</ButtonCTAText> </ButtonCTA>
</ButtonCTA> <ButtonCTASecondary as={Link} to="/about">
<ButtonCTASecondary as={Link} to="/about"> <ButtonCTAText>Learn more</ButtonCTAText>
<ButtonCTAText>Learn more</ButtonCTAText> </ButtonCTASecondary>
</ButtonCTASecondary> </ActionsWrapper>
</ActionsWrapper> </ContentWrapper>
</PageWrapper> </PageWrapper>
<Swap />
</Trace> </Trace>
) )
} }
...@@ -80,6 +80,9 @@ function getSettings(darkMode: boolean) { ...@@ -80,6 +80,9 @@ function getSettings(darkMode: boolean) {
// media queries // media queries
deprecated_mediaWidth: deprecated_mediaWidthTemplates, deprecated_mediaWidth: deprecated_mediaWidthTemplates,
navHeight: 72,
mobileBottomBarHeight: 52,
// deprecated - please use hardcoded exported values instead of // deprecated - please use hardcoded exported values instead of
// adding to the theme object // adding to the theme object
breakpoint: BREAKPOINTS, breakpoint: BREAKPOINTS,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment