styled.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. }
  48. `;
  49. export const AnnotationLayer = styled.div`
  50. position: absolute;
  51. left: 0;
  52. top: 0;
  53. `;
  54. export const WatermarkLayer = styled.div`
  55. position: absolute;
  56. left: 0;
  57. top: 0;
  58. right: 0;
  59. bottom: 0;
  60. display: flex;
  61. justify-content: center;
  62. align-items: center;
  63. `;