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.
- checksums.yaml +4 -4
- 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 -177
- 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 -95
- 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 -32
- 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
@@ -0,0 +1,227 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# class HTML
|
4
|
+
#
|
5
|
+
# def layout_style(option = {})
|
6
|
+
# element_style = {
|
7
|
+
# backgroundColor: 'rebeccapurple',
|
8
|
+
# width: '100%',remove_layout
|
9
|
+
# height: '29px',
|
10
|
+
# borderRadius: '59px',
|
11
|
+
# display: 'flex',
|
12
|
+
# justifyContent: 'center',
|
13
|
+
# alignItems: 'center',
|
14
|
+
# flexDirection: 'column',
|
15
|
+
# marginBottom: '20px',
|
16
|
+
# padding: '0px',
|
17
|
+
# # transform: 'rotate(22deg)',
|
18
|
+
#
|
19
|
+
# }
|
20
|
+
#
|
21
|
+
# container_style = {
|
22
|
+
# display: :grid,
|
23
|
+
# gridTemplateColumns: 'repeat(4, 1fr)',
|
24
|
+
# overflow: :scroll,
|
25
|
+
# flexDirection: 'column',
|
26
|
+
# gap: '20px',
|
27
|
+
# padding: '0px',
|
28
|
+
#
|
29
|
+
# }
|
30
|
+
# element_style = element_style.merge(option[:element]) if option[:element]
|
31
|
+
# container_style = container_style.merge(option[:container]) if option[:container]
|
32
|
+
# @layout_style = { element: element_style, container: container_style }
|
33
|
+
# end
|
34
|
+
#
|
35
|
+
# def remove_webview_layout(element, container)
|
36
|
+
# element[:classList].add('atome')
|
37
|
+
# element[:classList].remove('matrix_element')
|
38
|
+
# end
|
39
|
+
#
|
40
|
+
# def layout(params)
|
41
|
+
#
|
42
|
+
# id_found = params[:id]
|
43
|
+
# mode_found = params[:mode]
|
44
|
+
# width_found = params[:width]
|
45
|
+
# height_found = params[:height]
|
46
|
+
# layout_container = JS.global[:document].getElementById(id_found.to_s)
|
47
|
+
# layout_elements = JS.global[:document].querySelectorAll(".#{id_found}")
|
48
|
+
# if mode_found == :default
|
49
|
+
# # we revert all elements to default state / layout
|
50
|
+
# layout_elements.to_a.each do |element|
|
51
|
+
# element[:classList].remove('matrix_element')
|
52
|
+
# element[:classList].add('atome')
|
53
|
+
# end
|
54
|
+
# else
|
55
|
+
# # we apply new layout to elements
|
56
|
+
# layout_style({ element: { backgroundColor: :purple } })
|
57
|
+
# layout_container[:classList].remove('atome')
|
58
|
+
# layout_container[:classList].add('matrix')
|
59
|
+
# layout_elements.to_a.each do |element|
|
60
|
+
# # we check if current state is default if yes we store the layout to be able to restore it
|
61
|
+
# element[:style][:borderRadius] = '59px'
|
62
|
+
# element[:classList].remove('atome')
|
63
|
+
# # element[:classList].add('matrix_element')
|
64
|
+
# end
|
65
|
+
# end
|
66
|
+
#
|
67
|
+
# end
|
68
|
+
# end
|
69
|
+
|
70
|
+
class Atome
|
71
|
+
def remove_layout
|
72
|
+
display[:mode] = :default
|
73
|
+
# we get the current parent (the previous layout)
|
74
|
+
parent_found = grab(attach)
|
75
|
+
# we get the parent of the parent
|
76
|
+
grand_parent = parent_found.attach
|
77
|
+
# and attach the item to the grand parent
|
78
|
+
# we remove the parent category and restore atome category
|
79
|
+
remove({ category: attach})
|
80
|
+
category(:atome)
|
81
|
+
attach(grand_parent)
|
82
|
+
# we delete the parent (the layout) if it no more children attached
|
83
|
+
if parent_found.attached.length == 0
|
84
|
+
parent_found.delete(true)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
new({ particle: :layout }) do |params|
|
90
|
+
mode_found = params.delete(:mode) || :list
|
91
|
+
elements_style= params.delete(:element) || {}
|
92
|
+
# layout_width = params[:width] ||= 333
|
93
|
+
# layout_height = params[:height] ||= 333
|
94
|
+
# now we get the list of the atome to layout
|
95
|
+
atomes_to_layout = []
|
96
|
+
if type == :group
|
97
|
+
atomes_to_layout = collect
|
98
|
+
end
|
99
|
+
# if params[:list] is specified group collection is override
|
100
|
+
atomes_to_layout = params[:list] if params[:list]
|
101
|
+
|
102
|
+
if mode_found == :default
|
103
|
+
# the user want to revert the layout to the default
|
104
|
+
atomes_to_layout.each do |atome_id_to_layout|
|
105
|
+
atome_to_layout = grab(atome_id_to_layout)
|
106
|
+
unless params[:id]
|
107
|
+
params[:id] = atome_to_layout.display[:layout]
|
108
|
+
end
|
109
|
+
# now we get the default particles and restore it
|
110
|
+
atome_to_layout.display[:default].each do |particle, value|
|
111
|
+
atome_to_layout.send(:delete,particle)
|
112
|
+
atome_to_layout.send(particle,value)
|
113
|
+
end
|
114
|
+
|
115
|
+
atome_to_layout.remove_layout
|
116
|
+
end
|
117
|
+
else
|
118
|
+
if params[:id]
|
119
|
+
container_name = params[:id]
|
120
|
+
container = grab(:view).box({ id: container_name })
|
121
|
+
container_class = container_name
|
122
|
+
else
|
123
|
+
container = grab(:view).box
|
124
|
+
id_found = container.id
|
125
|
+
params[:id] = id_found
|
126
|
+
container_class = id_found
|
127
|
+
end
|
128
|
+
# container.width = layout_width
|
129
|
+
# container.height = layout_height
|
130
|
+
container.remove({ category: :atome})
|
131
|
+
container.category(:matrix)
|
132
|
+
alert ">> #{mode_found}"
|
133
|
+
params.each do |particle, value|
|
134
|
+
container.send(particle, value)
|
135
|
+
end
|
136
|
+
# now we add user wanted particles
|
137
|
+
alert params
|
138
|
+
|
139
|
+
atomes_to_layout.each do |atome_id_to_layout|
|
140
|
+
atome_to_layout = grab(atome_id_to_layout)
|
141
|
+
# we remove previous display mode
|
142
|
+
atome_to_layout.remove_layout
|
143
|
+
atome_to_layout.display[:mode] = mode_found
|
144
|
+
atome_to_layout.display[:layout] = id_found
|
145
|
+
atome_to_layout.attach(container_class)
|
146
|
+
atome_to_layout.remove({ category: :atome})
|
147
|
+
atome_to_layout.category(container_class)
|
148
|
+
#the hash below is used to restore element state
|
149
|
+
original_state={}
|
150
|
+
elements_style.each do |particle, value|
|
151
|
+
# we have to store all elements particle to restore it later
|
152
|
+
original_state[particle]=atome_to_layout.send(particle)
|
153
|
+
atome_to_layout.send(particle, value)
|
154
|
+
end
|
155
|
+
atome_to_layout.display[:default]=original_state
|
156
|
+
# puts "display is : #{atome_to_layout.display}"
|
157
|
+
# atome_to_layout.html.add_class(container_class)
|
158
|
+
# puts container_class
|
159
|
+
end
|
160
|
+
end
|
161
|
+
params
|
162
|
+
end
|
163
|
+
|
164
|
+
# new({ renderer: :html, method: :layout, type: :hash }) do |params, _user_proc|
|
165
|
+
# html.layout(params)
|
166
|
+
# end
|
167
|
+
|
168
|
+
new({ particle: :display })
|
169
|
+
|
170
|
+
# system
|
171
|
+
Atome.new({ renderers: [:html], id: :selector, collect: [], type: :group, tag: { system: true } })
|
172
|
+
|
173
|
+
############### tests
|
174
|
+
|
175
|
+
b = box({ color: :red, id: :the_box, left: 3 })
|
176
|
+
16.times do |index|
|
177
|
+
width_found = b.width
|
178
|
+
b.duplicate({ left: b.left + index * (width_found + 45), top: 0, category: :custom_category })
|
179
|
+
end
|
180
|
+
|
181
|
+
grab(:view).attached.each do |atome_found|
|
182
|
+
grab(atome_found).selected(true)
|
183
|
+
end
|
184
|
+
grab(:the_box_copy_1).text(:hello)
|
185
|
+
#################
|
186
|
+
selected_items = grab(Universe.current_user).selection # we create a group
|
187
|
+
# we collect all atomes in the view
|
188
|
+
atomes_found = []
|
189
|
+
selected_items.each do |atome_found|
|
190
|
+
atomes_found << atome_found
|
191
|
+
end
|
192
|
+
|
193
|
+
random_found = atomes_found.sample(17)
|
194
|
+
|
195
|
+
# random_found.each do |atome_id|
|
196
|
+
# atome_found = grab(atome_id)
|
197
|
+
# if atome_found.type == :shape
|
198
|
+
# atome_found.left(rand(700))
|
199
|
+
# atome_found.width(rand(120))
|
200
|
+
# atome_found.height(rand(120))
|
201
|
+
# atome_found.smooth(rand(120))
|
202
|
+
# atome_found.color({ red: rand, green: rand, blue: rand })
|
203
|
+
# end
|
204
|
+
# end
|
205
|
+
wait 1 do
|
206
|
+
selected_items.layout({ mode: :grid, width: 900, height: 500, color: :green,element: {height: 22, rotate: 22} })
|
207
|
+
# alert grab('the_box_copy_4').display
|
208
|
+
wait 1 do
|
209
|
+
# selected_items.layout({ mode: :grid, width: 800, height: 500 })
|
210
|
+
wait 1 do
|
211
|
+
selected_items.layout({ mode: :default, width: 500, height: 500 })
|
212
|
+
# alert grab('the_box_copy_4').display
|
213
|
+
wait 1 do
|
214
|
+
selected_items.layout({ id: :my_layout, mode: :list, width: 151, height: 800, overflow: :scroll })
|
215
|
+
wait 1 do
|
216
|
+
selected_items.layout({ mode: :default, width: 500, height: 500 })
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
# JS.global[:console].clear()
|
224
|
+
|
225
|
+
|
226
|
+
# b=box
|
227
|
+
# alert ">> #{b.display}"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
puts "current user: #{Universe.current_user}"
|
4
|
+
human({ id: :jeezs, login: true })
|
5
|
+
|
6
|
+
puts "current user: #{Universe.current_user}"
|
7
|
+
wait 2 do
|
8
|
+
human({ id: :toto, login: true })
|
9
|
+
puts "current user: #{Universe.current_user}"
|
10
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# def add_css_to_atomic_style(css)
|
4
|
+
# style_element = JS.global[:document].getElementById('atomic_style')
|
5
|
+
# text_node = JS.global[:document].createTextNode(css)
|
6
|
+
# style_element.appendChild(text_node)
|
7
|
+
# end
|
8
|
+
#
|
9
|
+
# def convert_to_css(data)
|
10
|
+
# conditions = data[:condition]
|
11
|
+
# apply = data[:alterations]
|
12
|
+
#
|
13
|
+
# # Convert the conditions
|
14
|
+
# condition_strings = []
|
15
|
+
#
|
16
|
+
# if conditions[:max]
|
17
|
+
# condition_strings << "(max-width: #{conditions[:max][:width]}px)" if conditions[:max][:width]
|
18
|
+
# condition_strings << "(max-height: #{conditions[:max][:height]}px)" if conditions[:max][:height]
|
19
|
+
# end
|
20
|
+
#
|
21
|
+
# if conditions[:min]
|
22
|
+
# condition_strings << "(min-width: #{conditions[:min][:width]}px)" if conditions[:min][:width]
|
23
|
+
# condition_strings << "(min-height: #{conditions[:min][:height]}px)" if conditions[:min][:height]
|
24
|
+
# end
|
25
|
+
#
|
26
|
+
# operator = conditions[:operator] == :and ? "and" : "or"
|
27
|
+
#
|
28
|
+
# # Convert properties to apply
|
29
|
+
# property_strings = []
|
30
|
+
# apply.each do |key, values|
|
31
|
+
# inner_properties = []
|
32
|
+
# values.each do |property, value|
|
33
|
+
# if property == :color
|
34
|
+
# inner_properties << "background-color: #{value} !important;"
|
35
|
+
# else
|
36
|
+
# inner_properties << "#{property}: #{value}px !important;" if value.is_a?(Integer)
|
37
|
+
# inner_properties << "#{property}: #{value} !important;" if value.is_a?(Symbol)
|
38
|
+
# end
|
39
|
+
# end
|
40
|
+
# # Prefix each key with "#"
|
41
|
+
# property_strings << "##{key} {\n#{inner_properties.join("\n")}\n}"
|
42
|
+
# end
|
43
|
+
#
|
44
|
+
# # let it build
|
45
|
+
# css = "@media #{condition_strings.join(" #{operator} ")} {\n#{property_strings.join("\n")}\n}"
|
46
|
+
# add_css_to_atomic_style(css)
|
47
|
+
# css
|
48
|
+
# end
|
49
|
+
#
|
50
|
+
# def css_to_data(css)
|
51
|
+
# data = {
|
52
|
+
# :condition => {},
|
53
|
+
# :apply => {}
|
54
|
+
# }
|
55
|
+
# # Extract conditions
|
56
|
+
# media_conditions = css.match(/@media ([^\{]+)/)[1].split(',').map(&:strip)
|
57
|
+
# media_conditions.each do |condition|
|
58
|
+
# type = condition.match(/(max|min)-/)[1].to_sym
|
59
|
+
# property = condition.match(/(width|height)/)[1].to_sym
|
60
|
+
# value = condition.match(/(\d+)/)[1].to_i
|
61
|
+
#
|
62
|
+
# data[:condition][type] ||= {}
|
63
|
+
# data[:condition][type][property] = value
|
64
|
+
# end
|
65
|
+
#
|
66
|
+
# # Extract properties to be applied
|
67
|
+
# css.scan(/(\w+) \{([^\}]+)\}/).each do |match|
|
68
|
+
# key = match[0].to_sym
|
69
|
+
# properties = match[1].split(';').map(&:strip).reject(&:empty?)
|
70
|
+
#
|
71
|
+
# data[:apply][key] ||= {}
|
72
|
+
# properties.each do |property|
|
73
|
+
# prop, value = property.split(':').map(&:strip)
|
74
|
+
# if prop == "background-color"
|
75
|
+
# data[:apply][key][:color] = value.to_sym
|
76
|
+
# elsif value[-2..] == "px"
|
77
|
+
# data[:apply][key][prop.to_sym] = value.to_i
|
78
|
+
# else
|
79
|
+
# data[:apply][key][prop.to_sym] = value.to_sym
|
80
|
+
# end
|
81
|
+
# end
|
82
|
+
# end
|
83
|
+
#
|
84
|
+
# data
|
85
|
+
# end
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
box({ color: :red, width: :auto, left: 120, right: 120, id: :box_1 })
|
90
|
+
circle({ left: 33, top: 200, id: :circle_1 })
|
91
|
+
circle({ left: 200, top: 200, id: :circle_2 })
|
92
|
+
circle({ left: 400, top: 200, id: :circle_3 })
|
93
|
+
circle({ left: 600, top: 200, id: :circle_4 })
|
94
|
+
text({ data: "resize the window to it's minimum to activate response", id: :my_text })
|
95
|
+
|
96
|
+
A.match({condition:{max: {width: 777}, min: {height: 333}, operator: :and }}) do
|
97
|
+
{
|
98
|
+
circle_1: { color: :red , width: 23},
|
99
|
+
circle_2: { color: :orange , width: 23, top: 12},
|
100
|
+
box_1: { width: 123, left: 222, color: :blue, rotate: 22}
|
101
|
+
}
|
102
|
+
end
|
103
|
+
|
104
|
+
# match can work without any condition then the particles are always applied
|
105
|
+
|
106
|
+
# A.match({}) do
|
107
|
+
# {
|
108
|
+
# circle_1: { color: :red, width: 23 },
|
109
|
+
# circle_2: { color: :orange, width: 23, top: 12 },
|
110
|
+
# box_1: { width: 123, left: 222, color: :blue, rotate: 22 }
|
111
|
+
# }
|
112
|
+
# end
|
113
|
+
|
114
|
+
|
115
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
b = box({ color: :red })
|
4
|
+
|
5
|
+
b.touch(true) do
|
6
|
+
b.connection('localhost:9292') do |params|
|
7
|
+
alert " the connection is : #{params}"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
c = box({ color: :yellow, left: 333 })
|
12
|
+
|
13
|
+
c.touch(true) do
|
14
|
+
b.message('hi there!!')
|
15
|
+
# c = box({ color: :red, left: 333 })
|
16
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
puts 'deprecated use clone monitoring'
|
3
|
+
# b = box({ id: :the_box })
|
4
|
+
# c = circle({ top: 3, id: :the_cirle })
|
5
|
+
# A.monitor({ atomes: [:the_box, :the_cirle], particles: [:left] }) do |atome, particle, value|
|
6
|
+
# puts "changes : #{atome.id}, #{particle}, #{value}"
|
7
|
+
# end
|
8
|
+
#
|
9
|
+
# wait 2 do
|
10
|
+
# b.left(3)
|
11
|
+
# wait 2 do
|
12
|
+
# c.left(444)
|
13
|
+
# end
|
14
|
+
# end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
b = box({ left: 666, color: :blue, smooth: 6, id: :the_box2 })
|
4
|
+
b.over(true) do
|
5
|
+
b.color(:black)
|
6
|
+
# puts "I'm inside"
|
7
|
+
end
|
8
|
+
b.over(:enter) do
|
9
|
+
puts "in"
|
10
|
+
puts "enter"
|
11
|
+
b.width= b.width+30
|
12
|
+
# alert :in
|
13
|
+
b.color(:yellow)
|
14
|
+
end
|
15
|
+
b.over(:leave) do
|
16
|
+
b.height= b.height+10
|
17
|
+
puts "out"
|
18
|
+
puts "leave"
|
19
|
+
# alert :out
|
20
|
+
b.color(:orange)
|
21
|
+
end
|
22
|
+
|
23
|
+
#
|
24
|
+
t=b.text('touch me to stop over leave')
|
25
|
+
b.touch(true) do
|
26
|
+
b.over({ remove: :enter })
|
27
|
+
t.data('finished')
|
28
|
+
end
|
29
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
c=circle({drag: true, id: :the_circle})
|
4
|
+
|
5
|
+
c1=c.color(:white).id
|
6
|
+
c2=c.color(:red).id
|
7
|
+
c3=c.color(:yellow).id
|
8
|
+
color({id: :toto, red: 1 , alpha: 0.5})
|
9
|
+
wait 0.5 do
|
10
|
+
c.paint({ gradient: [c1,c2], direction: :left })
|
11
|
+
wait 0.5 do
|
12
|
+
c.paint({ gradient: [c1,c2, c3], direction: :left })
|
13
|
+
wait 0.5 do
|
14
|
+
c.paint({ gradient: [c1,c2], diffusion: :radial })
|
15
|
+
wait 0.5 do
|
16
|
+
c.paint({ gradient: [c1,c2, c3], diffusion: :conic })
|
17
|
+
wait 0.5 do
|
18
|
+
c.remove({all: :paint})
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
if Universe.internet
|
4
|
+
# v = video({ path: "medias/videos/avengers.mp4", id: :my_video })
|
5
|
+
v = video({ path: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" })
|
6
|
+
else
|
7
|
+
v = video(:video_missing)
|
8
|
+
end
|
9
|
+
v.left(200)
|
10
|
+
v.touch(true) do
|
11
|
+
alert v.play
|
12
|
+
end
|
13
|
+
|
14
|
+
t=text({id: :my_text, data: "play video"})
|
15
|
+
|
16
|
+
t.touch(true) do
|
17
|
+
v.data=0
|
18
|
+
v.play(26) do |event|
|
19
|
+
t.data("event is : #{event}")
|
20
|
+
if event[:frame] == 900 && v.data <3
|
21
|
+
puts v.data
|
22
|
+
v.data(v.data+1)
|
23
|
+
v.play(26)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
c=circle({left: 123})
|
29
|
+
|
30
|
+
c.touch(true) do
|
31
|
+
v.play(:pause)
|
32
|
+
end
|
33
|
+
|
34
|
+
cc=circle({left: 0, width: 55, height: 55})
|
35
|
+
|
36
|
+
left=0
|
37
|
+
cc.drag(:locked) do |event|
|
38
|
+
dx = event[:dx]
|
39
|
+
left += dx.to_f
|
40
|
+
min_left = 0
|
41
|
+
max_left = 600
|
42
|
+
left = [min_left, left].max
|
43
|
+
left = [left, max_left].min
|
44
|
+
v.html.currentTime(left/10)
|
45
|
+
cc.left(left)
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
puts "add lock x and y when drag"
|
50
|
+
puts "restrict ro :view doesnt work"
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
|
4
|
+
# here how ti use preset in the atome framework
|
5
|
+
# presets available are : render_engines,image,video,animation,element,box,vector,circle,shape,text,drm,shadow,color,www,raw,code,audio,group,human,machine,paint
|
6
|
+
|
7
|
+
my_box=box
|
8
|
+
# using the code line above a lot of particles will be implicitly created, if we inspect my_box
|
9
|
+
puts my_box.inspect # this will print :
|
10
|
+
#[Log] #<Atome: @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @id=:box_14, @type=:shape, @html=#<HTML:0x0662a164 @element=[object HTMLDivElement], @id="box_14", @original_atome=#<Atome: @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @id=:box_14, @type=:shape, @html=#<HTML:0x0662a164 ...>, @attach=[:view], @renderers=[:html], @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=>[]}}>, @element_type="div">, @attach=[:view], @renderers=[:html], @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=>[]}}> (browser.script.iife.min.js, line 13)
|
11
|
+
|
12
|
+
# please note that an ID is automatically created using a simple strategy id : atome_type_total_number_of_users_atomes ex here : @id="box_14"
|
13
|
+
|
14
|
+
my_box.text("touch me")
|
15
|
+
puts " my_box preset is : #{my_box.preset}"
|
16
|
+
# print in the console : [Log] my_box preset is : {:box=>{:width=>99, :height=>99, :apply=>[:box_color], :left=>100, :top=>100, :clones=>[]}} (browser.script.iife.min.js, line 13)
|
17
|
+
|
18
|
+
|
19
|
+
c=circle
|
20
|
+
puts " c is : #{c.inspect }"
|
21
|
+
# this print : [Log] c is : #<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_16, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @html=#<HTML:0x06579be8 @element=[object HTMLDivElement], @id="circle_16", @original_atome=#<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_16, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @html=#<HTML:0x06579be8 ...>, @top=100, @attach=[:view], @left=100, @apply=[:circle_color], @clones=[], @preset={:circle=>{:width=>99, :height=>99, :smooth=>"100%", :apply=>[:circle_color], :left=>100, :top=>100, :clones=>[]}}>, @element_type="div">, @top=100, @attach=[:view], @left=100, @apply=[:circle_color], @clones=[], @preset={:circle=>{:width=>99, :height=>99, :smooth=>"100%", :apply=>[:circle_color], :left=>100, :top=>100, :clones=>[]}}> (browser.script.iife.min.js, line 13)
|
22
|
+
# it's pôssible to alter basic preset using the particle .preset
|
23
|
+
my_box.preset({ circle: {type: :shape, :width=>99, :height=>99, :smooth=>"100%", color: :red, :left=>100, :top=>100, :clones=>[]}})
|
24
|
+
puts " my_box preset is now : #{my_box.preset}"
|
25
|
+
# now the preset circle is : [Log] my_box preset is now : {:circle=>{:type=>:shape, :width=>99, :height=>99, :smooth=>"100%", :color=>:red, :left=>100, :top=>100, :clones=>[]}} (browser.script.iife.min.js, line 13)
|
26
|
+
|
27
|
+
my_box.touch(true) do
|
28
|
+
my_box.preset(:circle) # the box now rounded like a circle
|
29
|
+
|
30
|
+
new_circle=circle # as the preset circle has been modified tha circle is now red as specified in the updated preset
|
31
|
+
puts "new_circle is : #{new_circle.inspect}"
|
32
|
+
# this print : new_circle is : #<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_18, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @html=#<HTML:0x0664e99c @element=[object HTMLDivElement], @id="circle_18", @original_atome=#<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_18, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @html=#<HTML:0x0664e99c ...>, @top=100, @attach=[:box_14], @left=100, @apply=[:circle_18_color_1_0_0_0_0_0____], @clones=[]>, @element_type="div">, @top=100, @attach=[:box_14], @left=100, @apply=[:circle_18_color_1_0_0_0_0_0____], @clones=[]>
|
33
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
b = box
|
4
|
+
|
5
|
+
16.times do |index|
|
6
|
+
width_found = b.width
|
7
|
+
b.duplicate({ left: b.left + index * (width_found + 45), top: 0, category: :matrix })
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
Universe.user_atomes.each do |atome_id|
|
12
|
+
atome_found = grab(atome_id)
|
13
|
+
if atome_found.type == :shape
|
14
|
+
atome_found.color(:orange)
|
15
|
+
atome_found.smooth(200)
|
16
|
+
atome_found.top(200)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
random_found =Universe.user_atomes.sample(7)
|
21
|
+
random_found.each do |atome_id|
|
22
|
+
atome_found = grab(atome_id)
|
23
|
+
if atome_found.type == :shape
|
24
|
+
atome_found.top(rand(600))
|
25
|
+
atome_found.width(rand(120))
|
26
|
+
atome_found.height(rand(120))
|
27
|
+
atome_found.smooth(rand(120))
|
28
|
+
atome_found.color(:red)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
random_found =Universe.user_atomes.sample(9)
|
33
|
+
random_found.each do |atome_id|
|
34
|
+
atome_found = grab(atome_id)
|
35
|
+
if atome_found.type == :shape
|
36
|
+
atome_found.left(rand(700))
|
37
|
+
atome_found.width(rand(120))
|
38
|
+
atome_found.height(rand(120))
|
39
|
+
atome_found.smooth(rand(120))
|
40
|
+
atome_found.color(:blue)
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
raw_data = <<STR
|
4
|
+
<iframe width="560" height="315" src="https://www.youtube.com/embed/8BT4Q3UtO6Q?si=WI8RlryV8HW9Y0nz" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
|
5
|
+
STR
|
6
|
+
|
7
|
+
|
8
|
+
raw_data = <<STR
|
9
|
+
<svg width="600" height="350" xmlns="http://www.w3.org/2000/svg">
|
10
|
+
<!-- Style for the boxes -->
|
11
|
+
<style>
|
12
|
+
.box { fill: white; stroke: black; stroke-width: 2; }
|
13
|
+
.original { fill: lightblue; }
|
14
|
+
.clone { fill: lightgreen; }
|
15
|
+
.arrow { stroke: black; stroke-width: 2; marker-end: url(#arrowhead); }
|
16
|
+
.text { font-family: Arial, sans-serif; font-size: 14px; }
|
17
|
+
</style>
|
18
|
+
|
19
|
+
<!-- Arrowhead definition -->
|
20
|
+
<defs>
|
21
|
+
<marker id="arrowhead" markerWidth="10" markerHeight="7"
|
22
|
+
refX="0" refY="3.5" orient="auto">
|
23
|
+
<polygon points="0 0, 10 3.5, 0 7" fill="black"/>
|
24
|
+
</marker>
|
25
|
+
</defs>
|
26
|
+
|
27
|
+
<!-- Boxes for original and clones -->
|
28
|
+
<rect x="250" y="30" width="100" height="50" class="box original"/>
|
29
|
+
<rect x="100" y="200" width="100" height="50" class="box clone"/>
|
30
|
+
<rect x="250" y="200" width="100" height="50" class="box clone"/>
|
31
|
+
<rect x="400" y="200" width="100" height="50" class="box clone"/>
|
32
|
+
|
33
|
+
<!-- Text for boxes -->
|
34
|
+
<text x="275" y="55" class="text" text-anchor="middle">Original</text>
|
35
|
+
<text x="150" y="225" class="text" text-anchor="middle">Clone 1</text>
|
36
|
+
<text x="300" y="225" class="text" text-anchor="middle">Clone 2</text>
|
37
|
+
<text x="450" y="225" class="text" text-anchor="middle">Clone 3</text>
|
38
|
+
|
39
|
+
<!-- Arrows -->
|
40
|
+
<line x1="300" y1="80" x2="150" y2="200" class="arrow"/>
|
41
|
+
<line x1="300" y1="80" x2="300" y2="200" class="arrow"/>
|
42
|
+
<line x1="300" y1="80" x2="450" y2="200" class="arrow"/>
|
43
|
+
</svg>
|
44
|
+
STR
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
raw({ id: :the_raw_stuff, data: raw_data })
|