vendor/assets/application/examples/animation.rb in atome-0.5.7.4.8 vs vendor/assets/application/examples/animation.rb in atome-0.5.7.5.1
- old
+ new
@@ -82,38 +82,42 @@
#TODO : make the code above works
# create a animation object
# create callback methode when playing
# # here is how to animate shape :
+wait 0.2 do
+ puts " we wait 0.2 sec else there's a of a problem if we use server wasm "
b=box({id: :the_box})
b.animate({ to: 333, particle: :width, duration: 3000}) do |val|
puts "width +#{val}"
end
-b.animate({ to: 456, particle: :left, duration: 5000}) do |val|
- puts "left +#{val}"
-end
+ b.animate({ to: 456, particle: :left, duration: 5000}) do |val|
+ puts "left +#{val}"
+ end
-b.animate({ end: :left}) do |val|
- puts "left ended"
-end
+ b.animate({ end: :left}) do |val|
+ puts "left ended"
+ end
-b.animate({ to: 69, particle: :smooth, duration: 10000}) do |val|
- puts "smooth +#{val}"
-end
+ b.animate({ to: 69, particle: :smooth, duration: 10000}) do |val|
+ puts "smooth +#{val}"
+ end
-b.animate({ end: :smooth}) do |val|
- puts " cool smooth end now!!!"
-end
+ b.animate({ end: :smooth}) do |val|
+ puts " cool smooth end now!!!"
+ end
-b.animate({ to: 90, particle: :rotate, duration: 10000}) do |val|
- puts "rotate +#{val}"
-end
+ b.animate({ to: 90, particle: :rotate, duration: 10000}) do |val|
+ puts "rotate +#{val}"
+ end
-b.animate({ to: 222, particle: :top, duration: 10000}) do |val|
- puts "top +#{val}"
+ b.animate({ to: 222, particle: :top, duration: 10000}) do |val|
+ puts "top +#{val}"
+ end
+
end