MiniDevil As beautiful as a shell
welcome_loading.c
Go to the documentation of this file.
1 /* ************************************************************************** */
2 /* */
3 /* ::: :::::::: */
4 /* welcome_loading.c :+: :+: :+: */
5 /* +:+ +:+ +:+ */
6 /* By: baelgadi <baelgadi@student.42.fr> +#+ +:+ +#+ */
7 /* +#+#+#+#+#+ +#+ */
8 /* Created: 2026/02/17 17:50:06 by zotaj-di #+# #+# */
9 /* Updated: 2026/03/04 03:59:50 by baelgadi ### ########.fr */
10 /* */
11 /* ************************************************************************** */
12 
13 #include "welcome_ui.h"
14 
21 {
22  int row;
23  const char *credits;
24 
25  credits = "✧ Crafted by Lhorse & Pedro ✧";
26  row = t->center_y + 9;
27  print_centered(t, row, DIM C_AURA4, 0);
28  print_at_pos(row, (t->width - 29) / 2, "");
29  ft_printf("%s%s%s%s", DIM, C_M3, credits, RESET);
30 }
31 
38 {
39  int row;
40  int i;
41 
42  row = t->center_y + 11;
43  print_centered(t, row, C_AURA2 "░░░░░░░░░░" RESET, 10);
44  i = -1;
45  while (++i < 10)
46  {
47  print_at_pos(row, (t->width - 10) / 2 + i, C_M3 "▓" RESET);
48  ft_msleep(100);
49  }
50  ft_msleep(200);
51 }
#define RESET
Definition: minishell_ui.h:37
#define DIM
Definition: minishell_ui.h:39
Extended terminal info (for welcome screen pos)
Definition: welcome_ui.h:49
int width
Terminal width.
Definition: welcome_ui.h:50
int center_y
Vertical center row.
Definition: welcome_ui.h:53
void animate_credits(t_welcome_term *t)
Print the credits line centered on the screen.
void animate_loading(t_welcome_term *t)
Animate a progress bar.
Welcome screen structures & prototypes.
#define C_AURA4
Definition: welcome_ui.h:31
#define C_M3
Definition: welcome_ui.h:37
#define C_AURA2
Definition: welcome_ui.h:29
void print_centered(t_welcome_term *t, int row, const char *str, int len)
Print string centered on the given row.
Definition: welcome_utils.c:90
void ft_msleep(int ms)
Sleep for approximately ms millisecondes using a little trick.
Definition: welcome_utils.c:28
void print_at_pos(int row, int col, const char *str)
Move the terminal cursor to [row, col] and print str.
Definition: welcome_utils.c:77