Sha256: c574f73cc11a40c80a46f42f831c148209a8a39d49496193b83f68f971a23bc7

Contents?: true

Size: 1.32 KB

Versions: 8

Compression:

Stored size: 1.32 KB

Contents

require 'bundler/setup'
require 'whirled_peas'

class TemplateFactory
  TITLE_FONT = :default #roman
  PRIMARY_COLOR = :bright_blue
  SECONDARY_COLOR = :blue
  BG_COLOR = :bright_white

  def build(name, args)
    WhirledPeas.template do |composer, settings|
      settings.set_padding(left: 10, top: 6, right: 10, bottom: 6)
      settings.align = :center
      settings.width = 120
      settings.flow = :t2b
      settings.bold = true
      settings.bg_color = BG_COLOR

      composer.add_box do |composer, settings|
        composer.add_text do |_, settings|
          settings.title_font = TITLE_FONT
          settings.color = PRIMARY_COLOR
          'Visualize'
        end
      end
      composer.add_box do |_, settings|
        settings.set_margin(top: 1)
        settings.color = SECONDARY_COLOR
        "your code's execution with"
      end
      composer.add_box do |composer, settings|
        settings.set_margin(top: 1)
        composer.add_text do |_, settings|
          settings.title_font = TITLE_FONT
          settings.color = PRIMARY_COLOR
          'Whirled Peas'
        end
      end
    end
  end
end

class Application
  def start(producer)
    producer.add_frame('intro', duration: 5)
  end
end

WhirledPeas.configure do |config|
  config.template_factory = TemplateFactory.new
  config.application = Application.new
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
whirled_peas-0.13.0 examples/intro.rb
whirled_peas-0.12.0 examples/intro.rb
whirled_peas-0.11.1 examples/intro.rb
whirled_peas-0.11.0 examples/intro.rb
whirled_peas-0.10.0 examples/intro.rb
whirled_peas-0.9.1 examples/intro.rb
whirled_peas-0.9.0 examples/intro.rb
whirled_peas-0.8.0 examples/intro.rb