Archived
1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
cli-old/lib/widgets/logo.rb

36 lines
1,016 B
Ruby
Raw Normal View History

2017-07-22 09:44:43 -04:00
# frozen_string_literal: true
module Widgets
2017-07-29 18:42:39 -04:00
class Logo < React::Component
2017-08-31 01:52:08 -04:00
TMP_LOGO = [
' _____ ___ _ _ ___ _ _ ',
' |_ _/ _ \ \/ / _ \| \ | | ',
' | || | | \ / | | | \| | ',
' | || |_| / \ |_| | |\ | ',
' |_| \___/_/\_\___/|_| \_| ',
' ',
' Version 0.0.0 ',
2017-08-31 01:52:08 -04:00
" API #{Tox::Version::API_VERSION}",
2017-08-31 02:00:41 -04:00
" ABI #{Tox::Version.abi_version}",
' ',
].freeze
2017-07-22 09:44:43 -04:00
2017-08-31 01:52:08 -04:00
WIDTH = TMP_LOGO.first.length
HEIGHT = TMP_LOGO.length
LOGO = TMP_LOGO.map { |s| s.ljust WIDTH }.freeze
2017-07-22 09:44:43 -04:00
def render
2017-07-30 22:05:24 -04:00
create_element :window, x: props[:x], y: props[:y], width: props[:width], height: props[:height] do
create_element :lines do
LOGO.each_with_index do |s|
create_element :line do
create_element :text, text: s, attr: Style.default.logo_attr
end
end
2017-07-22 09:44:43 -04:00
end
end
end
end
end