MCPcopy Create free account
hub / github.com/GCWing/BitFun / render_logo

Method render_logo

src/apps/cli/src/ui/startup.rs:657–732  ·  view source on GitHub ↗
(&self, frame: &mut Frame, area: Rect)

Source from the content-addressed store, hash-verified

655 }
656
657 fn render_logo(&self, frame: &mut Frame, area: Rect) {
658 let use_fancy_logo = area.width >= 80;
659 let mut lines = vec![];
660 lines.push(Line::from(""));
661
662 if use_fancy_logo {
663 let logo = vec![
664 " ██████╗ ██╗████████╗███████╗██╗ ██╗███╗ ██╗",
665 " ██╔══██╗██║╚══██╔══╝██╔════╝██║ ██║████╗ ██║",
666 " ██████╔╝██║ ██║ █████╗ ██║ ██║██╔██╗ ██║",
667 " ██╔══██╗██║ ██║ ██╔══╝ ██║ ██║██║╚██╗██║",
668 " ██████╔╝██║ ██║ ██║ ╚██████╔╝██║ ╚████║",
669 " ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝",
670 ];
671
672 let colors = [
673 self.theme.primary,
674 self.theme.info,
675 self.theme.success,
676 self.theme.warning,
677 self.theme.error,
678 self.theme.muted,
679 ];
680
681 for (i, line) in logo.iter().enumerate() {
682 lines.push(Line::from(Span::styled(
683 *line,
684 Style::default()
685 .fg(colors[i % colors.len()])
686 .add_modifier(Modifier::BOLD),
687 )));
688 }
689 } else {
690 let logo = vec![
691 " ____ _ _ _____ ",
692 " | __ )(_) |_| ___| _ _ __ ",
693 " | _ \\| | __| |_ | | | | '_ \\ ",
694 " | |_) | | |_| _|| |_| | | | |",
695 " |____/|_|\\__|_| \\__,_|_| |_|",
696 ];
697
698 let colors = [
699 self.theme.primary,
700 self.theme.info,
701 self.theme.success,
702 self.theme.warning,
703 self.theme.error,
704 ];
705
706 for (i, line) in logo.iter().enumerate() {
707 lines.push(Line::from(Span::styled(
708 *line,
709 Style::default()
710 .fg(colors[i % colors.len()])
711 .add_modifier(Modifier::BOLD),
712 )));
713 }
714 }

Callers 1

render_mainMethod · 0.80

Calls 3

iterMethod · 0.80
pushMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected