2022-12-15 20:23:11 +00:00
|
|
|
import styled from 'styled-components';
|
|
|
|
|
|
|
|
interface DisplayPropType {
|
2022-12-18 03:57:22 +00:00
|
|
|
focus?: number,
|
2022-12-17 20:35:40 +00:00
|
|
|
show?: number;
|
2022-12-15 20:23:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface ActivePropType {
|
2022-12-17 20:35:40 +00:00
|
|
|
active?: number;
|
2022-12-15 20:23:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const ThemeDropDown = styled.div`
|
2022-12-15 20:36:15 +00:00
|
|
|
margin-left: 1%;
|
2022-12-15 20:23:11 +00:00
|
|
|
min-width: 180px;
|
2022-12-18 22:19:21 +00:00
|
|
|
color: ${({ theme }) => theme.colors.primary};
|
2022-12-15 20:23:11 +00:00
|
|
|
`
|
|
|
|
|
2022-12-17 00:56:41 +00:00
|
|
|
export const ThemeDropDownButton = styled.button<DisplayPropType>`
|
|
|
|
width: 160px;
|
2022-12-18 03:57:22 +00:00
|
|
|
border: 2px solid;
|
2022-12-17 00:56:41 +00:00
|
|
|
border-radius: 5px;
|
2022-12-18 22:19:21 +00:00
|
|
|
background-color: ${ props => props.focus ?
|
2023-03-16 21:19:17 +00:00
|
|
|
({ theme }) => theme.colors.background :
|
2022-12-18 03:57:22 +00:00
|
|
|
({ theme }) => theme.colors.background};
|
|
|
|
padding: 2px 6px;
|
2022-12-15 20:23:11 +00:00
|
|
|
cursor: pointer;
|
2023-03-16 21:19:17 +00:00
|
|
|
color: ${props => props.focus ?
|
|
|
|
({ theme }) => theme.colors.text ? theme.colors.text : theme.colors.secondary :
|
2022-12-18 03:57:22 +00:00
|
|
|
({ theme }) => theme.colors.primary};
|
2022-12-17 00:56:41 +00:00
|
|
|
|
2022-12-18 22:19:21 +00:00
|
|
|
transition-property: color, border-bottom-left-radius, border-bottom-right-radius, background-color;
|
2022-12-17 00:56:41 +00:00
|
|
|
transition-timing-function: ease;
|
|
|
|
transition-duration: 0.15s;
|
2022-12-18 03:57:22 +00:00
|
|
|
transition-delay: 0s, ${ props => props.show ? "0s, 0s" : "0.6s, 0.6s" }, 0s;
|
2022-12-15 20:23:11 +00:00
|
|
|
|
2022-12-15 21:33:40 +00:00
|
|
|
&:focus,:hover {
|
2023-03-16 21:19:17 +00:00
|
|
|
color: ${({ theme }) => theme.colors.text ? theme.colors.text : theme.colors.secondary};
|
2022-12-18 03:57:22 +00:00
|
|
|
|
2023-03-16 21:19:17 +00:00
|
|
|
background-color: ${({ theme }) => theme.colors.background};
|
2022-12-15 20:23:11 +00:00
|
|
|
}
|
2022-12-17 00:56:41 +00:00
|
|
|
|
|
|
|
border-bottom-left-radius: ${ props => props.show ? "0" : "" };
|
|
|
|
border-bottom-right-radius: ${ props => props.show ? "0" : "" };
|
2022-12-15 20:23:11 +00:00
|
|
|
`
|
|
|
|
|
|
|
|
export const ThemeDropDownOptions = styled.div<DisplayPropType>`
|
2022-12-15 20:36:15 +00:00
|
|
|
position: absolute;
|
2022-12-15 20:23:11 +00:00
|
|
|
color: ${({ theme }) => theme.colors.primary};
|
2022-12-18 03:57:22 +00:00
|
|
|
background-image: ${({ theme }) => theme.backgroundImage ?
|
|
|
|
"linear-gradient("
|
|
|
|
+ theme.colors.background + "," + theme.colors.background +
|
|
|
|
"), url(" + theme.backgroundImage + ")" : ""};
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-attachment: fixed;
|
|
|
|
background-size: cover;
|
2022-12-19 21:17:41 +00:00
|
|
|
background-color: ${({ theme }) => theme.colors.background };
|
2022-12-18 03:57:22 +00:00
|
|
|
|
2022-12-17 00:56:41 +00:00
|
|
|
display: flex;
|
2022-12-15 20:23:11 +00:00
|
|
|
flex-direction: column;
|
|
|
|
min-width: 160px;
|
2022-12-17 00:56:41 +00:00
|
|
|
border: 1px solid;
|
|
|
|
border-top: 0;
|
|
|
|
border-radius: 5px;
|
|
|
|
border-top-left-radius: 0px; border-top-right-radius: 0px;
|
2022-12-15 20:23:11 +00:00
|
|
|
z-index: 1;
|
2022-12-22 21:02:52 +00:00
|
|
|
overflow-x: hidden;
|
|
|
|
overflow-y: ${ props => props.show ? "scroll" : "hidden" };
|
|
|
|
scrollbar-width: none;
|
2022-12-17 00:56:41 +00:00
|
|
|
max-height: ${ props => props.show ? "20%" : "0%" };
|
|
|
|
visibility: ${ props => props.show ? "visible" : "hidden" };
|
|
|
|
|
|
|
|
transition-property: max-height, visibility;
|
|
|
|
transition-timing-function: ease-in-out;
|
|
|
|
transition-duration: 0.6s, 0s;
|
|
|
|
transition-delay: 0s, ${ props => props.show ? "0s" : "0.5s" };
|
2022-12-15 20:23:11 +00:00
|
|
|
`
|
|
|
|
|
|
|
|
export const ThemeDropDownOption = styled.button<ActivePropType>`
|
|
|
|
color: ${ props => props.active ? ({ theme }) => theme.colors.secondary : ({ theme }) => theme.colors.primary };
|
2022-12-18 03:57:22 +00:00
|
|
|
background-color: transparent;
|
2022-12-17 20:35:40 +00:00
|
|
|
cursor: pointer;
|
2022-12-17 00:56:41 +00:00
|
|
|
align-self: center;
|
|
|
|
border: 0px solid;
|
2022-12-15 20:23:11 +00:00
|
|
|
padding: 0.2rem 0.5rem;
|
|
|
|
text-decoration: none;
|
2022-12-17 00:56:41 +00:00
|
|
|
width: 90%;
|
2022-12-15 20:23:11 +00:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: ${({ theme }) => theme.colors.secondary};
|
|
|
|
}
|
|
|
|
`
|