isitcringetomakeit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +304 -0
- package/package.json +19 -0
package/index.js
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const readline = require('readline');
|
|
4
|
+
const chalk = require('chalk');
|
|
5
|
+
const cfonts = require('cfonts');
|
|
6
|
+
|
|
7
|
+
const tabs = ['Home', 'Cute Notes', 'Gallery', 'Things you Like', 'Things I Like', 'Something I wanna tell you'];
|
|
8
|
+
let activeTab = 0;
|
|
9
|
+
|
|
10
|
+
let animationInterval = null;
|
|
11
|
+
let timeouts = [];
|
|
12
|
+
|
|
13
|
+
// Hide cursor to prevent flickering
|
|
14
|
+
process.stdout.write('\x1B[?25l');
|
|
15
|
+
|
|
16
|
+
function clearTimeoutsAndIntervals() {
|
|
17
|
+
if (animationInterval) {
|
|
18
|
+
clearInterval(animationInterval);
|
|
19
|
+
animationInterval = null;
|
|
20
|
+
}
|
|
21
|
+
timeouts.forEach(clearTimeout);
|
|
22
|
+
timeouts = [];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function renderHeader(fullClear = false) {
|
|
26
|
+
if (fullClear) {
|
|
27
|
+
console.clear();
|
|
28
|
+
} else {
|
|
29
|
+
// Move cursor to top-left and clear down to prevent full terminal flash (animation on top)
|
|
30
|
+
process.stdout.write('\x1B[0;0H\x1B[0J');
|
|
31
|
+
}
|
|
32
|
+
let header = "";
|
|
33
|
+
tabs.forEach((tab, index) => {
|
|
34
|
+
if (index === activeTab) {
|
|
35
|
+
header += chalk.bgWhite.black.bold(` [ ${tab} ] `) + " ";
|
|
36
|
+
} else {
|
|
37
|
+
header += chalk.bold(` [ ${tab} ] `) + " ";
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
console.log("\n" + header + "\n");
|
|
41
|
+
console.log(chalk.gray("=================================================================================\n"));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function renderFooter() {
|
|
45
|
+
console.log(chalk.gray("\n================================================================================="));
|
|
46
|
+
console.log(chalk.cyan("Use ← and → arrows to navigate. Press Q or Ctrl+C to quit.\n"));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ---------------------------------------------------------
|
|
50
|
+
// Tab 0: Home (Beating Heart)
|
|
51
|
+
// ---------------------------------------------------------
|
|
52
|
+
const heart1 = `
|
|
53
|
+
|
|
54
|
+
**** ****
|
|
55
|
+
** ** ** **
|
|
56
|
+
* * * *
|
|
57
|
+
* * *
|
|
58
|
+
* *
|
|
59
|
+
* *
|
|
60
|
+
* *
|
|
61
|
+
* *
|
|
62
|
+
*
|
|
63
|
+
`;
|
|
64
|
+
const heart2 = `
|
|
65
|
+
|
|
66
|
+
****** ******
|
|
67
|
+
** ** ** **
|
|
68
|
+
* * *
|
|
69
|
+
* *
|
|
70
|
+
* *
|
|
71
|
+
* *
|
|
72
|
+
* *
|
|
73
|
+
* *
|
|
74
|
+
* *
|
|
75
|
+
*
|
|
76
|
+
`;
|
|
77
|
+
const heart3 = `
|
|
78
|
+
******** ********
|
|
79
|
+
** *** **
|
|
80
|
+
* *
|
|
81
|
+
* *
|
|
82
|
+
* *
|
|
83
|
+
* *
|
|
84
|
+
* *
|
|
85
|
+
* *
|
|
86
|
+
* *
|
|
87
|
+
*
|
|
88
|
+
`;
|
|
89
|
+
const hearts = [heart1, heart2, heart3, heart2];
|
|
90
|
+
|
|
91
|
+
function renderHome(frame, fullClear) {
|
|
92
|
+
renderHeader(fullClear);
|
|
93
|
+
const heartFrame = hearts[frame % hearts.length];
|
|
94
|
+
console.log(chalk.red.bold(heartFrame));
|
|
95
|
+
console.log(chalk.magenta.bold(" I LOVE YOU SO MUCH! ❤️\n"));
|
|
96
|
+
console.log(chalk.cyan(" (Just thought you should know)\n"));
|
|
97
|
+
renderFooter();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// ---------------------------------------------------------
|
|
101
|
+
// Tab 1: Cute Notes
|
|
102
|
+
// ---------------------------------------------------------
|
|
103
|
+
const notes = [
|
|
104
|
+
[
|
|
105
|
+
"Tere dil mai mujhe aisi umar kaid chahiye",
|
|
106
|
+
"ki ye saare vakeel thak jaaye",
|
|
107
|
+
"lekin mujhe zamanat na dila paye 🥺"
|
|
108
|
+
],
|
|
109
|
+
[
|
|
110
|
+
"Teri khoobsurti ka kya kehna,",
|
|
111
|
+
"Chaand bhi tujhe dekh kar sharma jaaye.",
|
|
112
|
+
"Jab tu muskuraye saamne mere,",
|
|
113
|
+
"Dil bas tujhme hi kho jaaye."
|
|
114
|
+
],
|
|
115
|
+
[
|
|
116
|
+
"Tu sirf khoobsurat nahi,",
|
|
117
|
+
"Meri duaon ka sabse haseen jawab hai."
|
|
118
|
+
]
|
|
119
|
+
];
|
|
120
|
+
|
|
121
|
+
function renderNotes() {
|
|
122
|
+
renderHeader(true);
|
|
123
|
+
console.log(""); // Spacing at the top
|
|
124
|
+
|
|
125
|
+
const width = 45; // Width of the inner box
|
|
126
|
+
const border = chalk.magenta(" +" + "-".repeat(width) + "+");
|
|
127
|
+
const pad = chalk.magenta(" |" + " ".repeat(width) + "|");
|
|
128
|
+
|
|
129
|
+
notes.forEach(noteLines => {
|
|
130
|
+
console.log(border);
|
|
131
|
+
console.log(pad);
|
|
132
|
+
noteLines.forEach(line => {
|
|
133
|
+
// Pad the text so the right borders perfectly align
|
|
134
|
+
const paddedLine = line.padEnd(width - 2, ' ');
|
|
135
|
+
console.log(chalk.magenta(" | ") + chalk.yellow.bold(paddedLine) + chalk.magenta(" |"));
|
|
136
|
+
});
|
|
137
|
+
console.log(pad);
|
|
138
|
+
console.log(border);
|
|
139
|
+
console.log(""); // Gap between stacked notes
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
renderFooter();
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// ---------------------------------------------------------
|
|
146
|
+
// Tab 2: Gallery
|
|
147
|
+
// ---------------------------------------------------------
|
|
148
|
+
function renderGallery() {
|
|
149
|
+
renderHeader(true);
|
|
150
|
+
const text = cfonts.render('Coming SOON', {
|
|
151
|
+
font: 'block',
|
|
152
|
+
colors: ['cyan', 'white'],
|
|
153
|
+
align: 'center',
|
|
154
|
+
space: false
|
|
155
|
+
});
|
|
156
|
+
console.log("\n" + text.string);
|
|
157
|
+
console.log(chalk.gray(" Hehe\n\n"));
|
|
158
|
+
renderFooter();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// ---------------------------------------------------------
|
|
162
|
+
// Tab 3: Things You Like
|
|
163
|
+
// ---------------------------------------------------------
|
|
164
|
+
function renderThingsYouLike() {
|
|
165
|
+
renderHeader(true);
|
|
166
|
+
|
|
167
|
+
console.log("\n");
|
|
168
|
+
console.log(chalk.green.bold(" ❤️ Moon"));
|
|
169
|
+
console.log(chalk.green.bold(" ❤️ Diet Coke"));
|
|
170
|
+
console.log(chalk.green.bold(" ❤️ Soya Chaamp"));
|
|
171
|
+
console.log(chalk.green.bold(" ❤️ Mooscilesss"));
|
|
172
|
+
console.log(chalk.green.bold(" ❤️ Kawaali"));
|
|
173
|
+
console.log(chalk.green.bold(" ❤️ Rasmalai\n"));
|
|
174
|
+
renderFooter();
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// ---------------------------------------------------------
|
|
178
|
+
// Tab 4: Things I Like
|
|
179
|
+
// ---------------------------------------------------------
|
|
180
|
+
let thingsILikeState = 0; // 0 = Ehhh, 1 = Just Kidding, 2 = List
|
|
181
|
+
function renderThingsILike() {
|
|
182
|
+
if (thingsILikeState === 0) {
|
|
183
|
+
renderHeader(true);
|
|
184
|
+
const text = cfonts.render('Ehhh...', { font: 'block', colors: ['gray'], align: 'center', space: false });
|
|
185
|
+
console.log("\n" + text.string + "\n");
|
|
186
|
+
renderFooter();
|
|
187
|
+
} else if (thingsILikeState === 1) {
|
|
188
|
+
renderHeader(true);
|
|
189
|
+
const text = cfonts.render('Just Kidding!', { font: 'block', colors: ['yellow', 'magenta'], align: 'center', space: false });
|
|
190
|
+
console.log("\n" + text.string + "\n");
|
|
191
|
+
renderFooter();
|
|
192
|
+
} else if (thingsILikeState === 2) {
|
|
193
|
+
renderHeader(true);
|
|
194
|
+
console.log(chalk.magenta.bold(`
|
|
195
|
+
💖 Your face
|
|
196
|
+
💖 Your smile
|
|
197
|
+
💖 Your ears
|
|
198
|
+
💖 Your zulfein
|
|
199
|
+
💖 The way you laugh
|
|
200
|
+
💖 How you care for me
|
|
201
|
+
💖 Your cute little expressions
|
|
202
|
+
💖 The way you understand me
|
|
203
|
+
💖 Your voice
|
|
204
|
+
💖 Your kindness
|
|
205
|
+
💖 The way you make me feel special
|
|
206
|
+
💖 Your eyes when you look at me
|
|
207
|
+
💖 Your honesty
|
|
208
|
+
💖 Your hugs
|
|
209
|
+
💖 The way you stay by my side
|
|
210
|
+
💖 Your silly mood swings
|
|
211
|
+
💖 Your confidence
|
|
212
|
+
💖 The way you say my name
|
|
213
|
+
💖 Your presence that makes everything better
|
|
214
|
+
💖 you ❤️
|
|
215
|
+
`));
|
|
216
|
+
renderFooter();
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// ---------------------------------------------------------
|
|
221
|
+
// Tab 5: Something I wanna tell you
|
|
222
|
+
// ---------------------------------------------------------
|
|
223
|
+
function renderSomething() {
|
|
224
|
+
renderHeader(true);
|
|
225
|
+
const fontOutput = cfonts.render('I LOVE YOU', {
|
|
226
|
+
font: 'block',
|
|
227
|
+
colors: ['red', 'magenta'],
|
|
228
|
+
align: 'left',
|
|
229
|
+
space: false
|
|
230
|
+
});
|
|
231
|
+
console.log(fontOutput.string);
|
|
232
|
+
renderFooter();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// ---------------------------------------------------------
|
|
236
|
+
// Tab Manager
|
|
237
|
+
// ---------------------------------------------------------
|
|
238
|
+
let frame = 0;
|
|
239
|
+
|
|
240
|
+
function startTab() {
|
|
241
|
+
clearTimeoutsAndIntervals();
|
|
242
|
+
frame = 0;
|
|
243
|
+
|
|
244
|
+
if (activeTab === 0) {
|
|
245
|
+
renderHome(frame, true);
|
|
246
|
+
animationInterval = setInterval(() => {
|
|
247
|
+
frame++;
|
|
248
|
+
renderHome(frame, false);
|
|
249
|
+
}, 400);
|
|
250
|
+
} else if (activeTab === 1) {
|
|
251
|
+
renderNotes();
|
|
252
|
+
} else if (activeTab === 2) {
|
|
253
|
+
renderGallery();
|
|
254
|
+
} else if (activeTab === 3) {
|
|
255
|
+
renderThingsYouLike();
|
|
256
|
+
} else if (activeTab === 4) {
|
|
257
|
+
thingsILikeState = 0;
|
|
258
|
+
renderThingsILike();
|
|
259
|
+
|
|
260
|
+
let t1 = setTimeout(() => {
|
|
261
|
+
thingsILikeState = 1;
|
|
262
|
+
renderThingsILike();
|
|
263
|
+
}, 1500);
|
|
264
|
+
|
|
265
|
+
let t2 = setTimeout(() => {
|
|
266
|
+
thingsILikeState = 2;
|
|
267
|
+
renderThingsILike();
|
|
268
|
+
}, 2500);
|
|
269
|
+
|
|
270
|
+
timeouts.push(t1, t2);
|
|
271
|
+
} else if (activeTab === 5) {
|
|
272
|
+
renderSomething();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// ---------------------------------------------------------
|
|
277
|
+
// Setup Input & Start
|
|
278
|
+
// ---------------------------------------------------------
|
|
279
|
+
readline.emitKeypressEvents(process.stdin);
|
|
280
|
+
if (process.stdin.isTTY) {
|
|
281
|
+
process.stdin.setRawMode(true);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
process.stdin.on('keypress', (str, key) => {
|
|
285
|
+
if (key.name === 'q' || (key.ctrl && key.name === 'c')) {
|
|
286
|
+
console.clear();
|
|
287
|
+
process.stdout.write('\x1B[?25h'); // show cursor again
|
|
288
|
+
process.exit();
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
let oldTab = activeTab;
|
|
292
|
+
if (key.name === 'right') {
|
|
293
|
+
activeTab = (activeTab + 1) % tabs.length;
|
|
294
|
+
} else if (key.name === 'left') {
|
|
295
|
+
activeTab = (activeTab - 1 + tabs.length) % tabs.length;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
if (oldTab !== activeTab) {
|
|
299
|
+
startTab();
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
// Start the app
|
|
304
|
+
startTab();
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "isitcringetomakeit",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A cute message for my girlfriend",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": "index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [],
|
|
11
|
+
"author": "",
|
|
12
|
+
"license": "ISC",
|
|
13
|
+
"type": "commonjs",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"cfonts": "^3.3.1",
|
|
16
|
+
"chalk": "^4.1.2",
|
|
17
|
+
"ssh2": "^1.17.0"
|
|
18
|
+
}
|
|
19
|
+
}
|