Sha256: 1fc31fa89c186040c06cbf9533d0bea9079edae56966c9e2b1af07837d3ab36b

Contents?: true

Size: 1.93 KB

Versions: 7

Compression:

Stored size: 1.93 KB

Contents

# frozen_string_literal: true

generator = Genesis.generator


new({ browser: :left, type: :integer }) do |value, _user_proc|
  BrowserHelper.send("browser_left_#{@atome[:type]}", value, @browser_object, @atome)
end

generator.build_render(:browser_right) do |value, _user_proc|
  BrowserHelper.send("browser_right_#{@atome[:type]}", value, @browser_object, @atome)
end

generator.build_render(:browser_top) do |value, _user_proc|
  BrowserHelper.send("browser_top_#{@atome[:type]}", value, @browser_object, @atome)
end

generator.build_render(:browser_bottom) do |value, _user_proc|
  BrowserHelper.send("browser_bottom_#{@atome[:type]}", value, @browser_object, @atome)
end

generator.build_render(:browser_rotate) do |value, _user_proc|
  @browser_object.style[:transform] = "rotate(#{value}deg)" unless @browser_type == :style
end

generator.build_render(:browser_center) do |value, _user_proc|
  case value
  when :horizontal
    @browser_object.remove_class(:center)
    @browser_object.remove_class(:center_vertical)
    @browser_object.add_class(:center_horizontal)
    @browser_object.style[:bottom] = :auto
    @browser_object.style[:right] = :auto
    @browser_object.style[:top] = '0px'
    @browser_object.style[:left] = '50%'
  when :vertical
    @browser_object.remove_class(:center)
    @browser_object.remove_class(:center_horizontal)
    @browser_object.add_class(:center_vertical)
    @browser_object.style[:bottom] = :auto
    @browser_object.style[:right] = :auto
    @browser_object.style[:left] = '0px'
    @browser_object.style[:top] = '50%'
  else
    @browser_object.remove_class(:center_vertical)
    @browser_object.remove_class(:center_horizontal)
    @browser_object.add_class(:center)
    @browser_object.style[:bottom] = :auto
    @browser_object.style[:right] = :auto
    @browser_object.style[:left] = '50%'
    @browser_object.style[:top] = '50%'
  end

end

new ({ browser: :depth }) do |value|
  @browser_object.style['z-index'] = value
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
atome-0.5.4.1.9 lib/atome/renderers/browser/spatial.rb
atome-0.5.4.1.7 lib/atome/renderers/browser/spatial.rb
atome-0.5.4.1.3 lib/atome/renderers/browser/spatial.rb
atome-0.5.4.1.2 lib/atome/renderers/browser/spatial.rb
atome-0.5.4.1.1 lib/atome/renderers/browser/spatial.rb
atome-0.5.4.1.0 lib/atome/renderers/browser/spatial.rb
atome-0.5.4.0.9 lib/atome/renderers/browser/spatial.rb