You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

279 lines
6.9 KiB

  1. @white: white;
  2. @black: black;
  3. @selectionBorderWidth: 1px;
  4. @selectionBackgroundImage: "Jcrop.gif";
  5. @selectionBackgroundColor: @white;
  6. @selectionBackground: @selectionBackgroundColor url(@selectionBackgroundImage);
  7. // Setting some variables to
  8. // Used to set handle and dragbar size/width
  9. // To center on a 1px selection line, use an odd number
  10. @grabSize: 9px;
  11. // Used to offset handles and dragbar
  12. // Default value will center on 1px selection line
  13. @grabOffset: (floor(@grabSize/2)+1) * -1;
  14. @handleSize: @grabSize;
  15. @handleOffset: @grabOffset;
  16. @handleBorderWidth: 1px;
  17. @handleBorderColor: #eee;
  18. @handleBorderStyle: solid;
  19. @handleBackgroundColor: rgba(49,28,28,0.58);
  20. @handleOpacity: 0.8;
  21. @dragbarWidth: @grabSize;
  22. @dragbarOffset: @grabOffset;
  23. /*
  24. The outer-most container in a typical Jcrop instance
  25. If you are having difficulty with formatting related to styles
  26. on a parent element, place any fixes here or in a like selector
  27. You can also style this element if you want to add a border, etc
  28. A better method for styling can be seen below with .jcrop-light
  29. (Add a class to the holder and style elements for that extended class)
  30. */
  31. .jcrop-active {
  32. direction: ltr;
  33. text-align: left;
  34. box-sizing: border-box;
  35. /* IE10 touch compatibility */ -ms-touch-action: none;
  36. }
  37. .jcrop-dragging {
  38. -moz-user-select: none;
  39. -webkit-user-select: none;
  40. -ms-user-select: none;
  41. user-select: none;
  42. }
  43. .jcrop-selection {
  44. z-index: 2;
  45. &.jcrop-current { z-index: 4; }
  46. }
  47. /* Selection Borders */
  48. .jcrop-border {
  49. background: @selectionBackground;
  50. line-height: 1px !important;
  51. font-size: 0 !important;
  52. overflow: hidden;
  53. position: absolute;
  54. filter: Alpha(opacity=50) !important;
  55. opacity: 0.5 !important;
  56. &.ord-w, &.ord-e, &.ord-n { top: 0px; }
  57. &.ord-n, &.ord-s { width: 100%; height: @selectionBorderWidth !important; }
  58. &.ord-w, &.ord-e { height: 100%; width: @selectionBorderWidth !important; }
  59. &.ord-e { right: -@selectionBorderWidth; }
  60. &.ord-n { top: -@selectionBorderWidth; }
  61. &.ord-w { left: -@selectionBorderWidth; }
  62. &.ord-s { bottom: -@selectionBorderWidth; }
  63. }
  64. .jcrop-selection {
  65. position: absolute;
  66. }
  67. .jcrop-box {
  68. z-index: 2;
  69. display: block;
  70. background: none;
  71. border: none;
  72. padding: 0;
  73. margin: 0;
  74. font-size: 0;
  75. &:hover { background: none; }
  76. &:active { background: none; }
  77. &:focus { outline: 1px rgba(128,128,128,.65) dotted; }
  78. }
  79. .jcrop-active, .jcrop-box { position: relative; }
  80. .jcrop-box { width: 100%; height: 100%; cursor: move; }
  81. .handles (@handleSize;@handleOffset;@bgColor;@bgOpacity;@borderWidth;@borderColor;@borderStyle) {
  82. z-index: 4;
  83. @ieopacity: @bgOpacity * 100;
  84. font-size: 0;
  85. background-color: @bgColor;
  86. border: @borderWidth @borderColor @borderStyle;
  87. width: @handleSize;
  88. height: @handleSize;
  89. font-size: 0;
  90. position: absolute;
  91. filter: Alpha(opacity=@ieopacity) !important;
  92. opacity: @bgOpacity !important;
  93. &.ord-n {left:50%;margin-left:@handleOffset;margin-top:@handleOffset;top:0;cursor:n-resize;}
  94. &.ord-s {bottom:0;left:50%;margin-bottom:@handleOffset;margin-left:@handleOffset;cursor:s-resize;}
  95. &.ord-e {margin-right:@handleOffset;margin-top:@handleOffset;right:0;top:50%;cursor:e-resize;}
  96. &.ord-w {left:0;margin-left:@handleOffset;margin-top:@handleOffset;top:50%;cursor:w-resize;}
  97. &.ord-nw {left:0;margin-left:@handleOffset;margin-top:@handleOffset;top:0;cursor:nw-resize;}
  98. &.ord-ne {margin-right:@handleOffset;margin-top:@handleOffset;right:0;top:0;cursor:ne-resize;}
  99. &.ord-se {bottom:0;margin-bottom:@handleOffset;margin-right:@handleOffset;right:0;cursor:se-resize;}
  100. &.ord-sw {bottom:0;left:0;margin-bottom:@handleOffset;margin-left:@handleOffset;cursor:sw-resize;}
  101. }
  102. .standard-handles (@handleSize;@bgColor;@bgOpacity;@borderColor) {
  103. @handleOffset: (floor(@handleSize/2)+1) * -1;
  104. .handles(@handleSize;@handleOffset;@bgColor;@bgOpacity;@handleBorderWidth;@borderColor;@handleBorderStyle);
  105. }
  106. /* Selection Handles */
  107. .jcrop-handle {
  108. .standard-handles(@handleSize;@handleBackgroundColor;@handleOpacity;@handleBorderColor);
  109. }
  110. /* Larger Selection Handles for Touch */
  111. .jcrop-touch .jcrop-handle {
  112. .standard-handles(@handleSize * 2;@handleBackgroundColor;@handleOpacity;@handleBorderColor);
  113. }
  114. /* Selection Dragbars */
  115. .jcrop-dragbar {
  116. font-size: 0;
  117. position: absolute;
  118. &.ord-n, &.ord-s {height:@dragbarWidth !important;width:100%;}
  119. &.ord-e, &.ord-w { top:0px; height:100%;width:@dragbarWidth !important;}
  120. &.ord-n {margin-top:@dragbarOffset;cursor:n-resize; top:0px; }
  121. &.ord-s {bottom:0;margin-bottom:@dragbarOffset;cursor:s-resize;}
  122. &.ord-e {margin-right:@dragbarOffset;right:0;cursor:e-resize;}
  123. &.ord-w {margin-left:@dragbarOffset;cursor:w-resize;}
  124. }
  125. /* Shading panels */
  126. .jcrop-shades {
  127. position: relative;
  128. top: 0;
  129. left: 0;
  130. div { cursor: crosshair; }
  131. }
  132. /* Various special states */
  133. .jcrop-noresize {
  134. .jcrop-dragbar,
  135. .jcrop-handle
  136. { display: none; }
  137. }
  138. .jcrop-selection.jcrop-nodrag .jcrop-box,
  139. .jcrop-nodrag .jcrop-shades div
  140. { cursor: default; }
  141. /* The "jcrop-light" class/extension */
  142. .jcrop-light {
  143. .jcrop-border {
  144. background: @white;
  145. filter:Alpha(opacity=70)!important;
  146. opacity:.70!important;
  147. }
  148. .jcrop-handle {
  149. background-color: @black;
  150. border-color: @white;
  151. }
  152. }
  153. /* The "jcrop-dark" class/extension */
  154. .jcrop-dark {
  155. .jcrop-border {
  156. background: @black;
  157. filter: Alpha(opacity=70) !important;
  158. opacity: 0.7 !important;
  159. }
  160. .jcrop-handle {
  161. background-color: @white;
  162. border-color: @black;
  163. }
  164. }
  165. /* Simple macro to turn off the antlines */
  166. .solid-line {
  167. .jcrop-border {
  168. background: @selectionBackgroundColor;
  169. }
  170. }
  171. .jcrop-thumb {
  172. position: absolute;
  173. overflow: hidden;
  174. z-index: 5;
  175. }
  176. /* Fix for twitter bootstrap et al. */
  177. .jcrop-active img,
  178. .jcrop-thumb img,
  179. .jcrop-thumb canvas {
  180. min-width: none;
  181. min-height: none;
  182. max-width: none;
  183. max-height: none;
  184. }
  185. /* Improved multiple selection styles - in progress */
  186. .jcrop-hl-active {
  187. .jcrop-border {
  188. filter:Alpha(opacity=20)!important;
  189. opacity:.20!important;
  190. }
  191. .jcrop-handle {
  192. filter:Alpha(opacity=10)!important;
  193. opacity:.10!important;
  194. }
  195. .jcrop-selection:hover {
  196. .jcrop-border {
  197. background-color: #ccc;
  198. filter:Alpha(opacity=50)!important;
  199. opacity:.50!important;
  200. }
  201. /*
  202. .jcrop-handle {
  203. filter:Alpha(opacity=35)!important;
  204. opacity:.35!important;
  205. }
  206. */
  207. }
  208. .jcrop-selection.jcrop-current {
  209. .jcrop-border {
  210. background: gray url('Jcrop.gif');
  211. opacity:.35!important;
  212. filter:Alpha(opacity=35)!important;
  213. }
  214. .jcrop-handle {
  215. filter:Alpha(opacity=30)!important;
  216. opacity:.30!important;
  217. }
  218. }
  219. .jcrop-selection.jcrop-focus {
  220. .jcrop-border {
  221. background: url('Jcrop.gif');
  222. opacity:.65!important;
  223. filter:Alpha(opacity=65)!important;
  224. }
  225. .jcrop-handle {
  226. filter:Alpha(opacity=60)!important;
  227. opacity:.60!important;
  228. }
  229. }
  230. }
  231. /* Prevent background on button element */
  232. button.jcrop-box { background: none; }