Class: AnimateIt::AnimationProperty

Inherits:
Data
  • Object
show all
Defined in:
lib/animate_it/animation.rb

Overview

----- Per-animatable property declaration ---------------------------- One CSS-driven animation slot on a data-anim="..." element. The framework turns these into both:

1. CSS variables on the wrapper (set per frame at render time), and
2. CSS rules of the form `[data-anim="name"] { property: var(--…); }`
 injected into the rendered HTML so the HAML doesn't need a `:css`
 block to bind variables to selectors.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#css_propertyObject (readonly)

Returns the value of attribute css_property

Returns:

  • (Object)

    the current value of css_property



9
10
11
# File 'lib/animate_it/animation.rb', line 9

def css_property
  @css_property
end

#defaultObject (readonly)

Returns the value of attribute default

Returns:

  • (Object)

    the current value of default



9
10
11
# File 'lib/animate_it/animation.rb', line 9

def default
  @default
end

#keyframes_to_valuesObject (readonly)

Returns the value of attribute keyframes_to_values

Returns:

  • (Object)

    the current value of keyframes_to_values



9
10
11
# File 'lib/animate_it/animation.rb', line 9

def keyframes_to_values
  @keyframes_to_values
end

#unitObject (readonly)

Returns the value of attribute unit

Returns:

  • (Object)

    the current value of unit



9
10
11
# File 'lib/animate_it/animation.rb', line 9

def unit
  @unit
end

#var_suffixObject (readonly)

Returns the value of attribute var_suffix

Returns:

  • (Object)

    the current value of var_suffix



9
10
11
# File 'lib/animate_it/animation.rb', line 9

def var_suffix
  @var_suffix
end

Instance Method Details

#var_name(animatable_name) ⇒ Object



10
11
12
# File 'lib/animate_it/animation.rb', line 10

def var_name(animatable_name)
  "--#{animatable_name.to_s.tr("_", "-")}-#{var_suffix.to_s.tr("_", "-")}"
end