Skip to content

Commit

Permalink
Updated app name and homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-cpsn committed Feb 6, 2024
1 parent 0053d10 commit a613a4b
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 14 deletions.
113 changes: 105 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "tui-quest"
name = "atac"
version = "0.1.0"
edition = "2021"

Expand All @@ -12,4 +12,5 @@ reqwest = "0.11.24"
strum = "0.26.1"
throbber-widgets-tui = "0.3.0"
tokio = { version = "1.0.0", features = ["rt", "rt-multi-thread", "macros"] }
tui-big-text = "0.3.6"
tui-textarea = { version = "0.4.0", features = ["ratatui"] }
52 changes: 47 additions & 5 deletions src/app/ui.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use ratatui::backend::Backend;
use ratatui::{Frame, Terminal};
use ratatui::layout::{Alignment, Constraint, Direction, Layout, Margin, Rect};
use ratatui::layout::Direction::{Horizontal, Vertical};
use ratatui::prelude::{Modifier, Style};
use ratatui::style::{Color, Stylize};
use ratatui::widgets::{Block, Borders, List, ListItem, Padding, Paragraph, Scrollbar, ScrollbarOrientation, Tabs};
use strum::IntoEnumIterator;
use tui_big_text::{BigTextBuilder, PixelSize};
use crate::app::app::{App, AppState};
use crate::app::tabs::tabs::RequestTabs;
use crate::request::method::get_method_bg;
Expand All @@ -28,7 +30,7 @@ impl App<'_> {
// HEADER

let header = Block::new()
.title("* TUI-Quest *")
.title("* ATAC *")
.add_modifier(Modifier::BOLD)
.add_modifier(Modifier::ITALIC)
.title_alignment(Alignment::Center)
Expand Down Expand Up @@ -299,10 +301,50 @@ impl App<'_> {
}

fn render_homepage(&mut self, frame: &mut Frame, rect: Rect) {
frame.render_widget(
Paragraph::new("\nWelcome to TUI-Quest\nhttps://github.com/Julien-cpsn/TUI-Quest").centered(),
rect
);
let block = Block::new();

let inner_block_area = block.inner(rect);

let inner_layout = Layout::new(
Vertical,
[
Constraint::Percentage(50),
Constraint::Length(1),
Constraint::Length(4),
Constraint::Length(1),
Constraint::Percentage(50)
]
)
.split(inner_block_area);

let title_length = 16;

let title_layout = Layout::new(
Horizontal,
[
Constraint::Percentage((100-title_length)/2+2),
Constraint::Length(title_length),
Constraint::Percentage((100-title_length)/2),
]
)
.split(inner_layout[2]);

let title = BigTextBuilder::default()
.pixel_size(PixelSize::Quadrant)
.lines([
"ATAC".into(),
])
.build()
.unwrap();


let welcome_to = Paragraph::new("Welcome to").centered();
let description = Paragraph::new("{A}rguably a {T}UI {A}PI {C}lient").centered();

frame.render_widget(block, rect);
frame.render_widget(welcome_to, inner_layout[1]);
frame.render_widget(title, title_layout[1]);
frame.render_widget(description, inner_layout[3]);
}

pub fn draw(&mut self, terminal: &mut Terminal<impl Backend>) -> std::io::Result<()> {
Expand Down

0 comments on commit a613a4b

Please sign in to comment.