Method: Flms::KeyframeViewObject#styles

Defined in:
app/view_objects/flms/keyframe_view_object.rb

#styles(options = {}) ⇒ Object

Generate a string of CSS styling for each attribute provided by the keyframe Available options are:

:width        - default 0, affects width and margin-left of layer
:height       - default 0, affects height and margin-top of layer
:free_height  - if true, will suppress generation of height style

Will add margins using provided values, and pin the layer within the viewport using width and height.



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/view_objects/flms/keyframe_view_object.rb', line 32

def styles(options = {})
  options[:width] ||= 0
  options[:height] ||= 0
  options[:free_height] ||= false

  attribs = [ :position_x, :position_y,
              :opacity,
              :blur ].map { |attribute| style_for_attribute(attribute) }.join ' '
  attribs += pinning(options[:width],
                     options[:height],
                     options[:free_height])
  attribs
end