atome 0.5.4.1.7 → 0.5.5.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/Gemfile +3 -1
- data/README.md +70 -1
- data/Rakefile +246 -75
- data/app_builder_helpers/Rakefile +276 -288
- data/documentation/basic.md +242 -0
- data/documentation/deep learning/architecture.txt +3763 -0
- data/documentation/deep learning/atome.png +0 -0
- data/documentation/deep learning/basic_infos.txt +227 -0
- data/documentation/deep learning/example_of_users_code.rb +1810 -0
- data/documentation/deep learning/misc.txt +24 -0
- data/documentation/deep learning/ruby_js_example.rb +272 -0
- data/documentation/deep learning/wasm_script_help.text +14 -0
- data/documentation/framework/enhance_atome.md +1 -1
- data/documentation/tutorials/tutorials.md +7 -0
- data/exe/atome +308 -208
- data/lib/atome/atome.rb +52 -156
- data/lib/atome/extensions/atome.rb +129 -47
- data/lib/atome/extensions/mathematics.rb +20 -0
- data/lib/atome/extensions/ping.rb +2 -3
- data/lib/atome/genesis/generators/atome.rb +57 -30
- data/lib/atome/genesis/generators/communication.rb +9 -0
- data/lib/atome/genesis/generators/effect.rb +0 -1
- data/lib/atome/genesis/generators/event.rb +279 -43
- data/lib/atome/genesis/generators/geometry.rb +1 -10
- data/lib/atome/genesis/generators/hierarchy.rb +103 -0
- data/lib/atome/genesis/generators/identity.rb +45 -84
- data/lib/atome/genesis/generators/material.rb +31 -34
- data/lib/atome/genesis/generators/property.rb +31 -0
- data/lib/atome/genesis/generators/security.rb +31 -0
- data/lib/atome/genesis/generators/spatial.rb +3 -5
- data/lib/atome/genesis/generators/time.rb +0 -1
- data/lib/atome/genesis/generators/utility.rb +181 -66
- data/lib/atome/genesis/genesis.rb +152 -55
- data/lib/atome/genesis/sparkle.rb +59 -75
- data/lib/atome/helpers/color_helper/color/rgb/colors.rb +1 -1
- data/lib/atome/helpers/color_helper/color/rgb.rb +1 -1
- data/lib/atome/helpers/color_helper/color.rb +226 -7
- data/lib/atome/helpers/essentials.rb +22 -26
- data/lib/atome/helpers/security.rb +71 -0
- data/lib/atome/helpers/utilities.rb +191 -178
- data/lib/atome/kernel/black_matter.rb +22 -0
- data/lib/atome/kernel/universe.rb +123 -24
- data/lib/atome/presets/atome.rb +39 -35
- data/lib/atome/version.rb +3 -2
- data/lib/atome.rb +12 -12
- data/lib/atome_relative.rb +36 -0
- data/lib/{atome/renderers → platform_specific}/opal/atome_opal_extensions.rb +4 -1
- data/lib/{atome/renderers → platform_specific}/opal/extensions/color.rb +12 -5
- data/lib/{atome/renderers → platform_specific}/opal/extensions/geolocation.rb +1 -0
- data/lib/platform_specific/opal/extensions/js.rb +21 -0
- data/lib/platform_specific/opal/extensions/object.rb +6 -0
- data/lib/platform_specific/opal/extensions/ping.rb +31 -0
- data/lib/{atome/renderers → platform_specific}/opal/extensions/sha.rb +4 -2
- data/lib/platform_specific/wasm/atome_wasm_extensions.rb +11 -0
- data/lib/renderers/headless/headless.rb +18 -0
- data/lib/renderers/headless/index.rb +6 -0
- data/lib/renderers/headless/index_relative.rb +6 -0
- data/lib/renderers/headless/utility.rb +6 -0
- data/{vendor/assets/src/medias/rubies/examples/top.rb → lib/renderers/html/atome.rb} +0 -1
- data/lib/renderers/html/atome_html.rb +22 -0
- data/lib/renderers/html/effect.rb +26 -0
- data/lib/renderers/html/event.rb +43 -0
- data/lib/renderers/html/geometry.rb +31 -0
- data/lib/renderers/html/hierarchy.rb +233 -0
- data/lib/renderers/html/html.rb +1112 -0
- data/lib/renderers/html/identity.rb +84 -0
- data/lib/renderers/html/index.rb +19 -0
- data/lib/renderers/html/index_relative.rb +20 -0
- data/lib/renderers/html/material.rb +53 -0
- data/lib/renderers/html/property.rb +24 -0
- data/lib/renderers/html/spatial.rb +46 -0
- data/lib/renderers/html/time.rb +1 -0
- data/lib/renderers/html/utility.rb +38 -0
- data/lib/renderers/renderer.rb +16 -0
- data/lib/renderers/server/index.rb +4 -0
- data/lib/renderers/server/index_relative.rb +4 -0
- data/lib/renderers/server/utility.rb +4 -0
- data/sig/atome.rbs +6 -0
- data/sig/object.rbs +4 -0
- data/sig/universe.rbs +3 -0
- data/vendor/assets/Rakefile +3 -3
- data/vendor/assets/application/examples/a_concat.rb +16 -0
- data/vendor/assets/application/examples/affect.rb +8 -0
- data/vendor/assets/application/examples/animation.rb +96 -0
- data/vendor/assets/application/examples/apply.rb +8 -0
- data/vendor/assets/application/examples/atome.rb +5 -0
- data/vendor/assets/application/examples/attach.rb +34 -0
- data/vendor/assets/application/examples/attached.rb +38 -0
- data/vendor/assets/application/examples/basic_understanding.rb +52 -0
- data/vendor/assets/application/examples/browse.rb +17 -0
- data/vendor/assets/application/examples/callback.rb +20 -0
- data/vendor/assets/application/examples/category.rb +12 -0
- data/vendor/assets/application/examples/clear.rb +96 -0
- data/vendor/assets/application/examples/clones.rb +177 -0
- data/vendor/assets/application/examples/code.rb +13 -0
- data/vendor/assets/application/examples/color.rb +54 -0
- data/vendor/assets/application/examples/convert.rb +163 -0
- data/vendor/assets/application/examples/copy.rb +25 -0
- data/vendor/assets/application/examples/copybck.rb +68 -0
- data/vendor/assets/application/examples/debug.rb +78 -0
- data/vendor/assets/application/examples/delete.rb +93 -0
- data/vendor/assets/application/examples/display.rb +279 -0
- data/vendor/assets/application/examples/display_bck.rb +164 -0
- data/vendor/assets/application/examples/drag.rb +45 -0
- data/vendor/assets/application/examples/drop.rb +35 -0
- data/vendor/assets/application/examples/duplicate.rb +64 -0
- data/vendor/assets/application/examples/edit.rb +21 -0
- data/vendor/assets/application/examples/encode.rb +6 -0
- data/vendor/assets/application/examples/file.rb +50 -0
- data/vendor/assets/application/examples/find.rb +157 -0
- data/vendor/assets/application/examples/generator_and_build.rb +15 -0
- data/vendor/assets/application/examples/getter.rb +16 -0
- data/vendor/assets/application/examples/grab.rb +14 -0
- data/vendor/assets/application/examples/gradient.rb +35 -0
- data/vendor/assets/application/examples/group.rb +44 -0
- data/vendor/assets/application/examples/hierarchy.rb +21 -0
- data/vendor/assets/application/examples/history.rb +31 -0
- data/vendor/assets/application/examples/hypertext.rb +113 -0
- data/vendor/assets/application/examples/image.rb +5 -0
- data/vendor/assets/application/examples/keyboard.rb +59 -0
- data/vendor/assets/application/examples/layout.rb +227 -0
- data/vendor/assets/application/examples/login.rb +10 -0
- data/vendor/assets/application/examples/markup.rb +4 -0
- data/vendor/assets/application/examples/match.rb +115 -0
- data/vendor/assets/application/examples/messaging.rb +16 -0
- data/vendor/assets/application/examples/monitor.rb +14 -0
- data/vendor/assets/application/examples/on_resize.rb +7 -0
- data/vendor/assets/{src/medias/rubies/examples/get_renderer_list.rb → application/examples/online.rb} +1 -1
- data/vendor/assets/application/examples/over.rb +29 -0
- data/vendor/assets/application/examples/paint.rb +23 -0
- data/vendor/assets/application/examples/particles.rb +4 -0
- data/vendor/assets/application/examples/percent_to_px.rb +4 -0
- data/vendor/assets/application/examples/play.rb +50 -0
- data/vendor/assets/application/examples/presets.rb +33 -0
- data/vendor/assets/application/examples/random.rb +42 -0
- data/vendor/assets/application/examples/raw_html.rb +48 -0
- data/vendor/assets/application/examples/read.rb +11 -0
- data/vendor/assets/application/examples/refresh.rb +62 -0
- data/vendor/assets/application/examples/remove.rb +47 -0
- data/vendor/assets/application/examples/repeat.rb +26 -0
- data/vendor/assets/application/examples/resize.rb +17 -0
- data/vendor/assets/application/examples/scroll.rb +11 -0
- data/vendor/assets/application/examples/security.rb +76 -0
- data/vendor/assets/application/examples/selected.rb +30 -0
- data/vendor/assets/application/examples/shadow.rb +46 -0
- data/vendor/assets/application/examples/shapes.rb +6 -0
- data/vendor/assets/{src/medias/rubies → application}/examples/smooth.rb +5 -1
- data/vendor/assets/application/examples/style.rb +4 -0
- data/vendor/assets/application/examples/sync.rb +39 -0
- data/vendor/assets/application/examples/tagged.rb +24 -0
- data/vendor/assets/application/examples/terminal.rb +4 -0
- data/vendor/assets/application/examples/text.rb +5 -0
- data/vendor/assets/application/examples/touch.rb +38 -0
- data/vendor/assets/application/examples/type_mutation.rb +18 -0
- data/vendor/assets/application/examples/universe.rb +8 -0
- data/vendor/assets/application/examples/vector.rb +24 -0
- data/vendor/assets/application/examples/video.rb +14 -0
- data/vendor/assets/application/examples/wait.rb +6 -0
- data/vendor/assets/application/examples/www.rb +10 -0
- data/vendor/assets/application/index.rb +1 -1
- data/vendor/assets/application/test.rb +29 -0
- data/vendor/assets/application/works/photos.rb +672 -0
- data/vendor/assets/application/works/photos2.rb +218 -0
- data/vendor/assets/application/works/photos3.rb +343 -0
- data/vendor/assets/application/works/photos4.rb +34 -0
- data/vendor/assets/application/works/photos6.rb +6 -0
- data/vendor/assets/application/works/trigga.rb +0 -0
- data/vendor/assets/application/works/vie.rb +74 -0
- data/vendor/assets/server/atome_server.rb +37 -41
- data/vendor/assets/server/atome_server_wasm.rb +112 -0
- data/vendor/assets/server/capture.rb +10 -0
- data/vendor/assets/server/config.ru +5 -4
- data/vendor/assets/src/css/style.css +29 -4
- data/vendor/assets/src/index.html +31 -38
- data/vendor/assets/src/index_opal.html +42 -0
- data/vendor/assets/src/index_server.html +43 -0
- data/vendor/assets/src/index_server_wasm.html +46 -0
- data/vendor/assets/src/js/atome/atome.js +170 -150
- data/vendor/assets/src/js/atome/atome_helpers/add_font.js +46 -0
- data/vendor/assets/src/js/atome/atome_helpers/atome_drag.js +3 -1
- data/vendor/assets/src/js/atome/atome_helpers/atome_events.js +12 -7
- data/vendor/assets/src/js/atome/atome_helpers/communication.js +126 -0
- data/vendor/assets/src/js/atome/atome_helpers/{atome_file.js → file.js} +1 -1
- data/vendor/assets/src/js/atome/specific/opal.js +3 -0
- data/vendor/assets/src/js/atome/specific/wasm.js +12 -0
- data/vendor/assets/src/js/third_parties/browser.script.iife.min.js +13 -0
- data/vendor/assets/src/js/third_parties/fabric.min.js +1 -1
- data/vendor/assets/src/js/third_parties/html-to-image.min.js +2 -0
- data/vendor/assets/src/js/third_parties/jsencrypt.min.js +2 -0
- data/vendor/assets/src/js/third_parties/papaparse.min.js +7 -0
- data/vendor/assets/src/medias/fonts/Roboto/LICENSE.txt +202 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Black.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Bold.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Italic.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Light.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Medium.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Regular.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-Thin.ttf +0 -0
- data/vendor/assets/src/medias/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
- data/vendor/assets/src/medias/images/logos/Facebook.svg +1 -1
- data/vendor/assets/src/medias/images/logos/LinkedIn-full.svg +109 -0
- data/vendor/assets/src/medias/images/logos/LinkedIn.svg +11 -0
- data/vendor/assets/src/medias/images/logos/X.svg +5 -0
- data/vendor/assets/src-tauri/Cargo.toml +1 -1
- data/vendor/assets/src-tauri/src/main.rs +59 -5
- data/vendor/assets/src-tauri/tauri.conf.json +1 -1
- data/vendor/assets/src-wasm/wasm/wasi-vfs-osx_arm +0 -0
- data/vendor/assets/src-wasm/wasm/wasi-vfs-osx_x86 +0 -0
- data/vendor/assets/src-wasm/wasm/wasi-vfs-unix +0 -0
- data/vendor/assets/src-wasm/wasm/wasi-vfs.exe +0 -0
- metadata +188 -180
- data/lib/atome/extensions/mathematic.rb +0 -20
- data/lib/atome/extensions/matrix.rb +0 -346
- data/lib/atome/helpers/callbacks.rb +0 -133
- data/lib/atome/kernel/batch.rb +0 -26
- data/lib/atome/kernel/essentials.rb +0 -23
- data/lib/atome/renderers/browser/atome.rb +0 -158
- data/lib/atome/renderers/browser/browser.rb +0 -47
- data/lib/atome/renderers/browser/effect.rb +0 -23
- data/lib/atome/renderers/browser/event.rb +0 -96
- data/lib/atome/renderers/browser/geometry.rb +0 -27
- data/lib/atome/renderers/browser/helpers/animation_helper.rb +0 -69
- data/lib/atome/renderers/browser/helpers/browser_helper.rb +0 -101
- data/lib/atome/renderers/browser/helpers/color_helper.rb +0 -80
- data/lib/atome/renderers/browser/helpers/drag_helper.rb +0 -52
- data/lib/atome/renderers/browser/helpers/drop_helper.rb +0 -13
- data/lib/atome/renderers/browser/helpers/effect_helper.rb +0 -23
- data/lib/atome/renderers/browser/helpers/event_helper.rb +0 -76
- data/lib/atome/renderers/browser/helpers/image_helper.rb +0 -27
- data/lib/atome/renderers/browser/helpers/over_helper.rb +0 -13
- data/lib/atome/renderers/browser/helpers/shadow_helper.rb +0 -74
- data/lib/atome/renderers/browser/helpers/shape_helper.rb +0 -22
- data/lib/atome/renderers/browser/helpers/text_helper.rb +0 -38
- data/lib/atome/renderers/browser/helpers/video_helper.rb +0 -50
- data/lib/atome/renderers/browser/helpers/web_helper.rb +0 -26
- data/lib/atome/renderers/browser/identity.rb +0 -61
- data/lib/atome/renderers/browser/material.rb +0 -121
- data/lib/atome/renderers/browser/opal_add_on.rb +0 -31
- data/lib/atome/renderers/browser/opal_browser.rb +0 -6
- data/lib/atome/renderers/browser/spatial.rb +0 -59
- data/lib/atome/renderers/browser/time.rb +0 -3
- data/lib/atome/renderers/browser/utility.rb +0 -49
- data/lib/atome/renderers/headless/headless.rb +0 -10
- data/lib/atome/renderers/headless/utility.rb +0 -6
- data/lib/atome/renderers/html/atome.rb +0 -49
- data/lib/atome/renderers/html/effect.rb +0 -19
- data/lib/atome/renderers/html/event.rb +0 -9
- data/lib/atome/renderers/html/geometry.rb +0 -11
- data/lib/atome/renderers/html/html.rb +0 -42
- data/lib/atome/renderers/html/identity.rb +0 -14
- data/lib/atome/renderers/html/opal_browser.rb +0 -6
- data/lib/atome/renderers/html/spatial.rb +0 -28
- data/lib/atome/renderers/html/utility.rb +0 -17
- data/lib/atome/renderers/opal/extensions/atome.rb +0 -29
- data/lib/atome/renderers/opal/extensions/ping.rb +0 -18
- data/lib/atome/renderers/renderer.rb +0 -15
- data/lib/atome/renderers/server/server.rb +0 -10
- data/lib/atome/renderers/server/utility.rb +0 -6
- data/vendor/assets/aui.rb +0 -5
- data/vendor/assets/r&d/misc.rb +0 -219
- data/vendor/assets/r&d/ping.rb +0 -3
- data/vendor/assets/r&d/storage.rb +0 -9
- data/vendor/assets/r&d/view_example.rb +0 -21
- data/vendor/assets/src/js/atome/atome_helpers/atome_communication.js +0 -40
- data/vendor/assets/src/medias/javascripts/test.js +0 -1
- data/vendor/assets/src/medias/rubies/demos.rb +0 -63
- data/vendor/assets/src/medias/rubies/examples/add.rb +0 -24
- data/vendor/assets/src/medias/rubies/examples/animation.rb +0 -81
- data/vendor/assets/src/medias/rubies/examples/atome_new.rb +0 -27
- data/vendor/assets/src/medias/rubies/examples/attach.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/attached.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/auto_height.rb +0 -5
- data/vendor/assets/src/medias/rubies/examples/auto_width.rb +0 -4
- data/vendor/assets/src/medias/rubies/examples/batch.rb +0 -17
- data/vendor/assets/src/medias/rubies/examples/blur.rb +0 -4
- data/vendor/assets/src/medias/rubies/examples/bottom.rb +0 -3
- data/vendor/assets/src/medias/rubies/examples/box.rb +0 -20
- data/vendor/assets/src/medias/rubies/examples/center.rb +0 -21
- data/vendor/assets/src/medias/rubies/examples/circle.rb +0 -3
- data/vendor/assets/src/medias/rubies/examples/class.rb +0 -13
- data/vendor/assets/src/medias/rubies/examples/clear.rb +0 -10
- data/vendor/assets/src/medias/rubies/examples/clone.rb +0 -35
- data/vendor/assets/src/medias/rubies/examples/code.rb +0 -11
- data/vendor/assets/src/medias/rubies/examples/color.rb +0 -73
- data/vendor/assets/src/medias/rubies/examples/create_atome_in_atome.rb +0 -13
- data/vendor/assets/src/medias/rubies/examples/cursor.rb +0 -7
- data/vendor/assets/src/medias/rubies/examples/delete.rb +0 -42
- data/vendor/assets/src/medias/rubies/examples/depth.rb +0 -6
- data/vendor/assets/src/medias/rubies/examples/detached.rb +0 -13
- data/vendor/assets/src/medias/rubies/examples/drag.rb +0 -98
- data/vendor/assets/src/medias/rubies/examples/drop.rb +0 -26
- data/vendor/assets/src/medias/rubies/examples/edit.rb +0 -12
- data/vendor/assets/src/medias/rubies/examples/element.rb +0 -6
- data/vendor/assets/src/medias/rubies/examples/empty_atome.rb +0 -12
- data/vendor/assets/src/medias/rubies/examples/fullscreen.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/grab.rb +0 -5
- data/vendor/assets/src/medias/rubies/examples/height.rb +0 -7
- data/vendor/assets/src/medias/rubies/examples/hide.rb +0 -7
- data/vendor/assets/src/medias/rubies/examples/id.rb +0 -14
- data/vendor/assets/src/medias/rubies/examples/image.rb +0 -8
- data/vendor/assets/src/medias/rubies/examples/left.rb +0 -7
- data/vendor/assets/src/medias/rubies/examples/link.rb +0 -22
- data/vendor/assets/src/medias/rubies/examples/markers.rb +0 -48
- data/vendor/assets/src/medias/rubies/examples/materials.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/matrix.rb +0 -102
- data/vendor/assets/src/medias/rubies/examples/matrix_changes.rb +0 -483
- data/vendor/assets/src/medias/rubies/examples/matrix_simple.rb +0 -32
- data/vendor/assets/src/medias/rubies/examples/monitoring.rb +0 -70
- data/vendor/assets/src/medias/rubies/examples/mute.rb +0 -22
- data/vendor/assets/src/medias/rubies/examples/on.rb +0 -26
- data/vendor/assets/src/medias/rubies/examples/opacity.rb +0 -5
- data/vendor/assets/src/medias/rubies/examples/over.rb +0 -21
- data/vendor/assets/src/medias/rubies/examples/pause.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/physical.rb +0 -19
- data/vendor/assets/src/medias/rubies/examples/play.rb +0 -15
- data/vendor/assets/src/medias/rubies/examples/read.rb +0 -11
- data/vendor/assets/src/medias/rubies/examples/refresh.rb +0 -8
- data/vendor/assets/src/medias/rubies/examples/remove.rb +0 -16
- data/vendor/assets/src/medias/rubies/examples/repeat.rb +0 -6
- data/vendor/assets/src/medias/rubies/examples/right.rb +0 -3
- data/vendor/assets/src/medias/rubies/examples/rotate.rb +0 -4
- data/vendor/assets/src/medias/rubies/examples/schedule.rb +0 -13
- data/vendor/assets/src/medias/rubies/examples/shadow.rb +0 -84
- data/vendor/assets/src/medias/rubies/examples/size.rb +0 -8
- data/vendor/assets/src/medias/rubies/examples/sort.rb +0 -18
- data/vendor/assets/src/medias/rubies/examples/style.rb +0 -4
- data/vendor/assets/src/medias/rubies/examples/tags.rb +0 -10
- data/vendor/assets/src/medias/rubies/examples/text.rb +0 -39
- data/vendor/assets/src/medias/rubies/examples/time.rb +0 -18
- data/vendor/assets/src/medias/rubies/examples/to_px.rb +0 -10
- data/vendor/assets/src/medias/rubies/examples/touch.rb +0 -56
- data/vendor/assets/src/medias/rubies/examples/vector.rb +0 -39
- data/vendor/assets/src/medias/rubies/examples/video.rb +0 -65
- data/vendor/assets/src/medias/rubies/examples/wait.rb +0 -8
- data/vendor/assets/src/medias/rubies/examples/web.rb +0 -13
- data/vendor/assets/src/medias/rubies/examples/width.rb +0 -6
- data/vendor/assets/src/medias/rubies/test.rb +0 -1
- data/vendor/assets/src/medias/rubies/text_read.rb +0 -1
- data/vendor/assets/src/medias/rubies/unstable/!run.rb +0 -16
- data/vendor/assets/src/medias/rubies/unstable/_2_solve.rb +0 -72
- data/vendor/assets/src/medias/rubies/unstable/_attach.rb +0 -12
- data/vendor/assets/src/medias/rubies/unstable/_audio.rb +0 -231
- data/vendor/assets/src/medias/rubies/unstable/_dataset.rb +0 -257
- data/vendor/assets/src/medias/rubies/unstable/_matrix.rb +0 -58
- data/vendor/assets/src/medias/rubies/unstable/_os.rb +0 -29
- data/vendor/assets/src/medias/rubies/unstable/_table2.rb +0 -108
- data/vendor/assets/src/medias/rubies/unstable/_vie.rb +0 -211
- data/vendor/assets/src/medias/rubies/users/code.rb +0 -6
- /data/lib/{atome/renderers → platform_specific}/opal/opal.rb +0 -0
- /data/lib/{atome/renderers → platform_specific}/opal/opal_parser.rb +0 -0
- /data/{vendor/assets/src/utilities/mode.rb → lib/renderers/html/communication.rb} +0 -0
- /data/{vendor/assets/src/medias/rubies/unstable/_test.rb → lib/renderers/html/security.rb} +0 -0
@@ -1,16 +0,0 @@
|
|
1
|
-
def run_demo
|
2
|
-
scripts = %i[animation atome.new auto_height auto_width bottom box circle
|
3
|
-
color create_atome_in_atome drag get_renderer_list grab height image
|
4
|
-
left link parent read repeat right rotate schedule smooth text
|
5
|
-
top touch video wait web width]
|
6
|
-
|
7
|
-
scripts.each_with_index do |toto, index|
|
8
|
-
wait 1 * index do
|
9
|
-
puts toto
|
10
|
-
read("examples/#{toto}.rb", :ruby)
|
11
|
-
# `console.clear()`
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
run_demo
|
@@ -1,72 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Text in object
|
4
|
-
a=Atome.new(code: { type: :code, renderers: [:headless], attach: [], children: [] }) do |params_found|
|
5
|
-
puts "the param is #{params_found}"
|
6
|
-
end
|
7
|
-
a.run(:super)
|
8
|
-
c=element do |params_found|
|
9
|
-
puts "you want me to print: #{params_found}"
|
10
|
-
text({ data: :hello })
|
11
|
-
end
|
12
|
-
|
13
|
-
c.run('it works')
|
14
|
-
|
15
|
-
###### SOLVED ##### : object in object
|
16
|
-
|
17
|
-
# a = box({ width: 333, height: 333, id: :the_boxy })
|
18
|
-
# a.color(:red)
|
19
|
-
# b = a.box({ width: 33, height: 33, id: :the_box, drag: true })
|
20
|
-
# b.color(:black)
|
21
|
-
#
|
22
|
-
# # color doesn't work
|
23
|
-
# circle({ id: :circle_123, color: :cyan, left: 233 })
|
24
|
-
|
25
|
-
|
26
|
-
###### SOLVED ##### : big performance problem plus params as left is not interpreted
|
27
|
-
|
28
|
-
# i = 0
|
29
|
-
# while i < 16
|
30
|
-
# b = box({ width: 33, height: 33 })
|
31
|
-
# b.color(:red)
|
32
|
-
# b.left((33 + 10) * i)
|
33
|
-
# i += 1
|
34
|
-
# # b.drag(true)
|
35
|
-
# end
|
36
|
-
|
37
|
-
|
38
|
-
###### SOLVED ##### : .color (return the color itself instead of the box ) and .red return itself too so it's impossible to set green and blue
|
39
|
-
# another problem : when setting .red it reset the whole color object and remove green an blue components
|
40
|
-
# box({id: :mybox})
|
41
|
-
# grab(:my_box).smooth(6).color(:black).red(0.6).green(0.6).blue(0.6)
|
42
|
-
|
43
|
-
|
44
|
-
# color can't be changed easily
|
45
|
-
|
46
|
-
b=box
|
47
|
-
b.color.red(1)
|
48
|
-
|
49
|
-
# ###### SOLVED ##### : box in box doesn't work( incorrect node tree error)
|
50
|
-
# b=box({id: :mybox, width: 666, height: 555})
|
51
|
-
#
|
52
|
-
# b.box()
|
53
|
-
|
54
|
-
# ###### SOLVED ##### atome i, atome using preset doesn't work
|
55
|
-
#
|
56
|
-
# b=box
|
57
|
-
# c=b.box
|
58
|
-
# c.left(200)
|
59
|
-
|
60
|
-
|
61
|
-
# Children doesn't work
|
62
|
-
box({ id: :the_box })
|
63
|
-
circle({ top: 300, id: :circle098 })
|
64
|
-
|
65
|
-
t = text({ data: :hello })
|
66
|
-
t.children[:the_box, :circle098]
|
67
|
-
|
68
|
-
|
69
|
-
# if id change then we can't add color
|
70
|
-
b=box
|
71
|
-
b.id(:new_id)
|
72
|
-
b.color(:blue)
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
|
4
|
-
# removed because it has conflict with children / parents
|
5
|
-
# # TODO : debug the attach method it color the view by default
|
6
|
-
# # box({id: :my_box})
|
7
|
-
# # c=color(:red)
|
8
|
-
# # grab(:view).color(:black)
|
9
|
-
# # c.attach([:my_box])
|
10
|
-
#
|
11
|
-
# box({id: :my_box})
|
12
|
-
# color({red: 1, blue: 1, attach: [:my_box]})
|
@@ -1,231 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
generator = Genesis.generator
|
4
|
-
|
5
|
-
generator.build_atome(:audio) do |p|
|
6
|
-
puts p
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
generator.build_render(:browser_audio) do |_value, _user_proc|
|
11
|
-
@browser_type = :div
|
12
|
-
id_found = @atome[:id]
|
13
|
-
DOM do
|
14
|
-
audio({ id: id_found, autoplay: false, loop: false, muted: false }).atome
|
15
|
-
end.append_to(BrowserHelper.browser_document[:user_view])
|
16
|
-
@browser_object = BrowserHelper.browser_document[id_found]
|
17
|
-
|
18
|
-
|
19
|
-
# `
|
20
|
-
# var helloWorld = new Wad({
|
21
|
-
# source: './medias/audios/Binrpilot.mp3',
|
22
|
-
#
|
23
|
-
# // add a key for each sprite
|
24
|
-
# sprite: {
|
25
|
-
# hello : [0, .4], // the start and end time, in seconds
|
26
|
-
# world : [.4,1]
|
27
|
-
# }
|
28
|
-
# });
|
29
|
-
# `
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
generator.build_sanitizer(:audio) do |params|
|
36
|
-
parent_found = found_parents_and_renderers[:parent]
|
37
|
-
render_found = found_parents_and_renderers[:renderers]
|
38
|
-
default_params = { renderers: render_found, id: "audio_#{Universe.atomes.length}", type: :audio,
|
39
|
-
attach: parent_found }
|
40
|
-
default_params.merge!(params)
|
41
|
-
end
|
42
|
-
|
43
|
-
module BrowserHelper
|
44
|
-
def self.browser_path_audio(value, browser_object, _atome)
|
45
|
-
browser_object[:src] = value
|
46
|
-
end
|
47
|
-
|
48
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
box({ id: :mybox })
|
52
|
-
|
53
|
-
my_audio = audio({ path: 'medias/audios/Binrpilot.mp3', id: :audio3 }) do |params|
|
54
|
-
puts "3 - audio callback here #{params}, id is : #{id}"
|
55
|
-
end
|
56
|
-
|
57
|
-
# my_audio.clips[{begin: 4, end: 6}]
|
58
|
-
alert Universe.atome_list
|
59
|
-
|
60
|
-
|
61
|
-
# `
|
62
|
-
# function BufferLoader(context, urlList, callback) {
|
63
|
-
# this.context = context;
|
64
|
-
# this.urlList = urlList;
|
65
|
-
# this.onload = callback;
|
66
|
-
# this.bufferList = new Array();
|
67
|
-
# this.loadCount = 0;
|
68
|
-
# }
|
69
|
-
#
|
70
|
-
# BufferLoader.prototype.loadBuffer = function(url, index) {
|
71
|
-
# // Load buffer asynchronously
|
72
|
-
# var request = new XMLHttpRequest();
|
73
|
-
# request.open("GET", url, true);
|
74
|
-
# request.responseType = "arraybuffer";
|
75
|
-
#
|
76
|
-
# var loader = this;
|
77
|
-
#
|
78
|
-
# request.onload = function() {
|
79
|
-
# // Asynchronously decode the audio file data in request.response
|
80
|
-
# loader.context.decodeAudioData(
|
81
|
-
# request.response,
|
82
|
-
# function(buffer) {
|
83
|
-
# if (!buffer) {
|
84
|
-
# alert('error decoding file data: ' + url);
|
85
|
-
# return;
|
86
|
-
# }
|
87
|
-
# loader.bufferList[index] = buffer;
|
88
|
-
# if (++loader.loadCount == loader.urlList.length)
|
89
|
-
# loader.onload(loader.bufferList);
|
90
|
-
# },
|
91
|
-
# function(error) {
|
92
|
-
# console.error('decodeAudioData error', error);
|
93
|
-
# }
|
94
|
-
# );
|
95
|
-
# }
|
96
|
-
#
|
97
|
-
# request.onerror = function() {
|
98
|
-
# alert('BufferLoader: XHR error');
|
99
|
-
# }
|
100
|
-
#
|
101
|
-
# request.send();
|
102
|
-
# }
|
103
|
-
#
|
104
|
-
# BufferLoader.prototype.load = function() {
|
105
|
-
# for (var i = 0; i < this.urlList.length; ++i)
|
106
|
-
# this.loadBuffer(this.urlList[i], i);
|
107
|
-
# }
|
108
|
-
#
|
109
|
-
#
|
110
|
-
# window.onload = init;
|
111
|
-
# var context;
|
112
|
-
# var bufferLoader;
|
113
|
-
#
|
114
|
-
# function init() {
|
115
|
-
# context = new AudioContext();
|
116
|
-
#
|
117
|
-
# bufferLoader = new BufferLoader(
|
118
|
-
# context,
|
119
|
-
# [
|
120
|
-
# 'medias/audios/snare.wav',
|
121
|
-
# 'medias/audios/cowbell.wav',
|
122
|
-
# ],
|
123
|
-
# finishedLoading
|
124
|
-
# );
|
125
|
-
#
|
126
|
-
# bufferLoader.load();
|
127
|
-
# }
|
128
|
-
#
|
129
|
-
# function finishedLoading(bufferList) {
|
130
|
-
# // Create two sources and play them both together.
|
131
|
-
# var source1 = context.createBufferSource();
|
132
|
-
# var source2 = context.createBufferSource();
|
133
|
-
# source1.buffer = bufferList[0];
|
134
|
-
# source2.buffer = bufferList[1];
|
135
|
-
#
|
136
|
-
# source1.connect(context.destination);
|
137
|
-
# source2.connect(context.destination);
|
138
|
-
# source1.noteOn(0);
|
139
|
-
# source2.noteOn(0);
|
140
|
-
# }
|
141
|
-
# `
|
142
|
-
#
|
143
|
-
#
|
144
|
-
#########################################
|
145
|
-
# `
|
146
|
-
# const el = document.getElementById("mybox")
|
147
|
-
# function modifyText(){
|
148
|
-
# var audio = new Audio('medias/audios/snare.wav');
|
149
|
-
# audio.play(2);
|
150
|
-
# }
|
151
|
-
# el.addEventListener("mousedown", modifyText, false);
|
152
|
-
# `
|
153
|
-
# b=box({left: 160})
|
154
|
-
# b2=box({left: 333})
|
155
|
-
# b.touch(:down) do
|
156
|
-
# `
|
157
|
-
# var audio = new Audio('medias/audios/Binrpilot.mp3');
|
158
|
-
# audio.currentTime=12
|
159
|
-
# audio.play(2);
|
160
|
-
# console.log('ok')
|
161
|
-
# `
|
162
|
-
# end
|
163
|
-
#########################################
|
164
|
-
|
165
|
-
# b2.touch(:down) do
|
166
|
-
# # `
|
167
|
-
# # let bell= new Audio('medias/audios/snare.wav');
|
168
|
-
# #
|
169
|
-
# # `
|
170
|
-
# end
|
171
|
-
# generator = Genesis.generator
|
172
|
-
|
173
|
-
# b.touch(:double) do
|
174
|
-
# # alert :kool
|
175
|
-
# #
|
176
|
-
# `
|
177
|
-
# let bell = new Audio('medias/audios/snare.wav');
|
178
|
-
# bell.play();
|
179
|
-
# `
|
180
|
-
#
|
181
|
-
# b.color(:red)
|
182
|
-
#
|
183
|
-
# # `
|
184
|
-
# # var audio = new Audio('medias/audios/snare.wav');
|
185
|
-
# # //audio.play();
|
186
|
-
# # //let bell = new Wad({sin : audio});
|
187
|
-
# # let bell = audio
|
188
|
-
# # //bell.play();
|
189
|
-
# # //bell.stop();
|
190
|
-
# #
|
191
|
-
# # //////
|
192
|
-
# #
|
193
|
-
# # var helloWorld = new Wad({
|
194
|
-
# # // source: 'medias/audios/snare.wav',
|
195
|
-
# # var audio = new Audio('medias/audios/snare.wav'),
|
196
|
-
# # source: 'medias/audios/snare.wav',
|
197
|
-
# # // add a key for each sprite
|
198
|
-
# # sprite: {
|
199
|
-
# # hello : [0, .4], // the start and end time, in seconds
|
200
|
-
# # world : [.4,1]
|
201
|
-
# # }
|
202
|
-
# # });
|
203
|
-
# #
|
204
|
-
# # // for each key on the sprite object in the constructor above, the wad that is created will have a key of the same name, with a play() method.
|
205
|
-
# # helloWorld.hello.play();
|
206
|
-
# # helloWorld.world.play();
|
207
|
-
# #
|
208
|
-
# # // you can still play the entire clip normally, if you want.
|
209
|
-
# # helloWorld.play();
|
210
|
-
# #
|
211
|
-
# # // if you hear clicks or pops from starting and stopping playback in the middle of the clip, you can try adding some attack and release to the envelope.
|
212
|
-
# # helloWorld.hello.play({env:{attack: .1, release:.02}})
|
213
|
-
# # `
|
214
|
-
# end
|
215
|
-
# b=box
|
216
|
-
# b.touch(:down) do
|
217
|
-
# `
|
218
|
-
# Wad.audioContext
|
219
|
-
# `
|
220
|
-
# end
|
221
|
-
|
222
|
-
# `
|
223
|
-
# //let saw = new Wad({source : 'sawtooth'});
|
224
|
-
# let saw = new Wad({
|
225
|
-
# source : 'sawtooth',
|
226
|
-
# panning : [0, 1, 10],
|
227
|
-
# panningModel : 'HRTF',
|
228
|
-
# rolloffFactor : 3 // other properties of the panner node can be specified in the constructor, or on play()
|
229
|
-
# })
|
230
|
-
# saw.play();
|
231
|
-
#`
|
@@ -1,257 +0,0 @@
|
|
1
|
-
# # frozen_string_literal: true
|
2
|
-
#
|
3
|
-
# tt = text({ data: :hello, id: :the_text, drag: true })
|
4
|
-
#
|
5
|
-
# box({ id: :the_box })
|
6
|
-
# circle({ top: 300, id: :circle098 })
|
7
|
-
|
8
|
-
generator = Genesis.generator
|
9
|
-
generator.build_atome(:template)
|
10
|
-
generator.build_atome(:matrix)
|
11
|
-
|
12
|
-
class Atome
|
13
|
-
def matrix(params)
|
14
|
-
parent_found = found_parents_and_renderers[:parent]
|
15
|
-
render_found = found_parents_and_renderers[:renderers]
|
16
|
-
default_params = { renderers: render_found, id: "matrix_#{Universe.atomes.length}", type: :matrix,
|
17
|
-
attach: parent_found }
|
18
|
-
|
19
|
-
params[:renderer] = []
|
20
|
-
params[:children] = []
|
21
|
-
params[:parents] = [:view]
|
22
|
-
|
23
|
-
template_needed = params[:template]
|
24
|
-
found_margin = params[:margin] ||= 9
|
25
|
-
|
26
|
-
matrix_id = params[:id] ||= "matrix_display_nb"
|
27
|
-
matrix_width = params[:width] ||= 333
|
28
|
-
matrix_height = params[:height] ||= 333
|
29
|
-
matrix_left = params[:left ] ||= 33
|
30
|
-
matrix_top = params[:top] ||= 33
|
31
|
-
matrix_smooth = params[:smooth] ||= 3
|
32
|
-
template_grab = grab(template_needed)
|
33
|
-
# puts "template to get #{template_needed}"
|
34
|
-
matrix_color = create_matrix_colors('matrix_color_back', 0.3, 0.3, 0.6, 1)
|
35
|
-
cell_back_color = create_matrix_colors('cell_color_back', 0.333, 0.333, 0.7, 1)
|
36
|
-
matrix = create_matrix({ id: matrix_id, width: matrix_width,height: matrix_height,
|
37
|
-
left: matrix_left,top: matrix_top, smooth: matrix_smooth })
|
38
|
-
matrix_color.attach([matrix_id])
|
39
|
-
cells = create_matrix_cells(matrix_id, cell_back_color, 33, { width: 33, height: 33,
|
40
|
-
smooth: 9, shadow: { blur: 6 } })
|
41
|
-
resize_matrix({ matrix: matrix, width: matrix_width, height: matrix_height, cells: cells, columns: 3, rows: 8, margin: found_margin })
|
42
|
-
params
|
43
|
-
default_params.merge!(params)
|
44
|
-
matrix
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
generator.build_particle(:cells)
|
49
|
-
generator.build_particle(:rows)
|
50
|
-
generator.build_particle(:columns)
|
51
|
-
generator.build_sanitizer(:template) do |params|
|
52
|
-
default_params = { renderers: [], id: "template_#{Universe.atomes.length}", type: :template }
|
53
|
-
default_params.merge!(params)
|
54
|
-
end
|
55
|
-
|
56
|
-
def resize_matrix(params)
|
57
|
-
matrix = params[:matrix]
|
58
|
-
matrix_width = params[:width]
|
59
|
-
matrix_height = params[:height]
|
60
|
-
cells = params[:cells]
|
61
|
-
nb_of_cols = params[:columns]
|
62
|
-
nb_of_rows = params[:rows]
|
63
|
-
margin = params[:margin]
|
64
|
-
if matrix_width.instance_of? String
|
65
|
-
parent_found = grab(params[:matrix].parents.value.last)
|
66
|
-
parent_width= parent_found.width.to_px
|
67
|
-
matrix_width = matrix_width.sub('%', '').to_i
|
68
|
-
new_width= (parent_width* matrix_width)/100
|
69
|
-
matrix_width= new_width
|
70
|
-
end
|
71
|
-
if matrix_height.instance_of? String
|
72
|
-
parent_found = grab(params[:matrix].parents.value.last)
|
73
|
-
parent_height= parent_found.height.to_px
|
74
|
-
matrix_height = matrix_height.sub('%', '').to_i
|
75
|
-
new_height= (parent_height* matrix_height)/100
|
76
|
-
matrix_height= new_height
|
77
|
-
end
|
78
|
-
cell_width = (matrix_width / nb_of_cols) - margin
|
79
|
-
cell_height = (matrix_height / nb_of_rows) - margin
|
80
|
-
row = -1
|
81
|
-
cells.each_with_index do |cell, index|
|
82
|
-
cell.height = cell_height
|
83
|
-
cell.width = cell_width
|
84
|
-
row += 1 if index.modulo(nb_of_cols).zero?
|
85
|
-
cell.left(index % nb_of_cols * (cell_width + margin) + margin)
|
86
|
-
cell.top(row * (cell_height + margin) + margin)
|
87
|
-
end
|
88
|
-
|
89
|
-
matrix.width = matrix_width + margin
|
90
|
-
matrix.height = matrix_height + margin
|
91
|
-
end
|
92
|
-
|
93
|
-
generator.build_particle(:display) do |params|
|
94
|
-
|
95
|
-
template_needed = params[:template]
|
96
|
-
targeted_atomes = params[:elements] ||= []
|
97
|
-
# get params
|
98
|
-
sort_by = params[:sort]
|
99
|
-
found_width = params[:width]
|
100
|
-
found_height = params[:height]
|
101
|
-
found_left = params[:left]
|
102
|
-
found_right = params[:right]
|
103
|
-
found_margin = params[:margin] ||= 9
|
104
|
-
|
105
|
-
matrix(params)
|
106
|
-
|
107
|
-
# matrix_back_id = params[:id] ||= "matrix_back_display_nb"
|
108
|
-
# template_grab = grab(template_needed)
|
109
|
-
#
|
110
|
-
# puts "template to get #{template_needed}"
|
111
|
-
# matrix_back_color = create_matrix_colors('matrix_color_back', 0.3, 0.3, 0.6, 1)
|
112
|
-
# cell_back_color = create_matrix_colors('cell_color_back', 0.333, 0.333, 0.7, 1)
|
113
|
-
# matrix_back = create_matrix_back(matrix_back_id, { width: 33, smooth: 9 })
|
114
|
-
# matrix_back_color.attach([matrix_back_id])
|
115
|
-
# cells = create_matrix_cells(matrix_back_id, cell_back_color, 33, { width: 33, height: 33,
|
116
|
-
# smooth: 9, shadow: { blur: 6 } })
|
117
|
-
# resize_matrix({ matrix: matrix_back, width: 333, height: 333, cells: cells, columns: 2, rows: 8, margin: found_margin })
|
118
|
-
|
119
|
-
# We sort, clone and put the target in the matrix
|
120
|
-
# sorted = {}
|
121
|
-
# targeted_atomes.each_with_index do |atome_id, index|
|
122
|
-
# atome_found = grab(atome_id)
|
123
|
-
# clone = atome_found.clones([{ left: 33 }])
|
124
|
-
# selected_id = "#{matrix_back_id}_#{index}"
|
125
|
-
# clone.parents([selected_id])
|
126
|
-
# cell_height = grab(selected_id).height.value - 9
|
127
|
-
#
|
128
|
-
# clone.left(3)
|
129
|
-
# clone.top(3)
|
130
|
-
# clone.width(cell_height)
|
131
|
-
# clone.height(cell_height)
|
132
|
-
# sorted[atome_id] = atome_found.atome[sort_by]
|
133
|
-
#
|
134
|
-
# end
|
135
|
-
# sorted = sorted.sort_by { |_key, value| value }.to_h
|
136
|
-
# selected = params[:select] ||= []
|
137
|
-
# selected.each do |select|
|
138
|
-
# selected_id = "#{matrix_back_id}_#{select}"
|
139
|
-
# grab(selected_id).color(:red)
|
140
|
-
# end
|
141
|
-
end
|
142
|
-
|
143
|
-
def create_matrix_colors(name, red, green, blue, alpha)
|
144
|
-
Atome.new({ color: { renderers: [:browser], id: name, type: :color, attach: [], children: [],
|
145
|
-
red: red, green: green, blue: blue, alpha: alpha } })
|
146
|
-
end
|
147
|
-
|
148
|
-
def create_matrix( style)
|
149
|
-
matrix = Atome.new(
|
150
|
-
shape: { type: :shape, renderers: [:browser], id: style[:id], attach: [:view], width: 333, height: 333, left: 33,top: 33,
|
151
|
-
overflow: :hidden, children: [] }
|
152
|
-
)
|
153
|
-
matrix.style(style)
|
154
|
-
matrix
|
155
|
-
end
|
156
|
-
|
157
|
-
def create_matrix_cells(id, cell_back_color, number_of_cells, style)
|
158
|
-
counter = 0
|
159
|
-
cells = []
|
160
|
-
while counter < number_of_cells
|
161
|
-
id_generated = id + "_#{counter}"
|
162
|
-
cells << a = Atome.new(
|
163
|
-
shape: { type: :shape, renderers: [:browser], id: id_generated, attach: [id],
|
164
|
-
children: [:cell_color]
|
165
|
-
|
166
|
-
}
|
167
|
-
)
|
168
|
-
cell_back_color.attach([id_generated])
|
169
|
-
a.style(style)
|
170
|
-
counter += 1
|
171
|
-
end
|
172
|
-
|
173
|
-
cells
|
174
|
-
end
|
175
|
-
|
176
|
-
# template({ id: :child_in_table, code: [], cells: 16, columns: 4, rows: 4 })
|
177
|
-
# the_view = grab(:view)
|
178
|
-
#
|
179
|
-
# tt.display(template: :child_in_table, sort: :id, elements: [:the_box,:the_text , :circle098], select: [1, 3, 7],
|
180
|
-
# id: :my_matrix, left: 33, top: 63, width: 633, height: 333, margin: 9,
|
181
|
-
# background: {color: :red, smooth: 3}, cells: {color: :orange, smooth: 9})
|
182
|
-
#
|
183
|
-
|
184
|
-
# matrix(template: :child_in_table, sort: :id, elements: [:the_box, :circle098], select: [1, 3, 7],
|
185
|
-
# id: :my_matrix, left: 33, top: 63, width: 633, height: 333, margin: 9,
|
186
|
-
# background: {color: :red, smooth: 3}, cells: {color: :orange, smooth: 9})
|
187
|
-
# class Atome
|
188
|
-
# def matrix(params)
|
189
|
-
# alert params
|
190
|
-
# end
|
191
|
-
# end
|
192
|
-
m=matrix({width: '100%', height: '100%', left: 0, top: 0,
|
193
|
-
smooth: 12,id: :the_big_amazing_matrix})
|
194
|
-
|
195
|
-
class Atome
|
196
|
-
def row(nb)
|
197
|
-
# alert self
|
198
|
-
|
199
|
-
end
|
200
|
-
end
|
201
|
-
# alert m
|
202
|
-
# m.cell(3).color(:red)
|
203
|
-
# alert m.cell(3)
|
204
|
-
puts m.row(3)
|
205
|
-
|
206
|
-
########### table Algo
|
207
|
-
# Define the table as an array
|
208
|
-
table = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34]
|
209
|
-
|
210
|
-
# Define the number of rows and columns in the table
|
211
|
-
num_rows = 5
|
212
|
-
num_columns = 7
|
213
|
-
|
214
|
-
# Define a method to retrieve the cells in a specified row
|
215
|
-
def get_row(table, num_columns, row_index)
|
216
|
-
# Calculate the start and end indices for the row
|
217
|
-
start_index = row_index * num_columns
|
218
|
-
end_index = start_index + num_columns - 1
|
219
|
-
|
220
|
-
# Get all the cells in the row using array slicing
|
221
|
-
row = table[start_index..end_index]
|
222
|
-
|
223
|
-
# Iterate over the cells in the row and print their values
|
224
|
-
row.each do |cell|
|
225
|
-
puts cell
|
226
|
-
end
|
227
|
-
end
|
228
|
-
|
229
|
-
# Define a method to retrieve the cells in a specified column
|
230
|
-
def get_column(table, num_rows, num_columns, column_index)
|
231
|
-
# Initialize an array to hold the cells in the column
|
232
|
-
column = []
|
233
|
-
|
234
|
-
# Iterate over the rows in the table
|
235
|
-
num_rows.times do |row_index|
|
236
|
-
# Calculate the index of the cell in the column
|
237
|
-
cell_index = row_index * num_columns + column_index
|
238
|
-
|
239
|
-
# Get the cell at the calculated index
|
240
|
-
cell = table[cell_index]
|
241
|
-
|
242
|
-
# Add the cell to the column array
|
243
|
-
column << cell
|
244
|
-
end
|
245
|
-
|
246
|
-
# Iterate over the cells in the column and print their values
|
247
|
-
column.each do |cell|
|
248
|
-
puts cell
|
249
|
-
end
|
250
|
-
end
|
251
|
-
|
252
|
-
# Test the methods
|
253
|
-
puts "Third row:"
|
254
|
-
get_row(table, num_columns, 2)
|
255
|
-
|
256
|
-
puts "\nSecond column:"
|
257
|
-
get_column(table, num_rows, num_columns, 1)
|
@@ -1,58 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
a = Matrix.new({ col: 1, row: 8, width: 120, height: 333, id: :vie_playground, name: :matrix_2, margin: 9,
|
4
|
-
matrix_style: { color: { red: 0.3, green: 0.3, blue: 0.6, alpha: 1 }, smooth: 20 },
|
5
|
-
cell_style: { color: { red: 0.333, green: 0.333, blue: 0.6, alpha: 1 }, smooth: 300, shadow: { blur: 6 }
|
6
|
-
#border: { color: :black, thickness: 0, pattern: :solid }
|
7
|
-
}
|
8
|
-
})
|
9
|
-
|
10
|
-
######## tests
|
11
|
-
|
12
|
-
a.assign(2) do
|
13
|
-
curent_cell = self
|
14
|
-
curent_cell.image({ path: "./medias/images/moto.png", width: 33, height: 33})
|
15
|
-
curent_cell.active(:inactive)
|
16
|
-
touch(:long) do
|
17
|
-
if curent_cell.active.value == :inactive
|
18
|
-
curent_cell.color(:yellow)
|
19
|
-
curent_cell.active(:active)
|
20
|
-
else
|
21
|
-
curent_cell.color(:red)
|
22
|
-
curent_cell.active(:inactive)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
a.assign(3) do
|
28
|
-
color({ red: 0.6, green: 0.333, blue: 0.6, alpha: 1 })
|
29
|
-
grab(:vie_playground_3).shadow({ blur: 12 })
|
30
|
-
end
|
31
|
-
|
32
|
-
|
33
|
-
wait 2 do
|
34
|
-
a.add({ columns: 3 })
|
35
|
-
end
|
36
|
-
|
37
|
-
# add row
|
38
|
-
# wait 4 do
|
39
|
-
# a.add({ rows: 2 })
|
40
|
-
# end
|
41
|
-
|
42
|
-
# examples:
|
43
|
-
|
44
|
-
# add columns
|
45
|
-
# a.add({ columns: 3 })
|
46
|
-
|
47
|
-
# add row
|
48
|
-
# a.add({ rows: 2 })
|
49
|
-
|
50
|
-
# reformat
|
51
|
-
# a.reformat({rows: 4, cols: 2})
|
52
|
-
|
53
|
-
# resize matrix
|
54
|
-
# a.resize_matrix({ width: 666, height: 333 })
|
55
|
-
|
56
|
-
# crop matrix
|
57
|
-
# a.matrix.height(150)
|
58
|
-
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# module OS
|
4
|
-
# def OS.windows?
|
5
|
-
# (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
|
6
|
-
# end
|
7
|
-
#
|
8
|
-
# def OS.mac?
|
9
|
-
# (/darwin/ =~ RUBY_PLATFORM) != nil
|
10
|
-
# end
|
11
|
-
#
|
12
|
-
# def OS.unix?
|
13
|
-
# !OS.windows?
|
14
|
-
# end
|
15
|
-
#
|
16
|
-
# def OS.linux?
|
17
|
-
# OS.unix? and !OS.mac? and !OS.opal?
|
18
|
-
# end
|
19
|
-
#
|
20
|
-
# def OS.jruby?
|
21
|
-
# RUBY_ENGINE == 'jruby'
|
22
|
-
# end
|
23
|
-
#
|
24
|
-
# def OS.opal?
|
25
|
-
# RUBY_ENGINE == 'opal'
|
26
|
-
# end
|
27
|
-
# end
|
28
|
-
#
|
29
|
-
# # alert OS.linux?
|