main-site/components/styles/navbar.tsx

148 lines
3.7 KiB
TypeScript
Raw Normal View History

2022-12-15 20:23:11 +00:00
import styled from 'styled-components'
import Link from 'next/link';
interface ActivePropType {
active?: number;
2022-12-15 20:23:11 +00:00
}
export const NavWrap = styled.div`
display: flex;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
border-bottom: 1px solid ${({ theme }) => theme.colors.primary};
`
2022-12-18 22:21:38 +00:00
export const NavWrapMobile = styled(NavWrap)`
width: 100%;
flex-direction: row;
position: fixed;
z-index: 100;
`
export const NavWrapMobileGhost = styled.div`
position: relative;
width: 100%;
height: 57px;
`
export const NavSideMenu = styled.div <ActivePropType>`
position: fixed;
top: 0%; left: 0%; right: 0%; bottom: 0%;
max-width: ${ props => props.active ? "60%" : "0%"};
display: flex;
justify-content: space-between;
flex-direction: column;
align-items: center;
height: 100%;
z-index: 100;
background-color: ${({ theme }) => theme.colors.background};
visibility: ${ props => props.active ? "visible" : "hidden"};
width: ${ props => props.active ? "360px" : "0%"};
transition-delay: ${ props => props.active ? "0s, 0s" : "0s, 0.3s"};
`
export const NavSideMenuPanel = styled.div <ActivePropType>`
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
`
export const NavSideMenuButton = styled.button <ActivePropType>`
z-index: 100;
margin: 16px;
color: ${ props => props.active ? ({ theme }) => theme.colors.background : ({ theme }) => theme.colors.primary };
background-color: ${ props => props.active ? ({ theme }) => theme.colors.secondary : ({ theme }) => theme.colors.background };
`
export const NavSideMenuButtonPlaceholder = styled.div`
width: 48px;
margin: 16px;
`
export const NavSideMenuGhost = styled.div`
`
2022-12-15 20:23:11 +00:00
export const NavBar = styled.nav`
margin-right: 1%;
2022-12-15 20:23:11 +00:00
display: flex;
flex: 1;
2022-12-17 01:17:54 +00:00
padding: 1rem 0;
2022-12-15 20:23:11 +00:00
flex-wrap: nowrap;
justify-content: center;
align-items: center;
`
2022-12-18 22:21:38 +00:00
export const NavBarMobile = styled(NavBar)`
flex-direction: column;
`
export const NavLink = styled(Link) <ActivePropType>`
color: ${props => props.active ?
({ theme }) => theme.invertButtons ?
theme.colors.text ? theme.colors.text : theme.colors.secondary : theme.colors.secondary :
({ theme }) => theme.colors.primary};
background-color: ${props => props.active ?
({ theme }) => theme.invertButtons ?
theme.colors.secondary : theme.colors.background :
({ theme }) => theme.colors.background};
padding: 2px 6px;
border: 2px solid;
2022-12-15 20:23:11 +00:00
margin: 0.2rem;
2022-12-17 00:56:41 +00:00
border-radius: 5px;
2022-12-15 20:23:11 +00:00
display: flex;
justify-content: center;
align-items: center;
transition: all 0.1s ease;
2022-12-15 20:23:11 +00:00
2022-12-18 22:21:38 +00:00
&:hover {
color: ${({ theme }) => theme.invertButtons ?
theme.colors.text ? theme.colors.text : theme.colors.primary :
theme.colors.secondary};
background-color: ${({ theme }) => theme.invertButtons ?
theme.colors.secondary :
theme.colors.background};
}
`
export const NavIndicators = styled.nav`
width: 100%;
display: flex;
flex: 1;
padding: 1rem 0;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
`
export const NavIndicator = styled(Link) <ActivePropType>`
margin: 0.2rem;
border-radius: 50%;
aspect-ratio: 1;
width: 10px;
border: 1px solid ${({ theme }) => theme.colors.primary};
background-color: ${props => props.active ?
({ theme }) => theme.invertButtons ?
theme.colors.secondary : theme.colors.background :
({ theme }) => theme.colors.background};
2022-12-15 20:23:11 +00:00
&:hover {
color: ${({ theme }) => theme.invertButtons ?
theme.colors.text ? theme.colors.text : theme.colors.primary :
theme.colors.secondary};
2022-12-15 20:23:11 +00:00
background-color: ${({ theme }) => theme.invertButtons ?
theme.colors.secondary :
theme.colors.background};
}
2022-12-15 20:23:11 +00:00
`