styled.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import styled, { css, keyframes } from 'styled-components';
  2. const closeToolbar = keyframes`
  3. from {
  4. pointer-events: auto;
  5. opacity: 1;
  6. }
  7. to {
  8. pointer-events: none;
  9. opacity: 0;
  10. }
  11. `;
  12. export const Container = styled('div')<{
  13. displayMode: string;
  14. hidden: boolean;
  15. }>`
  16. position: fixed;
  17. top: 86px;
  18. left: ${props => (props.displayMode === 'normal' ? '267px' : 0)};
  19. right: 0;
  20. margin: auto;
  21. max-width: 572px;
  22. width: 100%;
  23. height: 54px;
  24. border-radius: 4px;
  25. box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.38);
  26. background-color: white;
  27. display: flex;
  28. align-items: center;
  29. justify-content: space-between;
  30. padding: 0 8px;
  31. z-index: 2;
  32. transition: all 225ms ease-in-out;
  33. ${props =>
  34. props.hidden
  35. ? css`
  36. animation: ${closeToolbar} 3s forwards;
  37. `
  38. : ''}
  39. `;
  40. export const ToggleButton = styled.div`
  41. position: fixed;
  42. right: 20px;
  43. bottom: 15px;
  44. z-index: 2;
  45. box-shadow: 1px 1px 4px 2px rgba(0, 0, 0, 0.32);
  46. border-radius: 40px;
  47. width: 80px;
  48. height: 80px;
  49. `;