styled.ts 1.1 KB

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