Class: LeanCms::CardsSectionComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/lean_cms/cards_section_component.rb

Instance Attribute Summary collapse

Attributes inherited from BaseComponent

#page

Instance Method Summary collapse

Constructor Details

#initialize(section:, page: nil, grid_cols: 3, gap: 8, container_class: '', card_class: 'bg-white rounded-xl p-8 shadow-sm hover:shadow-md transition-shadow', icon_size: 12, icon_shape: 'lg', icon_bg_gradient: false, text_align: nil, ignore_card_bg: false, scroll_animate: false, stagger_delay: 150, **options) ⇒ CardsSectionComponent

Returns a new instance of CardsSectionComponent.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/components/lean_cms/cards_section_component.rb', line 7

def initialize(section:, page: nil, grid_cols: 3, gap: 8, container_class: '', 
               card_class: 'bg-white rounded-xl p-8 shadow-sm hover:shadow-md transition-shadow',
               icon_size: 12, icon_shape: 'lg', icon_bg_gradient: false,
               text_align: nil, ignore_card_bg: false, scroll_animate: false,
               stagger_delay: 150, **options)
  super(page: page)
  @section = section
  @grid_cols = grid_cols
  @gap = gap
  @container_class = container_class
  @card_class = card_class
  @icon_size = icon_size
  @icon_shape = icon_shape
  @icon_bg_gradient = icon_bg_gradient
  @text_align = text_align
  @ignore_card_bg = ignore_card_bg
  @scroll_animate = scroll_animate
  @stagger_delay = stagger_delay
  @options = options
end

Instance Attribute Details

#card_classObject (readonly)

Returns the value of attribute card_class.



3
4
5
# File 'app/components/lean_cms/cards_section_component.rb', line 3

def card_class
  @card_class
end

#container_classObject (readonly)

Returns the value of attribute container_class.



3
4
5
# File 'app/components/lean_cms/cards_section_component.rb', line 3

def container_class
  @container_class
end

#gapObject (readonly)

Returns the value of attribute gap.



3
4
5
# File 'app/components/lean_cms/cards_section_component.rb', line 3

def gap
  @gap
end

#grid_colsObject (readonly)

Returns the value of attribute grid_cols.



3
4
5
# File 'app/components/lean_cms/cards_section_component.rb', line 3

def grid_cols
  @grid_cols
end

#icon_bg_gradientObject (readonly)

Returns the value of attribute icon_bg_gradient.



3
4
5
# File 'app/components/lean_cms/cards_section_component.rb', line 3

def icon_bg_gradient
  @icon_bg_gradient
end

#icon_shapeObject (readonly)

Returns the value of attribute icon_shape.



3
4
5
# File 'app/components/lean_cms/cards_section_component.rb', line 3

def icon_shape
  @icon_shape
end

#icon_sizeObject (readonly)

Returns the value of attribute icon_size.



3
4
5
# File 'app/components/lean_cms/cards_section_component.rb', line 3

def icon_size
  @icon_size
end

#ignore_card_bgObject (readonly)

Returns the value of attribute ignore_card_bg.



3
4
5
# File 'app/components/lean_cms/cards_section_component.rb', line 3

def ignore_card_bg
  @ignore_card_bg
end

#scroll_animateObject (readonly)

Returns the value of attribute scroll_animate.



3
4
5
# File 'app/components/lean_cms/cards_section_component.rb', line 3

def scroll_animate
  @scroll_animate
end

#sectionObject (readonly)

Returns the value of attribute section.



3
4
5
# File 'app/components/lean_cms/cards_section_component.rb', line 3

def section
  @section
end

#stagger_delayObject (readonly)

Returns the value of attribute stagger_delay.



3
4
5
# File 'app/components/lean_cms/cards_section_component.rb', line 3

def stagger_delay
  @stagger_delay
end

#text_alignObject (readonly)

Returns the value of attribute text_align.



3
4
5
# File 'app/components/lean_cms/cards_section_component.rb', line 3

def text_align
  @text_align
end