defmodule BCUtils.Banner do @moduledoc """ Provides functionality to display a startup banner. """ def display_banner(:server) do beam_section = beam_ascii_art() campus_section = campus_ascii_art() server_section = """ ExESDB Server Event Store Database System 🚀 Ready to serve! """ show_banner(beam_section, campus_section, server_section, :server) end def display_banner(:gateway) do beam_section = beam_ascii_art() campus_section = campus_ascii_art() gateway_section = """ ExESDB Gateway API Gateway Service 🌐 Ready to route! """ show_banner(beam_section, campus_section, gateway_section, :gateway) end defp beam_ascii_art do """ ██████╗ ███████╗ █████╗ ███╗ ███╗ ██╔══██╗██╔════╝██╔══██╗████╗ ████║ ██████╔╝█████╗ ███████║██╔████╔██║ ██╔══██╗██╔══╝ ██╔══██║██║╚██╔╝██║ ██████╔╝███████╗██║ ██║██║ ╚═╝ ██║ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ """ end defp campus_ascii_art do """ ██████╗ █████╗ ███╗ ███╗██████╗ ██╗ ██╗███████╗ ██╔════╝██╔══██╗████╗ ████║██╔══██╗██║ ██║██╔════╝ ██║ ███████║██╔████╔██║██████╔╝██║ ██║███████╗ ██║ ██╔══██║██║╚██╔╝██║██╔═══╝ ██║ ██║╚════██║ ╚██████╗██║ ██║██║ ╚═╝ ██║██║ ╚██████╔╝███████║ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚══════╝ """ end defp show_banner(beam_section, campus_section, service_section, type) do color_reset = "\e[0m" # Blue color_beam = "\e[34m" # Green color_campus = "\e[32m" color_service = case type do # Purple :server -> "\e[35m" # Cyan :gateway -> "\e[36m" _ -> "\e[0m" end IO.puts(color_beam <> beam_section <> color_reset) IO.puts(color_campus <> campus_section <> color_reset) IO.puts(color_service <> service_section <> color_reset) end end