handles.scss 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. @import "vars";
  2. @import "mixins";
  3. .artifact {
  4. .selection-actions {display: none; }
  5. &.selected {
  6. .selection-actions {display: block; }
  7. }
  8. }
  9. .selection-actions {
  10. position: absolute;
  11. right: 0;
  12. top: 0;
  13. padding: 10px;
  14. pointer-events: auto;
  15. }
  16. @mixin tri-s {
  17. &:after {
  18. top: 100%;
  19. margin-left: -13px;
  20. left: 50%;
  21. margin-top: -5px;
  22. border-left: 13px solid transparent;
  23. border-right: 13px solid transparent;
  24. border-top: 13px solid $dark;
  25. }
  26. }
  27. @mixin tri-n {
  28. &:after {
  29. bottom: 100%;
  30. margin-left: -13px;
  31. left: 50%;
  32. margin-bottom: -5px;
  33. border-left: 13px solid transparent;
  34. border-right: 13px solid transparent;
  35. border-bottom: 13px solid $dark;
  36. }
  37. }
  38. @mixin tri-e {
  39. &:after {
  40. left: 100%;
  41. margin-top: -13px;
  42. top: 50%;
  43. margin-left: -5px;
  44. border-top: 13px solid transparent;
  45. border-bottom: 13px solid transparent;
  46. border-left: 13px solid $dark;
  47. }
  48. }
  49. @mixin tri-w {
  50. &:after {
  51. right: 100%;
  52. margin-top: -13px;
  53. top: 50%;
  54. margin-right: -5px;
  55. border-top: 13px solid transparent;
  56. border-bottom: 13px solid transparent;
  57. border-right: 13px solid $dark;
  58. }
  59. }
  60. .selected .handles {
  61. display: block;
  62. // box-shadow: 0 0 0 1px rgba(41,41,41,0.4);
  63. }
  64. .handles {
  65. // background-color: rgba(40,140,215,0.45);
  66. border: 1px solid rgba(255,255,255,0.5);
  67. position: absolute;
  68. left: 0;
  69. top: 0;
  70. bottom: 0;
  71. right: 0;
  72. z-index: 800;
  73. pointer-events: none;
  74. &:after{
  75. border: 1px dotted rgba(40,140,215,1);
  76. content: "";
  77. display: block;
  78. position: absolute;
  79. height: auto;
  80. width: auto;
  81. top: -1px;
  82. left: -1px;
  83. right: -1px;
  84. bottom: -1px;
  85. }
  86. }
  87. .extreme-zoom .handles {
  88. border: 8px solid rgba(255,255,255,0.5);
  89. &:after{
  90. border: 8px dotted rgba(40,140,215,1);
  91. top: -4px;
  92. left: -4px;
  93. right: -4px;
  94. bottom: -4px;
  95. }
  96. }
  97. .extreme-zoom .handle {
  98. @include scale(8,8);
  99. &:hover {
  100. @include scale(12,12);
  101. }
  102. }
  103. .mouse-scribble, .mouse-vector_transform {
  104. .handles, .handles:after {
  105. display: none !important;
  106. }
  107. }
  108. // .n-resize { cursor: n-resize; }
  109. // .e-resize { cursor: e-resize; }
  110. // .s-resize { cursor: s-resize; }
  111. // .w-resize { cursor: w-resize; }
  112. // .ns-resize { cursor: ns-resize; }
  113. // .ew-resize { cursor: ew-resize; }
  114. // .ne-resize { cursor: ne-resize; }
  115. // .nw-resize { cursor: nw-resize; }
  116. // .se-resize { cursor: se-resize; }
  117. // .sw-resize { cursor: sw-resize; }
  118. // .nesw-resize { cursor: nesw-resize; }
  119. // .nwse-resize { cursor: nwse-resize; }
  120. .resize-nw {
  121. .value-w {
  122. right: 35px;
  123. top: -10px;
  124. @include transform-origin(center right);
  125. @include tri-e;
  126. }
  127. .value-h {
  128. left: -10px;
  129. bottom: 35px;
  130. @include transform-origin(bottom center);
  131. @include tri-s;
  132. }
  133. }
  134. .resize-ne {
  135. .value-w {
  136. left: 35px;
  137. top: -10px;
  138. @include tri-w;
  139. @include transform-origin(center left);
  140. }
  141. .value-h {
  142. right: -10px;
  143. bottom: 35px;
  144. @include transform-origin(bottom center);
  145. @include tri-s;
  146. }
  147. }
  148. .resize-se {
  149. .value-w {
  150. left: 35px;
  151. bottom: -10px;
  152. @include tri-w;
  153. @include transform-origin(center left);
  154. }
  155. .value-h {
  156. right: -10px;
  157. top: 35px;
  158. @include transform-origin(top center);
  159. @include tri-n;
  160. pointer-events: none;
  161. }
  162. }
  163. .resize-sw {
  164. .value-w {
  165. right: 35px;
  166. bottom: -10px;
  167. @include tri-e;
  168. @include transform-origin(center right);
  169. // border-top-left-radius: 5px;
  170. // border-bottom-left-radius: 5px;
  171. }
  172. .value-h {
  173. left: -10px;
  174. top: 35px;
  175. @include transform-origin(top center);
  176. @include tri-n;
  177. // border-bottom-left-radius: 5px;
  178. // border-bottom-right-radius: 5px;
  179. }
  180. }
  181. .resize-n {
  182. .value-h {
  183. margin-left: -20px;
  184. left: 50%;
  185. bottom: 20px;
  186. @include transform-origin(bottom center);
  187. @include tri-s;
  188. }
  189. }
  190. .resize-e {
  191. .value-w {
  192. left: 20px;
  193. top: 50%;
  194. margin-top: -20px;
  195. @include tri-w;
  196. @include transform-origin(center left);
  197. }
  198. }
  199. .resize-s {
  200. .value-h {
  201. left: 50%;
  202. margin-left: -20px;
  203. top: 20px;
  204. @include transform-origin(top center);
  205. @include tri-n;
  206. }
  207. }
  208. .resize-w {
  209. .value-w {
  210. right: 20px;
  211. top: 50%;
  212. margin-top: -20px;
  213. @include tri-e;
  214. @include transform-origin(center right);
  215. }
  216. }
  217. .value-h,
  218. .value-w {
  219. z-index: 1;
  220. line-height: 40px;
  221. width: 40px;
  222. height: 40px;
  223. display: inline-block;
  224. position: absolute;
  225. border-radius: 100%;
  226. // border-radius: $radius;
  227. @include scale(0,0);
  228. // opacity: 0;
  229. pointer-events: none !important;
  230. @include transition( all 0.1s 0.05s ease-in-out);
  231. text-align: center;
  232. background-color: $dark;
  233. color: $light;
  234. font-size: 10px;
  235. &:after {
  236. @include transition( all 0.3s ease-in-out);
  237. content: "";
  238. position: absolute;
  239. width: 0;
  240. height: 0;
  241. pointer-events: none !important;
  242. }
  243. }
  244. .handle > div > div > div:active .value-w,
  245. .handle:active .value-h{
  246. @include transition( all 0.05s 0s cubic-bezier(0, 0, 0.7, 1.7));
  247. opacity: 1;
  248. @include scale(1,1);
  249. }
  250. .edge-handle:active .value-w,
  251. .edge-handle:active .value-h{
  252. @include transition( all 0.05s 0s cubic-bezier(0, 0, 0.7, 1.7));
  253. opacity: 1;
  254. @include scale(1,1);
  255. }
  256. .edge-handle {
  257. @include user-select(none);
  258. pointer-events:auto;
  259. z-index: 1000;
  260. position: absolute;
  261. background-clip: content-box;
  262. @include transition( background-color 0.05s ease-in-out);
  263. &:active,
  264. &:hover {
  265. background-color: $blue;
  266. @include transition( background-color 0s ease-in-out);
  267. }
  268. &.resize-n,
  269. &.resize-s {
  270. width: 100%;
  271. height: 10px;
  272. }
  273. &.resize-w,
  274. &.resize-e {
  275. width: 10px;
  276. height: 100%;
  277. }
  278. &.resize-n:active { border-top: 3px solid transparent; border-bottom: 3px solid transparent; }
  279. &.resize-s:active { border-top: 3px solid transparent; border-bottom: 3px solid transparent; }
  280. &.resize-w:active { border-left: 3px solid transparent; border-right: 3px solid transparent; }
  281. &.resize-e:active { border-left: 3px solid transparent; border-right: 3px solid transparent; }
  282. &.resize-n { &:active,&:hover, { cursor: ns-resize;}}
  283. &.resize-s { &:active,&:hover, { cursor: ns-resize;}}
  284. &.resize-w { &:active,&:hover, { cursor: ew-resize;}}
  285. &.resize-e { &:active,&:hover, { cursor: ew-resize;}}
  286. &.resize-n { border-top: 4px solid transparent; border-bottom: 4px solid transparent; bottom: 100%; margin-bottom: -5px; }
  287. &.resize-s { border-top: 4px solid transparent; border-bottom: 4px solid transparent; top: 100%; margin-top: -5px; }
  288. &.resize-w { border-left: 4px solid transparent; border-right: 4px solid transparent; right: 100%; margin-right: -5px; }
  289. &.resize-e { border-left: 4px solid transparent; border-right: 4px solid transparent; left: 100%; margin-left: -5px; }
  290. }
  291. .vector-handle {
  292. @include user-select(none);
  293. pointer-events:auto;
  294. z-index: 2000;
  295. position: absolute;
  296. width: 30px !important;
  297. height: 30px !important;
  298. border-radius: 100%;
  299. margin: -15px;
  300. border: 1px solid rgba(0,0,0,0.25);
  301. &:hover {
  302. background-color: rgba(255,255,255,0.5);
  303. cursor: move;
  304. }
  305. }
  306. .handles-vector {
  307. .handle, .edge-handle {
  308. display: none !important;
  309. }
  310. }
  311. .handles:not(.handles-vector) .vector-handle {
  312. display: none;
  313. }
  314. .handle {
  315. @include user-select(none);
  316. pointer-events:auto;
  317. z-index: 2000;
  318. position: absolute;
  319. width: 60px !important;
  320. height: 60px !important;
  321. border-radius: 100%;
  322. margin: -30px;
  323. @include transition(all 0.1s ease-in-out);
  324. @include scale(0.5,0.5);
  325. &:hover {
  326. @include scale(1,1);
  327. .value-h,
  328. .value-w {
  329. display: block;
  330. }
  331. }
  332. // &:after {
  333. // @include transition( all 0.3s ease-in-out);
  334. // content: "";
  335. // position: absolute;
  336. // top: 0px;
  337. // margin-left: -20px;
  338. // width: 0;
  339. // height: 0;
  340. // border-left: 20px solid transparent;
  341. // border-right: 20px solid transparent;
  342. // border-top: 20px solid $dark;
  343. // pointer-events: none !important;
  344. // left: 50%;
  345. // }
  346. &.resize-nw { top: 0%; left: 0%;}
  347. &.resize-n { top: 0%; left: 50%;}
  348. &.resize-ne { top: 0%; left: 100%;}
  349. &.resize-e { top: 50%; left: 100%;}
  350. &.resize-se { top: 100%; left: 100%;}
  351. &.resize-s { top: 100%; left: 50%;}
  352. &.resize-sw { top: 100%; left: 0%;}
  353. &.resize-w { top: 50%; left: 0%;}
  354. &.resize-nw > div > div > div { cursor: nwse-resize; }
  355. &.resize-n > div > div > div { cursor: ns-resize;}
  356. &.resize-ne > div > div > div { cursor: nesw-resize; }
  357. &.resize-e > div > div > div { cursor: ew-resize; }
  358. &.resize-se > div > div > div { cursor: nwse-resize; }
  359. &.resize-s > div > div > div { cursor: ns-resize; }
  360. &.resize-sw > div > div > div { cursor: nesw-resize; }
  361. &.resize-w > div > div > div { cursor: ew-resize; }
  362. &.resize-n { display: none;}
  363. &.resize-e { display: none;}
  364. &.resize-s { display: none;}
  365. &.resize-w { display: none;}
  366. &:hover > div > div > div { border-width: 9px; }
  367. > div:hover > div > div { border-width: 8px; }
  368. > div > div:hover > div { border-width: 7px; }
  369. > div > div > div:hover { border-width: 6px; }
  370. > div > div > div:active { border-width: 6px; }
  371. > div > div > div {
  372. background-color: $dark;
  373. border-style: solid;
  374. border-width: 10px;
  375. border-color: transparent;
  376. -webkit-background-clip: padding-box;
  377. -moz-background-clip: padding-box;
  378. background-clip: padding-box;
  379. -webkit-transition: all .05s ease-in-out;
  380. -moz-transition: all .05s ease-in-out;
  381. -ms-transition: all .05s ease-in-out;
  382. -o-transition: all .05s ease-in-out;
  383. transition: all .05s ease-in-out;
  384. }
  385. div {
  386. position: relative;
  387. border-radius: 100%;
  388. top: 5px;
  389. left: 5px;
  390. @include transition( all 0.5s ease-in-out);
  391. }
  392. > div {
  393. width: 50px;
  394. height: 50px;
  395. }
  396. > div > div {
  397. width: 40px;
  398. height: 40px;
  399. }
  400. > div > div > div {
  401. z-index: 10;
  402. width: 30px;
  403. height: 30px;
  404. }
  405. }