styled.ts 1.5 KB

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