styled.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. `;