index-pure.less 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. @import '../../style/themes/index';
  2. @import '../../style/mixins/index';
  3. @image-prefix-cls: ~'@{ant-prefix}-image';
  4. @image-preview-prefix-cls: ~'@{image-prefix-cls}-preview';
  5. .@{image-prefix-cls} {
  6. position: relative;
  7. display: inline-block;
  8. &-img {
  9. width: 100%;
  10. height: auto;
  11. vertical-align: middle;
  12. &-placeholder {
  13. background-color: @image-bg;
  14. background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=');
  15. background-repeat: no-repeat;
  16. background-position: center center;
  17. background-size: 30%;
  18. }
  19. }
  20. &-mask {
  21. position: absolute;
  22. top: 0;
  23. right: 0;
  24. bottom: 0;
  25. left: 0;
  26. display: flex;
  27. align-items: center;
  28. justify-content: center;
  29. color: @text-color-inverse;
  30. background: fade(@black, 50%);
  31. cursor: pointer;
  32. opacity: 0;
  33. transition: opacity @animation-duration-slow;
  34. &-info {
  35. padding: 0 @padding-xss;
  36. overflow: hidden;
  37. white-space: nowrap;
  38. text-overflow: ellipsis;
  39. .@{iconfont-css-prefix} {
  40. margin-inline-end: @margin-xss;
  41. }
  42. }
  43. &:hover {
  44. opacity: 1;
  45. }
  46. }
  47. &-placeholder {
  48. .box();
  49. }
  50. &-preview {
  51. .modal-mask();
  52. height: 100%;
  53. text-align: center;
  54. &-body {
  55. .box();
  56. overflow: hidden;
  57. }
  58. &-img {
  59. max-width: 100%;
  60. max-height: 100%;
  61. vertical-align: middle;
  62. transform: scale3d(1, 1, 1);
  63. cursor: grab;
  64. transition: transform 0.3s @ease-out 0s;
  65. user-select: none;
  66. pointer-events: auto;
  67. &-wrapper {
  68. .box();
  69. transition: transform 0.3s @ease-out 0s;
  70. &::before {
  71. display: inline-block;
  72. width: 1px;
  73. height: 50%;
  74. margin-right: -1px;
  75. content: '';
  76. }
  77. }
  78. }
  79. &-moving {
  80. .@{image-prefix-cls}-preview-img {
  81. cursor: grabbing;
  82. &-wrapper {
  83. transition-duration: 0s;
  84. }
  85. }
  86. }
  87. &-wrap {
  88. z-index: @zindex-image;
  89. }
  90. &-operations {
  91. .reset-component();
  92. position: absolute;
  93. top: 0;
  94. right: 0;
  95. z-index: 1;
  96. display: flex;
  97. flex-direction: row-reverse;
  98. align-items: center;
  99. width: 100%;
  100. color: @image-preview-operation-color;
  101. list-style: none;
  102. background: fade(@modal-mask-bg, 10%);
  103. pointer-events: auto;
  104. &-operation {
  105. margin-left: @control-padding-horizontal;
  106. padding: @control-padding-horizontal;
  107. cursor: pointer;
  108. &-disabled {
  109. color: @image-preview-operation-disabled-color;
  110. pointer-events: none;
  111. }
  112. &:last-of-type {
  113. margin-left: 0;
  114. }
  115. }
  116. &-icon {
  117. font-size: @image-preview-operation-size;
  118. }
  119. }
  120. &-switch-left,
  121. &-switch-right {
  122. position: absolute;
  123. top: 50%;
  124. right: 10px;
  125. z-index: 1;
  126. display: flex;
  127. align-items: center;
  128. justify-content: center;
  129. width: 44px;
  130. height: 44px;
  131. margin-top: -22px;
  132. color: @image-preview-operation-color;
  133. background: fade(@modal-mask-bg, 10%);
  134. border-radius: 50%;
  135. cursor: pointer;
  136. pointer-events: auto;
  137. &-disabled {
  138. color: @image-preview-operation-disabled-color;
  139. cursor: not-allowed;
  140. > .@{iconfont-css-prefix} {
  141. cursor: not-allowed;
  142. }
  143. }
  144. > .@{iconfont-css-prefix} {
  145. font-size: 18px;
  146. }
  147. }
  148. &-switch-left {
  149. left: 10px;
  150. }
  151. &-switch-right {
  152. right: 10px;
  153. }
  154. }
  155. }