MiniDevil As beautiful as a shell
welcome_ui.h
Go to the documentation of this file.
1 /* ************************************************************************** */
2 /* */
3 /* ::: :::::::: */
4 /* welcome_ui.h :+: :+: :+: */
5 /* +:+ +:+ +:+ */
6 /* By: baelgadi <baelgadi@student.42.fr> +#+ +:+ +#+ */
7 /* +#+#+#+#+#+ +#+ */
8 /* Created: 2025/11/17 00:00:00 by Shawz #+# #+# */
9 /* Updated: 2026/03/11 02:54:07 by baelgadi ### ########.fr */
10 /* */
11 /* ************************************************************************** */
12 
13 #ifndef WELCOME_UI_H
14 # define WELCOME_UI_H
15 
16 # include "minishell_ui.h"
17 
18 /* ────────────────────────────────────────────────── */
19 /* ───────── WELCOME SCREEN COLOR PALETTE ─────────── */
20 /* (Fire & Blood theme - Hell mode) */
21 /* ────────────────────────────────────────────────── */
22 
23 /* Additional cursor controls for welcome screen */
24 # define HIDE_CURSOR "\033[?25l"
25 # define SHOW_CURSOR "\033[?25h"
26 
27 /* Blood gradient (Dark Red > Bright Red - borders, demon body, loading bg) */
28 # define C_AURA1 "\033[38;5;52m"
29 # define C_AURA2 "\033[38;5;88m"
30 # define C_AURA3 "\033[38;5;124m"
31 # define C_AURA4 "\033[38;5;160m"
32 # define C_AURA5 "\033[38;5;196m"
33 
34 /* Fire gradient (Red -> Orange -> Yellow - title, prompt, cursor, eyes) */
35 # define C_M1 "\033[38;5;196m"
36 # define C_M2 "\033[38;5;202m"
37 # define C_M3 "\033[38;5;208m"
38 # define C_M4 "\033[38;5;214m"
39 # define C_M5 "\033[38;5;220m"
40 
41 /* ────────────────────────────────────────────────── */
42 /* ────────────────── STRUCTURE ───────────────────── */
43 /* ────────────────────────────────────────────────── */
44 
48 typedef struct s_welcome_term
49 {
50  int width;
51  int height;
52  int center_x;
53  int center_y;
55 
56 /* ────────────────────────────────────────────────── */
57 /* ───────────── DEMON ART DIMENSIONS ─────────────── */
58 /* ────────────────────────────────────────────────── */
59 
60 # define DEMON_WIDTH 60
61 # define DEMON_HEIGHT 16
62 # define DEMON_LINES 16
63 
64 /* ────────────────────────────────────────────────── */
65 /* ────────────────── FUNCTIONS ───────────────────── */
66 /* ────────────────────────────────────────────────── */
67 
68 /* ────────────── welcome.c ──────────────── */
69 
70 void draw_welcome(void);
71 
72 /* ────────────── welcome_effects.c ──────────────── */
73 
75 
77 
79 
81 
82 /* ────────────── welcome_demon.c ──────────────── */
83 
85 
87 
88 const char *get_demon_art_line(int line);
89 
90 /* ────────────── welcome_utils.c ──────────────── */
91 
93 
94 void print_at_pos(int row, int col, const char *str);
95 
96 void print_centered(t_welcome_term *t, int row, const char *str,
97  int len);
98 
99 #endif
UI mode structures, macros & function prototypes.
Extended terminal info (for welcome screen pos)
Definition: welcome_ui.h:49
int center_x
Horizontal center col.
Definition: welcome_ui.h:52
int height
Terminal height.
Definition: welcome_ui.h:51
int width
Terminal width.
Definition: welcome_ui.h:50
int center_y
Vertical center row.
Definition: welcome_ui.h:53
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 animate_credits(t_welcome_term *t)
Print the credits line centered on the screen.
void flash_demon_eyes(t_welcome_term *t)
Animate the demon's eyes blinking.
const char * get_demon_art_line(int line)
Return 1 line of the ASCII Demon art by index.
Definition: welcome_demon.c:21
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
void animate_quote(t_welcome_term *t)
Draw the quote inside a decorative box.
void animate_title(t_welcome_term *t)
Animate the title appearing character by character.
void animate_demon(t_welcome_term *t)
Animate the Demon art with 100ms delay.
Definition: welcome_demon.c:99
void draw_welcome(void)
Draw complete welcome animation sequence and clean up.
Definition: welcome.c:68
void get_welcome_term_size(t_welcome_term *t)
Get the terminal size and calculate centre coordinates.
Definition: welcome_utils.c:52
void animate_loading(t_welcome_term *t)
Animate a progress bar.