styled.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import styled from 'styled-components';
  2. export const PageWrapper = styled('div')<{
  3. width: number;
  4. height: number;
  5. rotation?: number;
  6. }>`
  7. direction: ltr;
  8. position: relative;
  9. overflow: visible;
  10. background-clip: content-box;
  11. display: inline-block;
  12. margin: 25px auto;
  13. width: ${props => props.width}px;
  14. height: ${props => props.height}px;
  15. transform: rotate(${props => props.rotation}deg);
  16. background-color: white;
  17. &:first-of-type {
  18. margin-top: 40px;
  19. }
  20. `;
  21. export const PdfCanvas = styled.canvas`
  22. margin: 0;
  23. display: block;
  24. width: 100%;
  25. height: 100%;
  26. `;
  27. export const TextLayer = styled.div`
  28. position: absolute;
  29. left: 0;
  30. top: 0;
  31. right: 0;
  32. bottom: 0;
  33. margin: auto;
  34. overflow: hidden;
  35. line-height: 1;
  36. & > span {
  37. color: transparent;
  38. position: absolute;
  39. white-space: pre;
  40. cursor: text;
  41. transform-origin: 0% 0%;
  42. ::selection {
  43. color: transparent;
  44. background: #d6eaff;
  45. }
  46. }
  47. `;
  48. export const AnnotationLayer = styled.div`
  49. position: absolute;
  50. left: 0;
  51. top: 0;
  52. `;
  53. export const WatermarkLayer = styled.div`
  54. position: absolute;
  55. left: 0;
  56. top: 0;
  57. right: 0;
  58. bottom: 0;
  59. display: flex;
  60. justify-content: center;
  61. align-items: center;
  62. `;