styled.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import styled, { css } from 'styled-components';
  2. import { color } from '../../constants/style';
  3. export const OuterWrapper = 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. left: calc(${props => props.track}% - 10px);
  29. position: absolute;
  30. transition: box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
  31. border: 2px solid white;
  32. box-sizing: border-box;
  33. ${props =>
  34. props.isActive
  35. ? css`
  36. box-shadow: 0px 0px 0px 8px rgba(144, 202, 249, 0.23);
  37. `
  38. : ''}
  39. &:hover {
  40. box-shadow: 0px 0px 0px 8px rgba(144, 202, 249, 0.23);
  41. }
  42. `;