-
Notifications
You must be signed in to change notification settings - Fork 0
/
Animation.cpp
125 lines (115 loc) · 2.89 KB
/
Animation.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#include "Animation.h"
#include <Windows.h>
#include <conio.h>
#include <iostream>
#include <string>
using namespace std;
//one point of char
void Animation::points()
{
string s;
s = char(176);
colorize_text(s, 17); colorize_text(s, 17);
}
//exit
int Animation::exit()
{
system("cls");
cout << endl << endl;
cout << "\r\tIt was our project. Thanks for coming!" << endl;
cout << endl;
cout << "\t| | |" << endl;
cout << "\t| | |" << endl;
cout << "\t| O |" << endl;
cout << "\t| /|\\ |" << endl;
cout << "\t| | |" << endl;
cout << "\t| / \\ |" << endl;
cout << "\t| +----------+ |" << endl;
cout << "\t| | | |" << endl;
cout << endl;
while (true)
{
if (_kbhit())
{
char ch = _getch();
switch (ch)
{
default:
system("pause");
return 0;
}
}
}
}
//initializing
void Animation::initializing()
{
int color = 17;
cout << endl;
draw_border(30, color);
frame_phrase(" ", color);
frame_phrase(" LOGGED IN ", color);
frame_phrase(" SUCCESSFULLY. ", color);
frame_phrase(" ", color);
draw_border(30, color);
Sleep(300);
system("cls");
cout << endl;
draw_border(30, color);
frame_phrase(" ", color);
frame_phrase(" LOGGED IN ", color);
frame_phrase(" SUCCESSFULLY.. ", color);
frame_phrase(" ", color);
draw_border(30, color);
Sleep(300);
system("cls");
cout << endl;
draw_border(30, color);
frame_phrase(" ", color);
frame_phrase(" LOGGED IN ", color);
frame_phrase(" SUCCESSFULLY... ", color);
frame_phrase(" ", color);
draw_border(30, color);
Sleep(300);
system("cls");
}
//phrase in borders
void Animation::frame_phrase(string phrase, int color, int count)
{
string ch;
ch = char(176);
for (int i = 0; i < count; i++)
{
cout << "\t";
}
colorize_text(ch, color);
colorize_text(ch, color);
cout << phrase;
colorize_text(ch, color);
colorize_text(ch, color);
cout << endl;
}
//draw borders
void Animation::draw_border(int amount, int color, int count)
{
string g;
g = char(176);
for (int i = 0; i < count; i++)
{
cout << "\t";
}
for (int i = 0; i < amount; i++)
{
colorize_text(g, color);
}
cout << endl;
}
//colorize text
void Animation::colorize_text(string text, int color)
{
int color_white = 15;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsole, color);
cout << text;
SetConsoleTextAttribute(hConsole, color_white);
}