Sha256: 5b555c04d6dd81b0596e30767aa7a9747b649ce371628bcb82f07f1553c0f99f

Contents?: true

Size: 1.36 KB

Versions: 15

Compression:

Stored size: 1.36 KB

Contents

#
# mimicking the mootools demo for Fx.Slide
# http://demos.mootools.net/Fx.Slide
#
Shoes.app do
  def stop_anim
    @anim.stop
    @anim = nil
  end
  def slide_anim &blk
    stop_anim if @anim
    @anim = animate 30, &blk
  end
  def slide_out slot
    slide_anim do |i|
      slot.height = 150 - (i * 3)
      slot.contents[0].top = -i * 3
      if slot.height == 0
        stop_anim
        slot.hide
      end
    end
  end
  def slide_in slot
    slot.show
    slide_anim do |i|
      slot.height = i * 6
      slot.contents[0].top = slot.height - 150
      stop_anim if slot.height == 150
    end
  end

  background white
  stack :margin => 10 do
    para link("slide out") { slide_out @lipsum }, " | ",
      link("slide in") { slide_in @lipsum }
    @lipsum = stack :width => 1.0, :height => 150 do
      stack do
        background "#ddd"
        border "#eee", :strokewidth => 5
        para "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", :margin => 10
      end
    end
  end
end

Version data entries

15 entries across 9 versions & 4 rubygems

Version Path
scarpe-0.4.0 examples/legacy/not_checked/shoes-contrib/simple/simple-slide.rb
scarpe-0.3.0 examples/legacy/not_checked/shoes-contrib/simple/simple-slide.rb
scarpe-0.2.2 examples/legacy/not_checked/shoes-contrib/simple/simple-slide.rb
lacci-0.2.1 examples/legacy/not_checked/simple/slide.rb
lacci-0.2.1 examples/legacy/not_checked/shoes-dep-samples/simple-slide.rb
lacci-0.2.1 examples/legacy/not_checked/shoes-contrib/simple/simple-slide.rb
scarpe-0.2.1 examples/legacy/not_checked/shoes-dep-samples/simple-slide.rb
scarpe-0.2.1 examples/legacy/not_checked/shoes-contrib/simple/simple-slide.rb
scarpe-0.2.1 examples/legacy/not_checked/simple/slide.rb
scarpe-0.2.0 examples/legacy/not_checked/simple/slide.rb
scarpe-0.2.0 examples/legacy/not_checked/shoes-dep-samples/simple-slide.rb
scarpe-0.2.0 examples/legacy/not_checked/shoes-contrib/simple/simple-slide.rb
shoes-3.0.1 samples/simple-slide.rb
shoesgem-0.1514.0 shoes/samples/simple-slide.rb
shoesgem-0.1424.0 shoes/samples/simple-slide.rb