styled.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. pointer-events: none;
  27. `;
  28. export const TextLayer = styled.div<{ disabledSelect: boolean }>`
  29. position: absolute;
  30. left: 0;
  31. top: 0;
  32. right: 0;
  33. bottom: 0;
  34. margin: auto;
  35. overflow: hidden;
  36. opacity: 0.3;
  37. line-height: 1;
  38. pointer-events: ${(props) => (props.disabledSelect ? 'none' : 'auto')};
  39. & > span {
  40. color: transparent;
  41. position: absolute;
  42. white-space: pre;
  43. cursor: text;
  44. transform-origin: 0% 0%;
  45. ::selection {
  46. color: transparent;
  47. background: rgba(0, 0, 255, 1);
  48. }
  49. ::after {
  50. content: ' ';
  51. }
  52. }
  53. `;
  54. export const AnnotationLayer = styled.div`
  55. position: absolute;
  56. left: 0;
  57. top: 0;
  58. `;
  59. export const WatermarkLayer = styled.div`
  60. position: absolute;
  61. left: 0;
  62. top: 0;
  63. right: 0;
  64. bottom: 0;
  65. display: flex;
  66. justify-content: center;
  67. align-items: center;
  68. pointer-events: none;
  69. `;
  70. export const Inner = styled.div`
  71. display: flex;
  72. justify-content: center;
  73. align-items: center;
  74. height: 100%;
  75. font-size: 1.5rem;
  76. `;
  77. export const Canvas = styled.svg`
  78. display: block;
  79. position: absolute;
  80. top: 0;
  81. left: 0;
  82. `;