styled.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import styled, { css } from 'styled-components';
  2. import { color } from '../../constants/style';
  3. export const Container = styled.div`
  4. padding: 10px;
  5. `;
  6. export const Wrapper = styled.div`
  7. height: 10px;
  8. width: 100%;
  9. border-radius: 7px;
  10. background-color: ${color.black23};
  11. position: relative;
  12. cursor: pointer;
  13. `;
  14. export const Rail = styled("div")<{track: number}>`
  15. height: 10px;
  16. width: ${props => props.track}%;
  17. border-radius: 7px;
  18. background-color: ${color.primary};
  19. `;
  20. export const Track = styled("span")<{track: number; isActive: boolean}>`
  21. display: block;
  22. width: 20px;
  23. height: 20px;
  24. border-radius: 10px;
  25. background-color: ${color['french-blue']};
  26. cursor: pointer;
  27. top: -5px;
  28. position: absolute;
  29. transition: box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
  30. left: calc(${props => props.track}% - 10px);
  31. border: 2px solid white;
  32. box-sizing: border-box;
  33. ${props => props.isActive ? css`
  34. box-shadow: 0px 0px 0px 8px rgba(144, 202, 249, 0.23);
  35. ` : ''}
  36. &:hover {
  37. box-shadow: 0px 0px 0px 8px rgba(144, 202, 249, 0.23);
  38. }
  39. `;