atome 0.5.4.1.9 → 0.5.5.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (357) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/README.md +70 -1
  4. data/Rakefile +246 -75
  5. data/app_builder_helpers/Rakefile +276 -288
  6. data/documentation/basic.md +242 -0
  7. data/documentation/deep learning/architecture.txt +3763 -0
  8. data/documentation/deep learning/atome.png +0 -0
  9. data/documentation/deep learning/basic_infos.txt +227 -0
  10. data/documentation/deep learning/example_of_users_code.rb +1810 -0
  11. data/documentation/deep learning/misc.txt +24 -0
  12. data/documentation/deep learning/ruby_js_example.rb +272 -0
  13. data/documentation/deep learning/wasm_script_help.text +14 -0
  14. data/documentation/framework/enhance_atome.md +1 -1
  15. data/documentation/tutorials/tutorials.md +7 -0
  16. data/exe/atome +308 -208
  17. data/lib/atome/atome.rb +52 -156
  18. data/lib/atome/extensions/atome.rb +129 -47
  19. data/lib/atome/extensions/mathematics.rb +20 -0
  20. data/lib/atome/extensions/ping.rb +2 -3
  21. data/lib/atome/genesis/generators/atome.rb +57 -30
  22. data/lib/atome/genesis/generators/communication.rb +9 -0
  23. data/lib/atome/genesis/generators/effect.rb +0 -1
  24. data/lib/atome/genesis/generators/event.rb +279 -43
  25. data/lib/atome/genesis/generators/geometry.rb +1 -10
  26. data/lib/atome/genesis/generators/hierarchy.rb +103 -0
  27. data/lib/atome/genesis/generators/identity.rb +45 -84
  28. data/lib/atome/genesis/generators/material.rb +31 -34
  29. data/lib/atome/genesis/generators/property.rb +31 -0
  30. data/lib/atome/genesis/generators/security.rb +31 -0
  31. data/lib/atome/genesis/generators/spatial.rb +3 -5
  32. data/lib/atome/genesis/generators/time.rb +0 -1
  33. data/lib/atome/genesis/generators/utility.rb +181 -66
  34. data/lib/atome/genesis/genesis.rb +152 -55
  35. data/lib/atome/genesis/sparkle.rb +59 -75
  36. data/lib/atome/helpers/color_helper/color/rgb/colors.rb +1 -1
  37. data/lib/atome/helpers/color_helper/color/rgb.rb +1 -1
  38. data/lib/atome/helpers/color_helper/color.rb +226 -7
  39. data/lib/atome/helpers/essentials.rb +22 -26
  40. data/lib/atome/helpers/security.rb +71 -0
  41. data/lib/atome/helpers/utilities.rb +191 -178
  42. data/lib/atome/kernel/black_matter.rb +22 -0
  43. data/lib/atome/kernel/universe.rb +123 -24
  44. data/lib/atome/presets/atome.rb +39 -35
  45. data/lib/atome/version.rb +3 -2
  46. data/lib/atome.rb +12 -12
  47. data/lib/atome_relative.rb +36 -0
  48. data/lib/{atome/renderers → platform_specific}/opal/atome_opal_extensions.rb +4 -1
  49. data/lib/{atome/renderers → platform_specific}/opal/extensions/color.rb +12 -5
  50. data/lib/{atome/renderers → platform_specific}/opal/extensions/geolocation.rb +1 -0
  51. data/lib/platform_specific/opal/extensions/js.rb +21 -0
  52. data/lib/platform_specific/opal/extensions/object.rb +6 -0
  53. data/lib/platform_specific/opal/extensions/ping.rb +31 -0
  54. data/lib/{atome/renderers → platform_specific}/opal/extensions/sha.rb +4 -2
  55. data/lib/platform_specific/wasm/atome_wasm_extensions.rb +11 -0
  56. data/lib/renderers/headless/headless.rb +18 -0
  57. data/lib/renderers/headless/index.rb +6 -0
  58. data/lib/renderers/headless/index_relative.rb +6 -0
  59. data/lib/renderers/headless/utility.rb +6 -0
  60. data/{vendor/assets/src/medias/rubies/examples/top.rb → lib/renderers/html/atome.rb} +0 -1
  61. data/lib/renderers/html/atome_html.rb +22 -0
  62. data/lib/renderers/html/effect.rb +26 -0
  63. data/lib/renderers/html/event.rb +43 -0
  64. data/lib/renderers/html/geometry.rb +31 -0
  65. data/lib/renderers/html/hierarchy.rb +233 -0
  66. data/lib/renderers/html/html.rb +1112 -0
  67. data/lib/renderers/html/identity.rb +84 -0
  68. data/lib/renderers/html/index.rb +19 -0
  69. data/lib/renderers/html/index_relative.rb +20 -0
  70. data/lib/renderers/html/material.rb +53 -0
  71. data/lib/renderers/html/property.rb +24 -0
  72. data/lib/renderers/html/spatial.rb +46 -0
  73. data/lib/renderers/html/time.rb +1 -0
  74. data/lib/renderers/html/utility.rb +38 -0
  75. data/lib/renderers/renderer.rb +16 -0
  76. data/lib/renderers/server/index.rb +4 -0
  77. data/lib/renderers/server/index_relative.rb +4 -0
  78. data/lib/renderers/server/utility.rb +4 -0
  79. data/sig/atome.rbs +6 -0
  80. data/sig/object.rbs +4 -0
  81. data/sig/universe.rbs +3 -0
  82. data/vendor/assets/Rakefile +3 -3
  83. data/vendor/assets/application/examples/a_concat.rb +16 -0
  84. data/vendor/assets/application/examples/affect.rb +8 -0
  85. data/vendor/assets/application/examples/animation.rb +96 -0
  86. data/vendor/assets/application/examples/apply.rb +8 -0
  87. data/vendor/assets/application/examples/atome.rb +5 -0
  88. data/vendor/assets/application/examples/attach.rb +34 -0
  89. data/vendor/assets/application/examples/attached.rb +38 -0
  90. data/vendor/assets/application/examples/basic_understanding.rb +52 -0
  91. data/vendor/assets/application/examples/browse.rb +17 -0
  92. data/vendor/assets/application/examples/callback.rb +20 -0
  93. data/vendor/assets/application/examples/category.rb +12 -0
  94. data/vendor/assets/application/examples/clear.rb +96 -0
  95. data/vendor/assets/application/examples/clones.rb +177 -0
  96. data/vendor/assets/application/examples/code.rb +13 -0
  97. data/vendor/assets/application/examples/color.rb +54 -0
  98. data/vendor/assets/application/examples/convert.rb +163 -0
  99. data/vendor/assets/application/examples/copy.rb +25 -0
  100. data/vendor/assets/application/examples/copybck.rb +68 -0
  101. data/vendor/assets/application/examples/debug.rb +78 -0
  102. data/vendor/assets/application/examples/delete.rb +93 -0
  103. data/vendor/assets/application/examples/display.rb +279 -0
  104. data/vendor/assets/application/examples/display_bck.rb +164 -0
  105. data/vendor/assets/application/examples/drag.rb +45 -0
  106. data/vendor/assets/application/examples/drop.rb +35 -0
  107. data/vendor/assets/application/examples/duplicate.rb +64 -0
  108. data/vendor/assets/application/examples/edit.rb +21 -0
  109. data/vendor/assets/application/examples/encode.rb +6 -0
  110. data/vendor/assets/application/examples/file.rb +50 -0
  111. data/vendor/assets/application/examples/find.rb +157 -0
  112. data/vendor/assets/application/examples/generator_and_build.rb +15 -0
  113. data/vendor/assets/application/examples/getter.rb +16 -0
  114. data/vendor/assets/application/examples/grab.rb +14 -0
  115. data/vendor/assets/application/examples/gradient.rb +35 -0
  116. data/vendor/assets/application/examples/group.rb +44 -0
  117. data/vendor/assets/application/examples/hierarchy.rb +21 -0
  118. data/vendor/assets/application/examples/history.rb +31 -0
  119. data/vendor/assets/application/examples/hypertext.rb +113 -0
  120. data/vendor/assets/application/examples/image.rb +5 -0
  121. data/vendor/assets/application/examples/keyboard.rb +59 -0
  122. data/vendor/assets/application/examples/layout.rb +227 -0
  123. data/vendor/assets/application/examples/login.rb +10 -0
  124. data/vendor/assets/application/examples/markup.rb +4 -0
  125. data/vendor/assets/application/examples/match.rb +115 -0
  126. data/vendor/assets/application/examples/messaging.rb +16 -0
  127. data/vendor/assets/application/examples/monitor.rb +14 -0
  128. data/vendor/assets/application/examples/on_resize.rb +7 -0
  129. data/vendor/assets/{src/medias/rubies/examples/get_renderer_list.rb → application/examples/online.rb} +1 -1
  130. data/vendor/assets/application/examples/over.rb +29 -0
  131. data/vendor/assets/application/examples/paint.rb +23 -0
  132. data/vendor/assets/application/examples/particles.rb +4 -0
  133. data/vendor/assets/application/examples/percent_to_px.rb +4 -0
  134. data/vendor/assets/application/examples/play.rb +50 -0
  135. data/vendor/assets/application/examples/presets.rb +33 -0
  136. data/vendor/assets/application/examples/random.rb +42 -0
  137. data/vendor/assets/application/examples/raw_html.rb +48 -0
  138. data/vendor/assets/application/examples/read.rb +11 -0
  139. data/vendor/assets/application/examples/refresh.rb +62 -0
  140. data/vendor/assets/application/examples/remove.rb +47 -0
  141. data/vendor/assets/application/examples/repeat.rb +26 -0
  142. data/vendor/assets/application/examples/resize.rb +17 -0
  143. data/vendor/assets/application/examples/scroll.rb +11 -0
  144. data/vendor/assets/application/examples/security.rb +76 -0
  145. data/vendor/assets/application/examples/selected.rb +30 -0
  146. data/vendor/assets/application/examples/shadow.rb +46 -0
  147. data/vendor/assets/application/examples/shapes.rb +6 -0
  148. data/vendor/assets/{src/medias/rubies → application}/examples/smooth.rb +5 -1
  149. data/vendor/assets/application/examples/style.rb +4 -0
  150. data/vendor/assets/application/examples/sync.rb +39 -0
  151. data/vendor/assets/application/examples/tagged.rb +24 -0
  152. data/vendor/assets/application/examples/terminal.rb +4 -0
  153. data/vendor/assets/application/examples/text.rb +5 -0
  154. data/vendor/assets/application/examples/touch.rb +38 -0
  155. data/vendor/assets/application/examples/type_mutation.rb +18 -0
  156. data/vendor/assets/application/examples/universe.rb +8 -0
  157. data/vendor/assets/application/examples/vector.rb +24 -0
  158. data/vendor/assets/application/examples/video.rb +14 -0
  159. data/vendor/assets/application/examples/wait.rb +6 -0
  160. data/vendor/assets/application/examples/www.rb +10 -0
  161. data/vendor/assets/application/index.rb +1 -1
  162. data/vendor/assets/application/test.rb +29 -0
  163. data/vendor/assets/application/works/photos.rb +672 -0
  164. data/vendor/assets/application/works/photos2.rb +218 -0
  165. data/vendor/assets/application/works/photos3.rb +343 -0
  166. data/vendor/assets/application/works/photos4.rb +34 -0
  167. data/vendor/assets/application/works/photos6.rb +6 -0
  168. data/vendor/assets/application/works/trigga.rb +0 -0
  169. data/vendor/assets/application/works/vie.rb +74 -0
  170. data/vendor/assets/server/atome_server.rb +37 -41
  171. data/vendor/assets/server/atome_server_wasm.rb +112 -0
  172. data/vendor/assets/server/capture.rb +10 -0
  173. data/vendor/assets/server/config.ru +5 -4
  174. data/vendor/assets/src/css/style.css +29 -4
  175. data/vendor/assets/src/index.html +31 -38
  176. data/vendor/assets/src/index_opal.html +42 -0
  177. data/vendor/assets/src/index_server.html +43 -0
  178. data/vendor/assets/src/index_server_wasm.html +46 -0
  179. data/vendor/assets/src/js/atome/atome.js +170 -150
  180. data/vendor/assets/src/js/atome/atome_helpers/add_font.js +46 -0
  181. data/vendor/assets/src/js/atome/atome_helpers/atome_drag.js +3 -1
  182. data/vendor/assets/src/js/atome/atome_helpers/atome_events.js +12 -7
  183. data/vendor/assets/src/js/atome/atome_helpers/communication.js +126 -0
  184. data/vendor/assets/src/js/atome/atome_helpers/{atome_file.js → file.js} +1 -1
  185. data/vendor/assets/src/js/atome/specific/opal.js +3 -0
  186. data/vendor/assets/src/js/atome/specific/wasm.js +12 -0
  187. data/vendor/assets/src/js/third_parties/browser.script.iife.min.js +13 -0
  188. data/vendor/assets/src/js/third_parties/fabric.min.js +1 -1
  189. data/vendor/assets/src/js/third_parties/html-to-image.min.js +2 -0
  190. data/vendor/assets/src/js/third_parties/jsencrypt.min.js +2 -0
  191. data/vendor/assets/src/js/third_parties/papaparse.min.js +7 -0
  192. data/vendor/assets/src/medias/fonts/Roboto/LICENSE.txt +202 -0
  193. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Black.ttf +0 -0
  194. data/vendor/assets/src/medias/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
  195. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Bold.ttf +0 -0
  196. data/vendor/assets/src/medias/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
  197. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Italic.ttf +0 -0
  198. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Light.ttf +0 -0
  199. data/vendor/assets/src/medias/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
  200. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Medium.ttf +0 -0
  201. data/vendor/assets/src/medias/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  202. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Regular.ttf +0 -0
  203. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Thin.ttf +0 -0
  204. data/vendor/assets/src/medias/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
  205. data/vendor/assets/src/medias/images/logos/Facebook.svg +1 -1
  206. data/vendor/assets/src/medias/images/logos/LinkedIn-full.svg +109 -0
  207. data/vendor/assets/src/medias/images/logos/LinkedIn.svg +11 -0
  208. data/vendor/assets/src/medias/images/logos/X.svg +5 -0
  209. data/vendor/assets/src-tauri/Cargo.toml +1 -1
  210. data/vendor/assets/src-tauri/src/main.rs +59 -5
  211. data/vendor/assets/src-tauri/tauri.conf.json +1 -1
  212. data/vendor/assets/src-wasm/wasm/wasi-vfs-osx_arm +0 -0
  213. data/vendor/assets/src-wasm/wasm/wasi-vfs-osx_x86 +0 -0
  214. data/vendor/assets/src-wasm/wasm/wasi-vfs-unix +0 -0
  215. data/vendor/assets/src-wasm/wasm/wasi-vfs.exe +0 -0
  216. metadata +188 -180
  217. data/lib/atome/extensions/mathematic.rb +0 -20
  218. data/lib/atome/extensions/matrix.rb +0 -346
  219. data/lib/atome/helpers/callbacks.rb +0 -133
  220. data/lib/atome/kernel/batch.rb +0 -26
  221. data/lib/atome/kernel/essentials.rb +0 -23
  222. data/lib/atome/renderers/browser/atome.rb +0 -177
  223. data/lib/atome/renderers/browser/browser.rb +0 -47
  224. data/lib/atome/renderers/browser/effect.rb +0 -23
  225. data/lib/atome/renderers/browser/event.rb +0 -96
  226. data/lib/atome/renderers/browser/geometry.rb +0 -27
  227. data/lib/atome/renderers/browser/helpers/animation_helper.rb +0 -69
  228. data/lib/atome/renderers/browser/helpers/browser_helper.rb +0 -101
  229. data/lib/atome/renderers/browser/helpers/color_helper.rb +0 -95
  230. data/lib/atome/renderers/browser/helpers/drag_helper.rb +0 -52
  231. data/lib/atome/renderers/browser/helpers/drop_helper.rb +0 -13
  232. data/lib/atome/renderers/browser/helpers/effect_helper.rb +0 -23
  233. data/lib/atome/renderers/browser/helpers/event_helper.rb +0 -76
  234. data/lib/atome/renderers/browser/helpers/image_helper.rb +0 -27
  235. data/lib/atome/renderers/browser/helpers/over_helper.rb +0 -13
  236. data/lib/atome/renderers/browser/helpers/shadow_helper.rb +0 -74
  237. data/lib/atome/renderers/browser/helpers/shape_helper.rb +0 -22
  238. data/lib/atome/renderers/browser/helpers/text_helper.rb +0 -38
  239. data/lib/atome/renderers/browser/helpers/video_helper.rb +0 -50
  240. data/lib/atome/renderers/browser/helpers/web_helper.rb +0 -26
  241. data/lib/atome/renderers/browser/identity.rb +0 -61
  242. data/lib/atome/renderers/browser/material.rb +0 -121
  243. data/lib/atome/renderers/browser/opal_add_on.rb +0 -32
  244. data/lib/atome/renderers/browser/opal_browser.rb +0 -6
  245. data/lib/atome/renderers/browser/spatial.rb +0 -59
  246. data/lib/atome/renderers/browser/time.rb +0 -3
  247. data/lib/atome/renderers/browser/utility.rb +0 -49
  248. data/lib/atome/renderers/headless/headless.rb +0 -10
  249. data/lib/atome/renderers/headless/utility.rb +0 -6
  250. data/lib/atome/renderers/html/atome.rb +0 -49
  251. data/lib/atome/renderers/html/effect.rb +0 -19
  252. data/lib/atome/renderers/html/event.rb +0 -9
  253. data/lib/atome/renderers/html/geometry.rb +0 -11
  254. data/lib/atome/renderers/html/html.rb +0 -42
  255. data/lib/atome/renderers/html/identity.rb +0 -14
  256. data/lib/atome/renderers/html/opal_browser.rb +0 -6
  257. data/lib/atome/renderers/html/spatial.rb +0 -28
  258. data/lib/atome/renderers/html/utility.rb +0 -17
  259. data/lib/atome/renderers/opal/extensions/atome.rb +0 -29
  260. data/lib/atome/renderers/opal/extensions/ping.rb +0 -18
  261. data/lib/atome/renderers/renderer.rb +0 -15
  262. data/lib/atome/renderers/server/server.rb +0 -10
  263. data/lib/atome/renderers/server/utility.rb +0 -6
  264. data/vendor/assets/aui.rb +0 -5
  265. data/vendor/assets/r&d/misc.rb +0 -219
  266. data/vendor/assets/r&d/ping.rb +0 -3
  267. data/vendor/assets/r&d/storage.rb +0 -9
  268. data/vendor/assets/r&d/view_example.rb +0 -21
  269. data/vendor/assets/src/js/atome/atome_helpers/atome_communication.js +0 -40
  270. data/vendor/assets/src/medias/javascripts/test.js +0 -1
  271. data/vendor/assets/src/medias/rubies/demos.rb +0 -63
  272. data/vendor/assets/src/medias/rubies/examples/add.rb +0 -24
  273. data/vendor/assets/src/medias/rubies/examples/animation.rb +0 -81
  274. data/vendor/assets/src/medias/rubies/examples/atome_new.rb +0 -27
  275. data/vendor/assets/src/medias/rubies/examples/attach.rb +0 -15
  276. data/vendor/assets/src/medias/rubies/examples/attached.rb +0 -15
  277. data/vendor/assets/src/medias/rubies/examples/auto_height.rb +0 -5
  278. data/vendor/assets/src/medias/rubies/examples/auto_width.rb +0 -4
  279. data/vendor/assets/src/medias/rubies/examples/batch.rb +0 -17
  280. data/vendor/assets/src/medias/rubies/examples/blur.rb +0 -4
  281. data/vendor/assets/src/medias/rubies/examples/bottom.rb +0 -3
  282. data/vendor/assets/src/medias/rubies/examples/box.rb +0 -20
  283. data/vendor/assets/src/medias/rubies/examples/center.rb +0 -21
  284. data/vendor/assets/src/medias/rubies/examples/circle.rb +0 -3
  285. data/vendor/assets/src/medias/rubies/examples/class.rb +0 -13
  286. data/vendor/assets/src/medias/rubies/examples/clear.rb +0 -10
  287. data/vendor/assets/src/medias/rubies/examples/clone.rb +0 -35
  288. data/vendor/assets/src/medias/rubies/examples/code.rb +0 -11
  289. data/vendor/assets/src/medias/rubies/examples/color.rb +0 -73
  290. data/vendor/assets/src/medias/rubies/examples/create_atome_in_atome.rb +0 -13
  291. data/vendor/assets/src/medias/rubies/examples/cursor.rb +0 -7
  292. data/vendor/assets/src/medias/rubies/examples/delete.rb +0 -42
  293. data/vendor/assets/src/medias/rubies/examples/depth.rb +0 -6
  294. data/vendor/assets/src/medias/rubies/examples/detached.rb +0 -13
  295. data/vendor/assets/src/medias/rubies/examples/drag.rb +0 -98
  296. data/vendor/assets/src/medias/rubies/examples/drop.rb +0 -26
  297. data/vendor/assets/src/medias/rubies/examples/edit.rb +0 -12
  298. data/vendor/assets/src/medias/rubies/examples/element.rb +0 -6
  299. data/vendor/assets/src/medias/rubies/examples/empty_atome.rb +0 -12
  300. data/vendor/assets/src/medias/rubies/examples/fullscreen.rb +0 -15
  301. data/vendor/assets/src/medias/rubies/examples/grab.rb +0 -5
  302. data/vendor/assets/src/medias/rubies/examples/height.rb +0 -7
  303. data/vendor/assets/src/medias/rubies/examples/hide.rb +0 -7
  304. data/vendor/assets/src/medias/rubies/examples/id.rb +0 -14
  305. data/vendor/assets/src/medias/rubies/examples/image.rb +0 -8
  306. data/vendor/assets/src/medias/rubies/examples/left.rb +0 -7
  307. data/vendor/assets/src/medias/rubies/examples/link.rb +0 -22
  308. data/vendor/assets/src/medias/rubies/examples/markers.rb +0 -48
  309. data/vendor/assets/src/medias/rubies/examples/materials.rb +0 -15
  310. data/vendor/assets/src/medias/rubies/examples/matrix.rb +0 -102
  311. data/vendor/assets/src/medias/rubies/examples/matrix_changes.rb +0 -483
  312. data/vendor/assets/src/medias/rubies/examples/matrix_simple.rb +0 -32
  313. data/vendor/assets/src/medias/rubies/examples/monitoring.rb +0 -70
  314. data/vendor/assets/src/medias/rubies/examples/mute.rb +0 -22
  315. data/vendor/assets/src/medias/rubies/examples/on.rb +0 -26
  316. data/vendor/assets/src/medias/rubies/examples/opacity.rb +0 -5
  317. data/vendor/assets/src/medias/rubies/examples/over.rb +0 -21
  318. data/vendor/assets/src/medias/rubies/examples/pause.rb +0 -15
  319. data/vendor/assets/src/medias/rubies/examples/physical.rb +0 -19
  320. data/vendor/assets/src/medias/rubies/examples/play.rb +0 -15
  321. data/vendor/assets/src/medias/rubies/examples/read.rb +0 -11
  322. data/vendor/assets/src/medias/rubies/examples/refresh.rb +0 -8
  323. data/vendor/assets/src/medias/rubies/examples/remove.rb +0 -16
  324. data/vendor/assets/src/medias/rubies/examples/repeat.rb +0 -6
  325. data/vendor/assets/src/medias/rubies/examples/right.rb +0 -3
  326. data/vendor/assets/src/medias/rubies/examples/rotate.rb +0 -4
  327. data/vendor/assets/src/medias/rubies/examples/schedule.rb +0 -13
  328. data/vendor/assets/src/medias/rubies/examples/shadow.rb +0 -84
  329. data/vendor/assets/src/medias/rubies/examples/size.rb +0 -8
  330. data/vendor/assets/src/medias/rubies/examples/sort.rb +0 -18
  331. data/vendor/assets/src/medias/rubies/examples/style.rb +0 -4
  332. data/vendor/assets/src/medias/rubies/examples/tags.rb +0 -10
  333. data/vendor/assets/src/medias/rubies/examples/text.rb +0 -39
  334. data/vendor/assets/src/medias/rubies/examples/time.rb +0 -18
  335. data/vendor/assets/src/medias/rubies/examples/to_px.rb +0 -10
  336. data/vendor/assets/src/medias/rubies/examples/touch.rb +0 -56
  337. data/vendor/assets/src/medias/rubies/examples/vector.rb +0 -39
  338. data/vendor/assets/src/medias/rubies/examples/video.rb +0 -65
  339. data/vendor/assets/src/medias/rubies/examples/wait.rb +0 -8
  340. data/vendor/assets/src/medias/rubies/examples/web.rb +0 -13
  341. data/vendor/assets/src/medias/rubies/examples/width.rb +0 -6
  342. data/vendor/assets/src/medias/rubies/test.rb +0 -1
  343. data/vendor/assets/src/medias/rubies/text_read.rb +0 -1
  344. data/vendor/assets/src/medias/rubies/unstable/!run.rb +0 -16
  345. data/vendor/assets/src/medias/rubies/unstable/_2_solve.rb +0 -72
  346. data/vendor/assets/src/medias/rubies/unstable/_attach.rb +0 -12
  347. data/vendor/assets/src/medias/rubies/unstable/_audio.rb +0 -231
  348. data/vendor/assets/src/medias/rubies/unstable/_dataset.rb +0 -257
  349. data/vendor/assets/src/medias/rubies/unstable/_matrix.rb +0 -58
  350. data/vendor/assets/src/medias/rubies/unstable/_os.rb +0 -29
  351. data/vendor/assets/src/medias/rubies/unstable/_table2.rb +0 -108
  352. data/vendor/assets/src/medias/rubies/unstable/_vie.rb +0 -211
  353. data/vendor/assets/src/medias/rubies/users/code.rb +0 -6
  354. /data/lib/{atome/renderers → platform_specific}/opal/opal.rb +0 -0
  355. /data/lib/{atome/renderers → platform_specific}/opal/opal_parser.rb +0 -0
  356. /data/{vendor/assets/src/utilities/mode.rb → lib/renderers/html/communication.rb} +0 -0
  357. /data/{vendor/assets/src/medias/rubies/unstable/_test.rb → lib/renderers/html/security.rb} +0 -0
@@ -0,0 +1,78 @@
1
+ # # frozen_string_literal: true
2
+
3
+ class Atome
4
+ class << self
5
+ def monitoring(atomes_to_monitor, particles_to_monitor, &bloc)
6
+ atomes_to_monitor.each do |atome_to_monitor|
7
+ particles_to_monitor.each do |monitored_particle|
8
+ # storing original method
9
+ original_method = atome_to_monitor.method(monitored_particle)
10
+ # redefine the method
11
+ atome_to_monitor.define_singleton_method(monitored_particle) do |*args, &proc|
12
+ # monitoring bloc before calling original method
13
+ value_before = atome_to_monitor.instance_variable_get("@#{monitored_particle}")
14
+ if args.empty?
15
+ # args = nil
16
+ else
17
+ if monitored_particle == :touch
18
+ # instance_variable_set("@#{monitored_particle}", { tap: args[0] })
19
+ # instance_variable_set("@#{monitored_particle}_code", { touch: proc })
20
+ # args = { tap: args[0] }
21
+ elsif monitored_particle == :apply
22
+ # alert monitored_particle
23
+
24
+ else
25
+ instance_variable_set("@#{monitored_particle}", args[0])
26
+ args = args[0]
27
+ end
28
+
29
+ end
30
+
31
+ if value_before != args # we check if the value ahs changed prior bloc call
32
+ instance_exec({ original: value_before, altered: args, particle: monitored_particle }, &bloc) if bloc.is_a?(Proc)
33
+ original_method.call(*args)
34
+ end
35
+
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ c = circle({ id: :the_circle, left: 12, top: 0, color: :orange, drag: { move: true, inertia: true, lock: :start } })
44
+ b = box({ top: 123, drag: true })
45
+
46
+ # #######################
47
+ atomes_monitored = [b]
48
+ # particles_monitored=[:left, :width, :touch, :apply]
49
+ particles_monitored = [:left, :touch, :apply]
50
+ Atome.monitoring(atomes_monitored, particles_monitored) do |monitor_infos|
51
+ puts monitor_infos
52
+ # atomes_monitored.each do |atome_to_update|
53
+ # puts "updating : #{atome_to_update.instance_variable_get('@left')}"
54
+ # # puts "updating : #{atome_to_update.left}"
55
+ # # we exclude the current changing atome to avoid infinite loop
56
+ # # unless atome_to_update == self || (monitor_infos[:original] == monitor_infos[:altered]) || !monitor_infos[:altered]
57
+ # # atome_to_update.send(monitor_infos[:particle], monitor_infos[:altered])
58
+ # # end
59
+ # end
60
+ end
61
+
62
+ # verif
63
+ b.resize(true) do
64
+
65
+ end
66
+ c.resize(true) do
67
+ end
68
+
69
+ b.touch(true) do
70
+ puts :touched!
71
+ end
72
+ c.touch(:down) do
73
+ puts :touchy
74
+ end
75
+ color({ blue: 1, id: :big_col })
76
+ wait 2 do
77
+ b.apply(:big_col)
78
+ end
@@ -0,0 +1,93 @@
1
+ # frozen_string_literal: true
2
+
3
+ b = box()
4
+ b.text('click me')
5
+
6
+ b.touch(true) do
7
+ c = grab(:view).circle({id: :circling, left: 222, color: :orange, blur: 6 })
8
+ c.box({id: :boxing,color: :orange, width: 33, height: 33, left: 123})
9
+ c.box({id: :boxy,color: :red, width: 33, height: 33, left: 333})
10
+ c.text('tap here')
11
+ wait 0.5 do
12
+ c.delete(:left)
13
+ wait 0.5 do
14
+ c.delete(:blur)
15
+ end
16
+ end
17
+
18
+ c.touch(true) do
19
+ c.delete({ recursive: true })
20
+ end
21
+ end
22
+
23
+ ############
24
+ # b = box({left: 333, id: :the_box_1})
25
+ # b.color({id: :the_orange_col, red: 1, blue: 0.5})
26
+ # b.circle({top: 66, id: :the_circle_1, color: :yellow})
27
+ #
28
+ # b.shape({id: :tutu})
29
+ # b.shape({id: :toto}) #######
30
+ # b.circle({id: :invisible}) ######
31
+ #
32
+ # wait 1 do
33
+ # b.delete(:left)
34
+ # end
35
+ # #
36
+ # wait 3 do
37
+ #
38
+ # b.shape.each do |attached_atome_id|
39
+ # attached_atome_id.left(333)
40
+ # wait 2 do
41
+ # attached_atome_id.delete(true)
42
+ # end
43
+ # end
44
+ #
45
+ # end
46
+ # #
47
+ # #
48
+ # wait 4 do
49
+ # b.delete(:color)
50
+ # end
51
+
52
+ # ################## end tests ##################
53
+ #
54
+ # # recursive example
55
+ # bb=box({id: :the_parent_box})
56
+ # bb.text({id: :text_0, data: 'test'})
57
+ # bb.text({id: :text_1, data: 'poil'})
58
+ # bb.color({id: :the_colo, red: 1})
59
+ # col=color({ id: :col_1, red: 1, green: 0.5 })
60
+ #
61
+ # # alert "before creation : #{bb}"
62
+ # bb.touch(true) do
63
+ # bb.box({attached: col.id, id: :attached_box})
64
+ # c=bb.circle(({ id: :circle_1 }))
65
+ # c.text({id: :text_1, data: :hello})
66
+ # bb.text(:good)
67
+ # # alert "after creation : #{bb}"
68
+ # wait 1 do
69
+ # bb.physical.each do |attached_atome_id|
70
+ # bb.delete({id: attached_atome_id, recursive: true})
71
+ # end
72
+ #
73
+ # # wait 1 do
74
+ # # alert "1 sec after deletion : #{bb}"
75
+ # # end
76
+ # end
77
+ # end
78
+
79
+ # ########################
80
+ # puts Universe.atomes
81
+ # puts Universe.user_atomes
82
+ # puts Universe.system_atomes
83
+
84
+ # physical_found=["text_0","attached_box","circle_1","attached_box","circle_1"]
85
+ # clean_physical=physical_found.uniq
86
+ # alert clean_physical
87
+
88
+ # b=box(drag: true)
89
+ # c=circle
90
+ # # c.attach(b.id)
91
+ # b.attach(c.id)
92
+ # alert b
93
+ # alert c
@@ -0,0 +1,279 @@
1
+ # # frozen_string_literal: true
2
+ #
3
+ # new({ particle: :display, render: false }) do |params|
4
+ # # alert type
5
+ # unless params[:items]
6
+ # params[:items] = { width: 200, height: 33 }
7
+ # end
8
+ # container_width = params[:width] ||= width
9
+ # container_height = params[:heigth] ||= height
10
+ # container_top = params[:top] ||= top
11
+ # container_left = params[:left] ||= left
12
+ #
13
+ # item_width = params[:items][:width] ||= 400
14
+ # item_height = params[:items][:height] ||= 50
15
+ # item_margin = params[:margin] ||= 3
16
+ #
17
+ # mode = params[:mode]
18
+ #
19
+ # case mode
20
+ # when :none
21
+ # when :custom
22
+ # when :list
23
+ # if params[:data].instance_of? Array
24
+ # elsif params[:data] == :particles
25
+ # list_id = "#{id}_list"
26
+ # unless grab(list_id)
27
+ # container = ''
28
+ # attach.each do |parent|
29
+ # container = grab(parent).box({ id: list_id, left: container_left, top: container_top, width: container_width, height: container_height, overflow: :auto, color: :black, depth: 0 })
30
+ # container.on(:resize) do |event|
31
+ # puts event[:dx]
32
+ # end
33
+ # container.resize({ min: { width: 100, height: 100 }, max: { width: 300, height: 700 } }) do |event|
34
+ # puts event
35
+ # end
36
+ #
37
+ # end
38
+ # sorted_particles = particles.sort.to_h
39
+ # sorted_particles.each_with_index do |(particle_found, value), index|
40
+ # line = container.box({ id: "#{list_id}_#{index}", width: item_width, height: item_height, left: 0, top: ((item_height + item_margin) * index) })
41
+ # line.text({ data: "#{particle_found} : ", top: -item_height / 2, left: 2 })
42
+ # if value.instance_of?(String) || value.instance_of?(Symbol) || value.instance_of?(Integer)
43
+ # input_value = line.text({ data: value, top: -item_height / 2, left: 5, edit: true })
44
+ # input_value.keyboard(:down) do |native_event|
45
+ # event = Native(native_event)
46
+ # if event[:keyCode].to_i == 13
47
+ # event.preventDefault()
48
+ # input_value.color(:red)
49
+ # end
50
+ # end
51
+ # input_value.keyboard(:up) do |native_event|
52
+ # data_found = input_value.data
53
+ # send(particle_found, data_found)
54
+ # end
55
+ # else
56
+ # puts "value is :#{value.class} => #{value}"
57
+ # end
58
+ # end
59
+ # closer = container.circle({ id: "#{list_id}_closer", width: 33, height: 33, top: 3, right: 3, color: :red, position: :sticky })
60
+ # closer.touch(true) do
61
+ # container.delete(true)
62
+ # end
63
+ # end
64
+ # else
65
+ # end
66
+ # when :grid
67
+ # grid_id = "#{id}_grid"
68
+ # unless grab(grid_id)
69
+ # container = grab(:view).box({ id: grid_id, width: container_width, height: container_height, overflow: :auto, color: :white, depth: 0 })
70
+ # ############## deletion
71
+ # container.touch(true) do
72
+ # alert "removing container recursively : #{container.id}"
73
+ # val_1= Universe.atomes.length
74
+ # puts "val_1 : #{val_1}"
75
+ # container.delete({ recursive: true })
76
+ # val_2= Universe.atomes.length
77
+ # puts "val_2 : #{val_2}"
78
+ # puts "val_1-val_2 : #{val_1-val_2}"
79
+ # end
80
+ # ############## deletion
81
+ # params[:data].each_with_index do |item, index|
82
+ # # unless grab("#{grid_id}_#{index}")
83
+ # item = container.box({ id: "#{grid_id}_#{index}", top: 0, position: :relative, left: nil, right: nil })
84
+ # # item.touch(true) do
85
+ # # alert "removing container recursively : #{container.id}"
86
+ # # val_1= Universe.atomes.length
87
+ # # puts "val_1 : #{val_1}"
88
+ # # container.delete({ recursive: true })
89
+ # # val_2= Universe.atomes.length
90
+ # # puts "val_2 : #{val_2}"
91
+ # # puts "val_1-val_2 : #{val_1-val_2}"
92
+ # # end
93
+ # # end
94
+ # end
95
+ # # container.html.style('gridTemplateColumns', '1fr 1fr 1fr 1fr 1fr 1fr')
96
+ # container.html.style('gridTemplateColumns', 'repeat(4, 1fr)')
97
+ # container.html.style('gridTemplateRows', 'auto')
98
+ # container.html.style('gridGap', '10px')
99
+ # container.html.style('display', 'grid')
100
+ # container.on(:resize) do |event|
101
+ # puts event[:dx]
102
+ # end
103
+ # container.resize({ min: { width: 10, height: 10 }, max: { width: 300, height: 700 } }) do |event|
104
+ # puts event
105
+ # end
106
+ # end
107
+ # end
108
+ # end
109
+ # new({ particle: :visible })
110
+ # new({ renderer: :html, method: :visible }) do |params|
111
+ # if params == false
112
+ # params = :none
113
+ # elsif params == true
114
+ # params = :block
115
+ # end
116
+ # html.visible(params)
117
+ # end
118
+ # new({ particle: :position }) do
119
+ # end
120
+ # new({ method: :position, type: :integer, renderer: :html }) do |params|
121
+ # html.style(:position, params)
122
+ # end
123
+ #
124
+ # b = box({ color: :red })
125
+ #
126
+ # b.touch(true) do
127
+ # # b.display({ mode: :list, data: :particles, width: 333, items: { width: 200, height: 33 }, height: 33, margin: 5 })
128
+ # b.display({ mode: :list, data: :particles, items: { width: 200, height: 33 }, height: 33, margin: 5 })
129
+ # end
130
+ # ############## Builder #############
131
+ # c = circle({ left: 333 })
132
+ # fake_array = []
133
+ # i = 0
134
+ # while i < 32 do
135
+ # fake_array << i
136
+ # i += 1
137
+ # end
138
+ # c.touch(true) do
139
+ # c.display({ mode: :grid, data: fake_array,width: 333, height: 333 })
140
+ # end
141
+ # ############# Generator #############
142
+ # gen = generator({ id: :genesis, build: { top: 66, copies: 1 } })
143
+ # gen.build({ id: :bundler, copies: 32, tag: { group: :to_grid }, color: :red, width: 33, height: 44, left: 123, smooth: 9, blur: 3, attach: [:view] })
144
+ # grab(:bundler_1).color(:blue)
145
+ #
146
+ # color({ id: :the_orange, red: 1, green: 0.4 })
147
+ #
148
+ # atome_to_grid = tagged({ group: :to_grid })
149
+ # the_group = group({ collected: atome_to_grid })
150
+ #
151
+ # the_group.touch(true) do |i|
152
+ # color(:green)
153
+ # end
154
+ # # wait 0.3 do
155
+ # the_group.left(633)
156
+ # wait 1 do
157
+ # grab(:view).display({ mode: :grid, data: fake_array })
158
+ # end
159
+ # #
160
+ #
161
+ #
162
+ #
163
+ #
164
+
165
+
166
+ #############
167
+ new({ atome: :generator }) do |params|
168
+ # we remove build and store it in a temporary particle as it has to be added after atome creation
169
+ build = params.delete(:build)
170
+ params[:temporary] = { build: build }
171
+ end
172
+ new({ post: :generator }) do |params|
173
+ build_plans = params[:temporary][:build]
174
+ # alert build_plans
175
+ # grab(params[:id]).build(build_plans)
176
+ end
177
+
178
+ new ({ particle: :build, store: false }) do |params|
179
+ # we get the id or generate it for the new builder
180
+ if params[:id]
181
+ byild_id = params[:id]
182
+ else
183
+ byild_id = "auto_build_#{Universe.atomes.length}"
184
+ params[:id] = byild_id
185
+ end
186
+ # now we create a hash if it doesnt already exist
187
+ # if it exist we feed the hash
188
+ if build
189
+ build[byild_id] = params
190
+ else
191
+ #
192
+ build_hash = { byild_id => params }
193
+ store({ 'build': build_hash })
194
+ end
195
+ #
196
+ # now we'll created the wanted atomes
197
+ # here are the default params
198
+ default_styles = { type: :shape, renderers: [:html], width: 66, height: 66, color: :gray, left: 12, top: 12, copies: 0, attach: [:view] }
199
+ params = default_styles.merge(params)
200
+ color_found = color(params[:color])
201
+ left_pos = params[:left]
202
+ top_pos = params[:top]
203
+ atomes({}) unless atomes
204
+
205
+ params[:id] = identity_generator(params[:type]) unless params[:id]
206
+ atomes[params[:id]] = []
207
+
208
+ params[:copies].downto(0) do |index|
209
+ item_number = params[:copies] - index
210
+ bundle_id = if params[:id]
211
+ "#{params[:id]}_#{item_number}"
212
+ else
213
+ "#{params[:id]}_#{item_number}"
214
+ end
215
+ copied_items_params = params.dup
216
+ copied_items_params[:id] = bundle_id
217
+ # alert copied_items_params
218
+ copy = Atome.new(copied_items_params)
219
+ copy.attach(copied_items_params[:attach])
220
+ copy.apply([color_found.id])
221
+ copy.left(((copy.width + left_pos) * item_number) + left_pos)
222
+ copy.top(((copy.height + top_pos) * item_number) + top_pos)
223
+ atomes[params[:id]] << bundle_id
224
+ end
225
+ end
226
+
227
+
228
+ def duplicate(ids)
229
+ ids.each do |id_passed|
230
+
231
+ atome_passed=grab(id_passed)
232
+ # atome_passed.particles.delete(:left)
233
+ # we remove attached
234
+ particle_to_remove=[:id, :broadcast, :history,:callback, :html_object, :store_allow,:attached]
235
+ particles_found=atome_passed.particles.dup
236
+ particles_found.delete_if { |key, value| particle_to_remove.include?(key) }
237
+ particles_found[:id]=identity_generator(particles_found[:type])
238
+ collected_particles={}
239
+ particles_found.each do |particle_found, value_found|
240
+ collected_particles[particle_found]=value_found
241
+ end
242
+ ordered_keys = [:renderers, :id, :type, :attach]
243
+ ordered_particles = ordered_keys.map { |k| [k, collected_particles[k]] }.to_h
244
+
245
+ other_part = collected_particles.reject { |k, _| ordered_keys.include?(k) }
246
+ # merge the parts to obtain an re-ordered hash
247
+ ordered_particles = ordered_particles.merge(other_part)
248
+
249
+ # alert ordered_particles
250
+ nw_atome= Atome.new(ordered_particles)
251
+
252
+ wait 2 do
253
+ nw_atome.left(333)
254
+ end
255
+ # Atome.new({"renderers"=>["html"], "id"=>nil, "type"=>"shape", "attach"=>["view"], "tag"=>{}, "attached"=>["text_15"], "unit"=>{}, "collected"=>{}, "width"=>99, "height"=>99, "apply"=>["box_color"], "left"=>100, "top"=>100, "clones"=>[], "preset"=>{"box"=>{"width"=>99, "height"=>99, "apply"=>["box_color"], "left"=>100, "top"=>100, "clones"=>[]}}, "touch"=>{"tap"=>true}, "touch_code"=>{"touch"=>:jhjh}})
256
+ # Atome.new({"renderers"=>["html"], "id"=>:jgjhg, "type"=>"shape", "attach"=>["view"], "tag"=>{}, "attached"=>["text_15"], "unit"=>{}, "collected"=>{}, "width"=>99, "height"=>99, "apply"=>["box_color"], "left"=>100, "top"=>100, "clones"=>[], "preset"=>{"box"=>{"width"=>99, "height"=>99, "apply"=>["box_color"], "left"=>100, "top"=>100, "clones"=>[]}}, "touch"=>{"tap"=>true}, "touch_code"=>{"touch"=>:jhjh}})
257
+ end
258
+ end
259
+
260
+ b=box
261
+ c=b.circle
262
+ c.text(:hello)
263
+ b.touch(true) do
264
+ puts @id
265
+ end
266
+ b.clones([{ left: 300, top: 300, color: :blue, entangled: [:width, :attached, :height] },
267
+ { left: 600, top: 366, color: :green, entangled: [:left, :height] }])
268
+
269
+ # duplicate([b.id])
270
+
271
+
272
+ # Atome.new( { renderers: [:html], attach: [:view],id: :my_test_box, type: :shape, apply: [:shape_color],
273
+ # left: 120, top: 0, width: 100, smooth: 15, height: 100, overflow: :visible, attached: [], center: true
274
+ # })
275
+ # model={shape}
276
+
277
+ gen = generator({ id: :genesis, build: {top: 66, copies: 1} })
278
+ # gen.build({ id: :bundler, copies: 32, color: :red, width: 33, height: 44, left: 123, smooth: 9, blur: 3, attach: [:view] })
279
+ # grab(:bundler_1).color(:blue)
@@ -0,0 +1,164 @@
1
+ # frozen_string_literal: true
2
+
3
+
4
+ new({ particle: :display, render: false }) do |params|
5
+ # alert type
6
+ unless params[:items]
7
+ params[:items] = { width: 200, height: 33 }
8
+ end
9
+ container_width = params[:width] ||= width
10
+ container_height = params[:heigth] ||= height
11
+ container_top = params[:top] ||= top
12
+ container_left = params[:left] ||= left
13
+
14
+ item_width = params[:items][:width] ||= 400
15
+ item_height = params[:items][:height] ||= 50
16
+ item_margin = params[:margin] ||= 3
17
+
18
+ mode = params[:mode]
19
+
20
+ case mode
21
+ when :none
22
+ when :custom
23
+ when :list
24
+ if params[:data].instance_of? Array
25
+ elsif params[:data] == :particles
26
+ list_id = "#{id}_list"
27
+ unless grab(list_id)
28
+ container = ''
29
+ attach.each do |parent|
30
+ container = grab(parent).box({ id: list_id, left: container_left, top: container_top, width: container_width, height: container_height, overflow: :auto, color: :black, depth: 0 })
31
+ container.on(:resize) do |event|
32
+ puts event[:dx]
33
+ end
34
+ container.resize({ min: { width: 100, height: 100 }, max: { width: 300, height: 700 } }) do |event|
35
+ puts event
36
+ end
37
+
38
+ end
39
+ sorted_particles = particles.sort.to_h
40
+ sorted_particles.each_with_index do |(particle_found, value), index|
41
+ line = container.box({ id: "#{list_id}_#{index}", width: item_width, height: item_height, left: 0, top: ((item_height + item_margin) * index) })
42
+ line.text({ data: "#{particle_found} : ", top: -item_height / 2, left: 2 })
43
+ if value.instance_of?(String) || value.instance_of?(Symbol) || value.instance_of?(Integer)
44
+ input_value = line.text({ data: value, top: -item_height / 2, left: 5, edit: true })
45
+ input_value.keyboard(:down) do |native_event|
46
+ event = Native(native_event)
47
+ if event[:keyCode].to_i == 13
48
+ event.preventDefault()
49
+ input_value.color(:red)
50
+ end
51
+ end
52
+ input_value.keyboard(:up) do |native_event|
53
+ data_found = input_value.data
54
+ send(particle_found, data_found)
55
+ end
56
+ else
57
+ puts "value is :#{value.class} => #{value}"
58
+ end
59
+ end
60
+ closer = container.circle({ id: "#{list_id}_closer", width: 33, height: 33, top: 3, right: 3, color: :red, position: :sticky })
61
+ closer.touch(true) do
62
+ container.delete(true)
63
+ end
64
+ end
65
+ else
66
+ end
67
+ when :grid
68
+ grid_id = "#{id}_grid"
69
+ unless grab(grid_id)
70
+ container = grab(:view).box({ id: grid_id, width: container_width, height: container_height, overflow: :auto, color: :white, depth: 0 })
71
+ ############## deletion
72
+ container.touch(true) do
73
+ alert "removing container recursively : #{container.id}"
74
+ val_1= Universe.atomes.length
75
+ puts "val_1 : #{val_1}"
76
+ container.delete({ recursive: true })
77
+ val_2= Universe.atomes.length
78
+ puts "val_2 : #{val_2}"
79
+ puts "val_1-val_2 : #{val_1-val_2}"
80
+ end
81
+ ############## deletion
82
+ params[:data].each_with_index do |item, index|
83
+ # unless grab("#{grid_id}_#{index}")
84
+ item = container.box({ id: "#{grid_id}_#{index}", top: 0, position: :relative, left: nil, right: nil })
85
+ # item.touch(true) do
86
+ # alert "removing container recursively : #{container.id}"
87
+ # val_1= Universe.atomes.length
88
+ # puts "val_1 : #{val_1}"
89
+ # container.delete({ recursive: true })
90
+ # val_2= Universe.atomes.length
91
+ # puts "val_2 : #{val_2}"
92
+ # puts "val_1-val_2 : #{val_1-val_2}"
93
+ # end
94
+ # end
95
+ end
96
+ # container.html.style('gridTemplateColumns', '1fr 1fr 1fr 1fr 1fr 1fr')
97
+ container.html.style('gridTemplateColumns', 'repeat(4, 1fr)')
98
+ container.html.style('gridTemplateRows', 'auto')
99
+ container.html.style('gridGap', '10px')
100
+ container.html.style('display', 'grid')
101
+ container.on(:resize) do |event|
102
+ puts event[:dx]
103
+ end
104
+ container.resize({ min: { width: 10, height: 10 }, max: { width: 300, height: 700 } }) do |event|
105
+ puts event
106
+ end
107
+ end
108
+ end
109
+ end
110
+ new({ particle: :visible })
111
+ new({ renderer: :html, method: :visible }) do |params|
112
+ if params == false
113
+ params = :none
114
+ elsif params == true
115
+ params = :block
116
+ end
117
+ html.visible(params)
118
+ end
119
+ new({ particle: :position }) do
120
+ end
121
+ new({ method: :position, type: :integer, renderer: :html }) do |params|
122
+ html.style(:position, params)
123
+ end
124
+
125
+ b = box({ color: :red })
126
+
127
+ b.touch(true) do
128
+ # b.display({ mode: :list, data: :particles, width: 333, items: { width: 200, height: 33 }, height: 33, margin: 5 })
129
+ b.display({ mode: :list, data: :particles, items: { width: 200, height: 33 }, height: 33, margin: 5 })
130
+ end
131
+ ############## Builder #############
132
+ c = circle({ left: 333 })
133
+ fake_array = []
134
+ i = 0
135
+ while i < 32 do
136
+ fake_array << i
137
+ i += 1
138
+ end
139
+ c.touch(true) do
140
+ c.display({ mode: :grid, data: fake_array,width: 333, height: 333 })
141
+ end
142
+ ############## Generator #############
143
+ gen = generator({ id: :genesis, build: { top: 66, copies: 1 } })
144
+ gen.build({ id: :bundler, copies: 32, tag: { group: :to_grid }, color: :red, width: 33, height: 44, left: 123, smooth: 9, blur: 3, attach: [:view] })
145
+ grab(:bundler_1).color(:blue)
146
+
147
+ color({ id: :the_orange, red: 1, green: 0.4 })
148
+
149
+ atome_to_grid = tagged({ group: :to_grid })
150
+ the_group = group({ collected: atome_to_grid })
151
+
152
+ the_group.touch(true) do |i|
153
+ color(:green)
154
+ end
155
+ # wait 0.3 do
156
+ the_group.left(633)
157
+ wait 1 do
158
+ grab(:view).display({ mode: :grid, data: fake_array })
159
+ end
160
+
161
+
162
+
163
+
164
+
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+ a=box({width: 666, height: 777, color: :orange})
3
+ b = box({ left: 666, color: :blue, smooth: 6, id: :the_box2, depth: 1 })
4
+ cc=circle({color: :red, left: 0, top: 0})
5
+ clone = ""
6
+ b.drag(:start) do
7
+ b.color(:black)
8
+ b.height(123)
9
+ # beware you must use grab(:view) else it'll be attached to the context, that means to 'b' in this case
10
+ clone = grab(:view).circle({ id: "#{b.id}_cloned",color: :white, left: b.left, top: b.top, depth: 3 })
11
+ end
12
+
13
+ b.drag(:stop) do
14
+ b.color(:purple)
15
+ b.height=b.height+100
16
+ clone.delete(true)
17
+ end
18
+
19
+
20
+
21
+ b.drag(:locked) do |event|
22
+ dx = event[:dx]
23
+ dy = event[:dy]
24
+ x = (clone.left || 0) + dx.to_f
25
+ y = (clone.top || 0) + dy.to_f
26
+ clone.left(x)
27
+ clone.top(y)
28
+ puts "x: #{x}"
29
+ puts "y: #{y}"
30
+ end
31
+ cc.drag({ restrict: {max:{ left: 240, top: 190}} }) do |event|
32
+
33
+ end
34
+
35
+
36
+ c=circle
37
+
38
+ c.drag({ restrict: a.id }) do |event|
39
+
40
+ end
41
+
42
+ t=text({data: 'touch me to unbind drag stop for b (clone will not deleted anymore)', left: 250 })
43
+ t.touch(true) do
44
+ b.drag({remove: :stop})
45
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+
4
+
5
+ dragged = box({ left: 33,top: 333, width: 333,color: :orange, smooth: 6, id: :drop_zone })
6
+
7
+ dragged.drop(true) do |event|
8
+ grab(event[:destination]).color(:white)
9
+ grab(event[:source]).color(:black)
10
+ end
11
+
12
+ dragged.drop(:enter) do |event|
13
+ grab(event[:destination]).color(:red)
14
+ end
15
+
16
+ dragged.drop(:leave) do |event|
17
+ grab(event[:destination]).color(:gray)
18
+ end
19
+
20
+ dragged.drop(:activate) do |event|
21
+ grab(event[:destination]).color(:yellow)
22
+ grab(event[:source]).color(:cyan)
23
+ end
24
+
25
+
26
+ dragged.drop(:deactivate) do |event|
27
+ grab(event[:destination]).color(:orange)
28
+ end
29
+ box({ left: 333, color: :blue,top: 222, smooth: 6, id: :the_box, drag: true })
30
+
31
+ t=text({data: 'touch me to unbind drop enter'})
32
+ t.touch(true) do
33
+ dragged.drop({ remove: :enter })
34
+ end
35
+