index.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html lang="en" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
  3. <head>
  4. <title>WeKan ® - MultiDrag at InteractJS.io</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <meta name="viewport" content="maximum-scale=1.0,width=device-width">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  8. <meta name="application-name" content="WeKan ®">
  9. <meta name="msapplication-TileColor" content="#00aba9">
  10. <meta name="theme-color" content="#fff">
  11. <style>
  12. /* VML for IE */
  13. v\:* {
  14. behavior: url(#default#VML);
  15. }
  16. #drag-1, #drag-2, #drag-3, #drag-4, #drag-5,
  17. #drag-6, #drag-7, #drag-8, #drag-9, #drag-10 {
  18. color: white;
  19. /* margin: 1rem 0 0 1rem; */
  20. touch-action: none;
  21. user-select: none;
  22. transform: translate(0px, 0px);
  23. cursor: move;
  24. border-radius: 25px;
  25. padding: 20px;
  26. /* background GIF produces dithered background at Amiga IBrowse, so better to use
  27. table background color to get solid color
  28. background:url("img/round-blue.gif") top left no-repeat; */
  29. outline: none; /* Remove default browser focus outline */
  30. transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Smooth transitions */
  31. }
  32. /* At active card at, show red border and shadow on focus*/
  33. #drag-1:focus, #drag-2:focus, #drag-3:focus,
  34. #drag-4:focus, #drag-5:focus, #drag-6:focus,
  35. #drag-7:focus, #drag-8:focus, #drag-9:focus,
  36. #drag-10:focus {
  37. border-color: #f00; /* Red border on focus */
  38. box-shadow: 0 0 0 5px rgba(255, 0, 0, 0.5); /* Red shadow on focus */
  39. height: 60px;
  40. }
  41. /* top + 130px is next position +20 ... background-color: #5e98c2; */
  42. #drag-1 { position: absolute; top: 300px; left: 10px;}
  43. #drag-2 { position: absolute; top: 430px; left: 10px;}
  44. #drag-3 { position: absolute; top: 560px; left: 10px; }
  45. #drag-4 { position: absolute; top: 690px; left: 10px;}
  46. #drag-5 { position: absolute; top: 820px; left: 10px;}
  47. #drag-6 { position: absolute; top: 300px; left: 260px; }
  48. #drag-7 { position: absolute; top: 430px; left: 260px; }
  49. #drag-8 { position: absolute; top: 560px; left: 260px; }
  50. #drag-9 { position: absolute; top: 690px; left: 260px; }
  51. #drag-10 { position: absolute; top: 820px; left: 260px; }
  52. .draggable {
  53. touch-action: none;
  54. }
  55. .redlines {
  56. position: fixed; /* or position: absolute */
  57. top: 440px;
  58. left: 150px;
  59. width: 50px;
  60. height: 2px;
  61. pointer-events: none; /* so that below cards can be clicked */
  62. }
  63. </style>
  64. <script src="js/interact.js"></script>
  65. <style type="text/css">
  66. #drop_file_zone {
  67. background-color: #EEE;
  68. border: #999 5px dashed;
  69. width: 290px;
  70. height: 200px;
  71. padding: 8px;
  72. font-size: 18px;
  73. }
  74. #drag_upload_file {
  75. width:50%;
  76. margin:0 auto;
  77. }
  78. #drag_upload_file p {
  79. text-align: center;
  80. }
  81. #drag_upload_file #selectfile {
  82. display: none;
  83. }
  84. #oneboard {
  85. min-height: 100px;
  86. border: 1px solid black;
  87. padding: 2px;
  88. border-radius: 10px 10px 10px 10px;
  89. }
  90. body {
  91. font-family: Arial, Helvetica, sans-serif;
  92. background-color: #dfdfdf;
  93. margin: 0;
  94. padding: 0;
  95. }
  96. </style>
  97. </head>
  98. <body>
  99. <br>
  100. <br>
  101. <h2>MultiDrag test, for future version of <a href="https://wekan.github.io">WeKan Open Source kanban</a></h2>
  102. <p>This MultiDrag test uses <a href="https://interactjs.io">https://interactjs.io</a> drag drop</p>
  103. <p>Features:</p>
  104. <ul>
  105. <li>Newest browsers, MultiDrag: Touchscreen, you can drag many cards at once with each finger.
  106. Use case: Many users can drag their own card at big touch screen. Or one user can drag many cards.
  107. There is not any kanban software with MultiDrag feature yet.
  108. </li>
  109. <li>Ladybird, OneDrag: Touchscreen, drag only one card at once. Is it possible to get MultiDrag?</li>
  110. <li>Legacy Browsers: Uses HTML4 tables, and GIF image for rounded corners, to be visible at Netsurf and Amiga IBrowse.
  111. No drag drop features, so there will be buttons to move cards.
  112. </li>
  113. </ul>
  114. <!-- Background GIF produces dithered background at Amiga IBrowse,
  115. so better to use table background color to get solid color:
  116. table background="img/round-blue.gif" => table bgcolor="#5e98c2"
  117. But this causes card to not have rounded corners at Netsurf and Amiga IBrowse.
  118. So, to have rounded corners at Netsurf and Amiga IBrowse, use background GIF.
  119. valid_colors = ['white', 'green', 'yellow', 'orange', 'red', 'purple', 'blue', 'sky', 'lime', 'pink', 'black',
  120. 'silver', 'peachpuff', 'crimson', 'plum', 'darkgreen', 'slateblue', 'magenta', 'gold', 'navy',
  121. 'gray', 'saddlebrown', 'paleturquoise', 'mistyrose', 'indigo']
  122. <table bgcolor="#5e98c2"
  123. -->
  124. <table bgcolor="blue" tabindex="1" style="border-collapse: collapse;" width="200" height="80"
  125. border="0" padding="0" spacing="0" id="drag-1" class="draggable"
  126. border-collapse="collapse">
  127. <tbody><tr border="0" padding="0" spacing="0">
  128. <td width="20" height="20"></td>
  129. <td width="160" height="40" valign="middle" align="top">
  130. <font size="1" color="white" face="arial">
  131. <b>At touchscreen</b>
  132. <p></p></font>
  133. </td>
  134. <td width="20" height="20"></td>
  135. </tr>
  136. <tr border="0" padding="0" spacing="0">
  137. <td width="20" height="20"></td>
  138. <td width="160" height="20"></td>
  139. <td width="20" height="20"></td>
  140. </tr>
  141. <tr border="0" padding="0" spacing="0">
  142. <td width="20" height="20"></td>
  143. <td width="160" height="20"></td>
  144. <td width="20" height="20"></td>
  145. </tr>
  146. </tbody></table>
  147. <br>
  148. <table bgcolor="green" tabindex="2" style="border-collapse: collapse;" width="200" height="80"
  149. border="0" padding="0" spacing="0" id="drag-2" class="draggable" border-collapse="collapse">
  150. <tbody><tr border="0" padding="0" spacing="0">
  151. <td width="20" height="20"></td>
  152. <td width="160" height="40" valign="middle" align="top">
  153. <font size="1" color="white" face="arial">
  154. <b>Drag many at once</b>
  155. <p></p></font>
  156. </td>
  157. <td width="20" height="20"></td>
  158. </tr>
  159. <tr border="0" padding="0" spacing="0">
  160. <td width="20" height="20"></td>
  161. <td width="160" height="20"></td>
  162. <td width="20" height="20"></td>
  163. </tr>
  164. <tr border="0" padding="0" spacing="0">
  165. <td width="20" height="20"></td>
  166. <td width="160" height="20"></td>
  167. <td width="20" height="20"></td>
  168. </tr>
  169. </tbody></table>
  170. <br>
  171. <table bgcolor="red" tabindex="3" style="border-collapse: collapse;" width="200" height="80"
  172. border="0" padding="0" spacing="0" id="drag-3" class="draggable" border-collapse="collapse">
  173. <tbody><tr border="0" padding="0" spacing="0">
  174. <td width="20" height="20"></td>
  175. <td width="160" height="40" valign="middle" align="top">
  176. <font size="1" color="white" face="arial">
  177. <b>Visible at Netsurf</b>
  178. <p></p></font>
  179. </td>
  180. <td width="20" height="20"></td>
  181. </tr>
  182. <tr border="0" padding="0" spacing="0">
  183. <td width="20" height="20"></td>
  184. <td width="160" height="20"></td>
  185. <td width="20" height="20"></td>
  186. </tr>
  187. <tr border="0" padding="0" spacing="0">
  188. <td width="20" height="20"></td>
  189. <td width="160" height="20"></td>
  190. <td width="20" height="20"></td>
  191. </tr>
  192. </tbody></table>
  193. <br>
  194. <table bgcolor="yellow" tabindex="4" style="border-collapse: collapse;" width="200" height="80"
  195. border="0" padding="0" spacing="0" id="drag-4" class="draggable" border-collapse="collapse">
  196. <tbody><tr border="0" padding="0" spacing="0">
  197. <td width="20" height="20"></td>
  198. <td width="160" height="40" valign="middle" align="top">
  199. <font size="1" color="black" face="arial">
  200. <b>and Amiga IBrowse</b>
  201. <p></p></font>
  202. </td>
  203. <td width="20" height="20"></td>
  204. </tr>
  205. <tr border="0" padding="0" spacing="0">
  206. <td width="20" height="20"></td>
  207. <td width="160" height="20"></td>
  208. <td width="20" height="20"></td>
  209. </tr>
  210. <tr border="0" padding="0" spacing="0">
  211. <td width="20" height="20"></td>
  212. <td width="160" height="20"></td>
  213. <td width="20" height="20"></td>
  214. </tr>
  215. </tbody>
  216. </table>
  217. <br>
  218. <table bgcolor="gray" tabindex="5" style="border-collapse: collapse;" width="200" height="80"
  219. border="0" padding="0" spacing="0" id="drag-5" class="draggable" border-collapse="collapse">
  220. <tbody><tr border="0" padding="0" spacing="0">
  221. <td width="20" height="20"></td>
  222. <td width="160" height="40" valign="middle" align="top">
  223. <font size="1" color="white" face="arial">
  224. <b>For all browsers</b>
  225. <p></p></font>
  226. </td>
  227. <td width="20" height="20"></td>
  228. </tr>
  229. <tr border="0" padding="0" spacing="0">
  230. <td width="20" height="20"></td>
  231. <td width="160" height="20"></td>
  232. <td width="20" height="20"></td>
  233. </tr>
  234. <tr border="0" padding="0" spacing="0">
  235. <td width="20" height="20"></td>
  236. <td width="160" height="20"></td>
  237. <td width="20" height="20"></td>
  238. </tr>
  239. </tbody>
  240. </table>
  241. <br>
  242. <table bgcolor="black" tabindex="6" style="border-collapse: collapse;" width="200" height="80"
  243. border="0" padding="0" spacing="0" id="drag-6" class="draggable" border-collapse="collapse">
  244. <tbody><tr border="0" padding="0" spacing="0">
  245. <td width="20" height="20"></td>
  246. <td width="160" height="40" valign="middle" align="top">
  247. <font size="1" color="white" face="arial">
  248. <b>And all screen sizes</b>
  249. <p></p></font>
  250. </td>
  251. <td width="20" height="20"></td>
  252. </tr>
  253. <tr border="0" padding="0" spacing="0">
  254. <td width="20" height="20"></td>
  255. <td width="160" height="20"></td>
  256. <td width="20" height="20"></td>
  257. </tr>
  258. <tr border="0" padding="0" spacing="0">
  259. <td width="20" height="20"></td>
  260. <td width="160" height="20"></td>
  261. <td width="20" height="20"></td>
  262. </tr>
  263. </tbody>
  264. </table>
  265. <br>
  266. <table bgcolor="cyan" tabindex="7" style="border-collapse: collapse;" width="200" height="80"
  267. border="0" padding="0" spacing="0" id="drag-7" class="draggable" border-collapse="collapse">
  268. <tbody><tr border="0" padding="0" spacing="0">
  269. <td width="20" height="20"></td>
  270. <td width="160" height="40" valign="middle" align="top">
  271. <font size="1" color="black" face="arial">
  272. <b>And all OS</b>
  273. <p></p></font>
  274. </td>
  275. <td width="20" height="20"></td>
  276. </tr>
  277. <tr border="0" padding="0" spacing="0">
  278. <td width="20" height="20"></td>
  279. <td width="160" height="20"></td>
  280. <td width="20" height="20"></td>
  281. </tr>
  282. <tr border="0" padding="0" spacing="0">
  283. <td width="20" height="20"></td>
  284. <td width="160" height="20"></td>
  285. <td width="20" height="20"></td>
  286. </tr>
  287. </tbody>
  288. </table>
  289. <br>
  290. <table bgcolor="pink" tabindex="8" style="border-collapse: collapse;" width="200" height="80"
  291. border="0" padding="0" spacing="0" id="drag-8" class="draggable" border-collapse="collapse">
  292. <tbody><tr border="0" padding="0" spacing="0">
  293. <td width="20" height="20"></td>
  294. <td width="160" height="40" valign="middle" align="top">
  295. <font size="1" color="black" face="arial">
  296. <b>And CPUs</b>
  297. <p></p></font>
  298. </td>
  299. <td width="20" height="20"></td>
  300. </tr>
  301. <tr border="0" padding="0" spacing="0">
  302. <td width="20" height="20"></td>
  303. <td width="160" height="20"></td>
  304. <td width="20" height="20"></td>
  305. </tr>
  306. <tr border="0" padding="0" spacing="0">
  307. <td width="20" height="20"></td>
  308. <td width="160" height="20"></td>
  309. <td width="20" height="20"></td>
  310. </tr>
  311. </tbody>
  312. </table>
  313. <br>
  314. <table bgcolor="orange" tabindex="9" style="border-collapse: collapse;" width="200" height="80"
  315. border="0" padding="0" spacing="0" id="drag-9" class="draggable" border-collapse="collapse">
  316. <tbody><tr border="0" padding="0" spacing="0">
  317. <td width="20" height="20"></td>
  318. <td width="160" height="40" valign="middle" align="top">
  319. <font size="1" color="black" face="arial">
  320. <b>At Earth</b>
  321. <p></p></font>
  322. </td>
  323. <td width="20" height="20"></td>
  324. </tr>
  325. <tr border="0" padding="0" spacing="0">
  326. <td width="20" height="20"></td>
  327. <td width="160" height="20"></td>
  328. <td width="20" height="20"></td>
  329. </tr>
  330. <tr border="0" padding="0" spacing="0">
  331. <td width="20" height="20"></td>
  332. <td width="160" height="20"></td>
  333. <td width="20" height="20"></td>
  334. </tr>
  335. </tbody>
  336. </table>
  337. <br>
  338. <table bgcolor="lightblue" tabindex="10" style="border-collapse: collapse;" width="200" height="80"
  339. border="0" padding="0" spacing="0" id="drag-10" class="draggable" border-collapse="collapse">
  340. <tbody><tr border="0" padding="0" spacing="0">
  341. <td width="20" height="20"></td>
  342. <td width="160" height="40" valign="middle" align="top">
  343. <font size="1" color="black" face="arial">
  344. <b>And Space</b>
  345. <p></p></font>
  346. </td>
  347. <td width="20" height="20"></td>
  348. </tr>
  349. <tr border="0" padding="0" spacing="0">
  350. <td width="20" height="20"></td>
  351. <td width="160" height="20"></td>
  352. <td width="20" height="20"></td>
  353. </tr>
  354. <tr border="0" padding="0" spacing="0">
  355. <td width="20" height="20"></td>
  356. <td width="160" height="20"></td>
  357. <td width="20" height="20"></td>
  358. </tr>
  359. </tbody>
  360. </table>
  361. <br>
  362. <div class="redlines">
  363. <svg height="210" width="500">
  364. <line x1="0" y1="0" x2="270" y2="150" style="stroke:rgb(255,0,0);stroke-width:2" />
  365. </svg>
  366. <v:group coordorigin="0 0" coordsize="500 210" style="width:500px;height:210px;">
  367. <v:line from="0,0" to="270,150" strokecolor="red" strokeweight="2pt" />
  368. </v:group>
  369. </div>
  370. <script type="text/javascript">
  371. // target elements with the "draggable" class
  372. interact('.draggable')
  373. .draggable({
  374. // Disabled inertia, because it restricted area where to drag card,
  375. // and returned card to wrong position.
  376. // enable inertial throwing
  377. //inertia: true, // This is default. Trying to disable it.
  378. inertia: false,
  379. // keep the element within the area of it's parent. // This is default. Trying to disable it.
  380. /*
  381. modifiers: [
  382. interact.modifiers.restrictRect({
  383. restriction: 'parent',
  384. endOnly: true
  385. })
  386. ],
  387. */
  388. // enable autoScroll
  389. autoScroll: true,
  390. listeners: {
  391. // call this function on every dragmove event
  392. move: dragMoveListener,
  393. // call this function on every dragend event
  394. end (event) {
  395. var textEl = event.target.querySelector('p')
  396. textEl && (textEl.textContent =
  397. 'moved ' +
  398. (Math.sqrt(Math.pow(event.pageX - event.x0, 2) +
  399. Math.pow(event.pageY - event.y0, 2) | 0))
  400. .toFixed(0) + 'px from ' +
  401. 'x' + event.x0.toFixed(0) + '=>' + event.pageX.toFixed(0) +
  402. ', y' + event.y0.toFixed(0) + '=>' + event.pageY.toFixed(0));
  403. }
  404. }
  405. })
  406. function dragMoveListener (event) {
  407. var target = event.target
  408. // keep the dragged position in the data-x/data-y attributes
  409. var x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx
  410. var y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy
  411. // translate the element
  412. target.style.transform = 'translate(' + x + 'px, ' + y + 'px)'
  413. // update the posiion attributes
  414. target.setAttribute('data-x', x)
  415. target.setAttribute('data-y', y)
  416. }
  417. // this function is used later in the resizing and gesture demos
  418. window.dragMoveListener = dragMoveListener
  419. </script>
  420. </body>
  421. </html>