subhadip-a063 1.0.1
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 +294 -0
- package/package.json +29 -0
package/index.js
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
import boxen from "boxen";
|
|
5
|
+
import terminalLink from "terminal-link";
|
|
6
|
+
import gradient from "gradient-string";
|
|
7
|
+
import cliWidth from "cli-width";
|
|
8
|
+
import cfonts from "cfonts";
|
|
9
|
+
import stripAnsi from "strip-ansi";
|
|
10
|
+
import readline from "readline";
|
|
11
|
+
|
|
12
|
+
// Brand gradient
|
|
13
|
+
const brandGradient = gradient(["#8FC47B", "#b56b36"]);
|
|
14
|
+
|
|
15
|
+
// ----------------------
|
|
16
|
+
// STATIC DATA (Editable)
|
|
17
|
+
// ----------------------
|
|
18
|
+
|
|
19
|
+
const DATA = {
|
|
20
|
+
projects: [
|
|
21
|
+
{
|
|
22
|
+
name: "NIXGn - Next-Gen Intelligence Execution Group",
|
|
23
|
+
live: "https://nixgn.com",
|
|
24
|
+
github: "private"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "Next.Ref_Alumni-Connect",
|
|
28
|
+
live: "https://next-reff-alumni-connect.vercel.app",
|
|
29
|
+
github: "https://github.com/Subhadipjana95/Next.Ref_Alumni-Connect"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "Kisan-Mitra",
|
|
33
|
+
live: "https://kisan-mitra-app.vercel.app",
|
|
34
|
+
github: "https://github.com/Subhadipjana95/Kisan-Mitra"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "EnviroMat",
|
|
38
|
+
live: "https://enviro-mat.vercel.app",
|
|
39
|
+
github: "https://github.com/Subhadipjana95/EnviroMat"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
skills: [
|
|
43
|
+
"Next.js",
|
|
44
|
+
"React.js",
|
|
45
|
+
"JavaScript",
|
|
46
|
+
"TypeScript",
|
|
47
|
+
"Tailwind CSS",
|
|
48
|
+
"Framer Motion",
|
|
49
|
+
"GSAP",
|
|
50
|
+
"Three.js",
|
|
51
|
+
"WebGL",
|
|
52
|
+
"HTML",
|
|
53
|
+
"CSS",
|
|
54
|
+
"Figma",
|
|
55
|
+
"Canva",
|
|
56
|
+
"Adobe Illustrator",
|
|
57
|
+
"Firebase",
|
|
58
|
+
"MongoDB",
|
|
59
|
+
"Git",
|
|
60
|
+
"GitHub",
|
|
61
|
+
"Vercel",
|
|
62
|
+
"Netlify",
|
|
63
|
+
"Search Engine Optimization (SEO)",
|
|
64
|
+
"Performance Optimization",
|
|
65
|
+
"Cross-Browser Compatibility",
|
|
66
|
+
"Responsive Design",
|
|
67
|
+
"GraphicDesign",
|
|
68
|
+
"UI/UX Design Principles",
|
|
69
|
+
"C",
|
|
70
|
+
"Java",
|
|
71
|
+
"Python",
|
|
72
|
+
],
|
|
73
|
+
experience: [
|
|
74
|
+
"Co-Founder @ NIXGN",
|
|
75
|
+
"Design Core Team Member @GDG on Campus NSEC",
|
|
76
|
+
"4x Hackathon Winner",
|
|
77
|
+
"Freelancer - UI/UX Design & Frontend Deve"
|
|
78
|
+
],
|
|
79
|
+
hackathons: [
|
|
80
|
+
"🥇 Think 3D – 1st Place",
|
|
81
|
+
"Cosmo Hack 1.0 - 2nd Runner Up & Aptos Track Winner",
|
|
82
|
+
"HackSpire'25 - UI/UX Track Winner",
|
|
83
|
+
"Smart Make-A-Thon - 2nd Runner Up",
|
|
84
|
+
],
|
|
85
|
+
education: [
|
|
86
|
+
"B.Tech CSE – Netaji Subhash Engineering College(MAKAUT) | 2023-2027"
|
|
87
|
+
]
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// ----------------------
|
|
91
|
+
// INFO BOX
|
|
92
|
+
// ----------------------
|
|
93
|
+
|
|
94
|
+
const info = `
|
|
95
|
+
${chalk.bold("🚀 Co-Founder @NIXGN")}
|
|
96
|
+
${chalk.gray("Design Engineer | UI/UX Designer | Frontend Dev")}
|
|
97
|
+
|
|
98
|
+
${chalk.cyan("🌐 Portfolio")} ${terminalLink("→", "https://a063.xyz")}
|
|
99
|
+
${chalk.green("🐙 GitHub")} ${terminalLink("→", "https://github.com/Subhadipjana95")}
|
|
100
|
+
${chalk.blue("💼 LinkedIn")} ${terminalLink("→", "https://linkedin.com/in/subhadipjana095")}
|
|
101
|
+
|
|
102
|
+
${chalk.yellow("Run:")} npx subhadip-a063
|
|
103
|
+
`;
|
|
104
|
+
|
|
105
|
+
// ----------------------
|
|
106
|
+
// RENDER UI
|
|
107
|
+
// ----------------------
|
|
108
|
+
|
|
109
|
+
function render() {
|
|
110
|
+
console.clear();
|
|
111
|
+
const width = cliWidth();
|
|
112
|
+
|
|
113
|
+
const ascii = cfonts.render("SUBHADIP", {
|
|
114
|
+
font: "block",
|
|
115
|
+
align: "left",
|
|
116
|
+
letterSpacing: 1,
|
|
117
|
+
lineHeight: 1,
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const bannerLines = ascii.string.split("\n");
|
|
121
|
+
const maxLineLength = Math.max(...bannerLines.map(l => l.length));
|
|
122
|
+
|
|
123
|
+
const centeredBanner = bannerLines
|
|
124
|
+
.map(line => {
|
|
125
|
+
const paddedLine = line.padEnd(maxLineLength);
|
|
126
|
+
const padding = Math.max(0, Math.floor((width - maxLineLength) / 2));
|
|
127
|
+
return " ".repeat(padding) + brandGradient(paddedLine);
|
|
128
|
+
})
|
|
129
|
+
.join("\n");
|
|
130
|
+
|
|
131
|
+
console.log(centeredBanner);
|
|
132
|
+
|
|
133
|
+
// Prompt text
|
|
134
|
+
const promptText = "sandbox-exec (minimal) subhadip-a063 CLI v2.0";
|
|
135
|
+
const promptPadding = Math.max(0, Math.floor((width - promptText.length) / 2));
|
|
136
|
+
|
|
137
|
+
console.log(" ".repeat(promptPadding) + chalk.gray(promptText));
|
|
138
|
+
console.log("");
|
|
139
|
+
|
|
140
|
+
// Info box
|
|
141
|
+
const box = boxen(info.trim(), {
|
|
142
|
+
padding: 1,
|
|
143
|
+
borderStyle: "round",
|
|
144
|
+
borderColor: "#8FC47B",
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
const boxLines = box.split("\n");
|
|
148
|
+
|
|
149
|
+
const centeredBox = boxLines
|
|
150
|
+
.map(line => {
|
|
151
|
+
const visibleLength = stripAnsi(line).length;
|
|
152
|
+
const padding = Math.max(0, Math.floor((width - visibleLength) / 2));
|
|
153
|
+
return " ".repeat(padding) + line;
|
|
154
|
+
})
|
|
155
|
+
.join("\n");
|
|
156
|
+
|
|
157
|
+
console.log(centeredBox);
|
|
158
|
+
|
|
159
|
+
// renderFooter();
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// ----------------------
|
|
163
|
+
// FOOTER
|
|
164
|
+
// ----------------------
|
|
165
|
+
|
|
166
|
+
// function renderFooter() {
|
|
167
|
+
// const width = cliWidth();
|
|
168
|
+
// const footer = "Type commands to get more info | Type 'help' for commands";
|
|
169
|
+
// const padding = Math.max(0, Math.floor((width - footer.length) / 2));
|
|
170
|
+
// console.log(" ".repeat(padding) + chalk.gray(footer));
|
|
171
|
+
// }
|
|
172
|
+
|
|
173
|
+
// ----------------------
|
|
174
|
+
// INTERACTIVE MODE
|
|
175
|
+
// ----------------------
|
|
176
|
+
|
|
177
|
+
const rl = readline.createInterface({
|
|
178
|
+
input: process.stdin,
|
|
179
|
+
output: process.stdout
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
function startInteractiveMode() {
|
|
183
|
+
const width = cliWidth();
|
|
184
|
+
const boxWidth = 50;
|
|
185
|
+
const pad = Math.max(0, Math.floor((width - boxWidth) / 2));
|
|
186
|
+
const indent = " ".repeat(pad);
|
|
187
|
+
const b = chalk.hex("#8FC47B");
|
|
188
|
+
|
|
189
|
+
// Draw top border and hint
|
|
190
|
+
console.log("");
|
|
191
|
+
console.log(indent + b("╭" + "─".repeat(boxWidth - 2) + "╮"));
|
|
192
|
+
console.log(indent + b("│") + chalk.gray(" Type: help | projects | skills | exit".padEnd(boxWidth - 2)) + b("│"));
|
|
193
|
+
console.log(indent + b("├" + "─".repeat(boxWidth - 2) + "┤"));
|
|
194
|
+
console.log(indent + b("│") + " ".repeat(boxWidth - 2) + b("│"));
|
|
195
|
+
console.log(indent + b("╰" + "─".repeat(boxWidth - 2) + "╯"));
|
|
196
|
+
|
|
197
|
+
// Move cursor up 1 line (onto the empty input row)
|
|
198
|
+
process.stdout.write("\x1B[2A\r");
|
|
199
|
+
|
|
200
|
+
// Prompt with left border character
|
|
201
|
+
const promptPrefix = indent + b("│ ") + chalk.green("❯ ");
|
|
202
|
+
|
|
203
|
+
rl.question(promptPrefix, (answer) => {
|
|
204
|
+
// Move cursor down past the bottom border
|
|
205
|
+
process.stdout.write("\n\n");
|
|
206
|
+
handleCommand(answer.trim().toLowerCase());
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function handleCommand(cmd) {
|
|
211
|
+
console.clear();
|
|
212
|
+
const width = cliWidth();
|
|
213
|
+
|
|
214
|
+
function printCenteredBox(title, items, isProjects = false) {
|
|
215
|
+
// Render big bold heading (centered)
|
|
216
|
+
const heading = cfonts.render(title, {
|
|
217
|
+
font: "tiny",
|
|
218
|
+
align: "center",
|
|
219
|
+
colors: ["cyan"],
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// Build box content
|
|
223
|
+
let content;
|
|
224
|
+
if (isProjects) {
|
|
225
|
+
content = items.map(item => {
|
|
226
|
+
const name = ` ${chalk.white("•")} ${chalk.bold(item.name)}`;
|
|
227
|
+
const links = ` ${chalk.cyan("🌐")} ${terminalLink(chalk.cyan("Live"), item.live)} ${chalk.gray("|")} ${chalk.green("🐙")} ${terminalLink(chalk.green("GitHub"), item.github)}`;
|
|
228
|
+
return name + "\n" + links;
|
|
229
|
+
}).join("\n\n");
|
|
230
|
+
} else {
|
|
231
|
+
content = items.map(item => ` ${chalk.white("•")} ${item}`).join("\n");
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const box = boxen(content, {
|
|
235
|
+
padding: 1,
|
|
236
|
+
borderStyle: "round",
|
|
237
|
+
borderColor: "#8FC47B",
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
// Print centered heading (cfonts handles centering)
|
|
241
|
+
console.log(heading.string);
|
|
242
|
+
|
|
243
|
+
// Center box on screen
|
|
244
|
+
const boxLines = box.split("\n");
|
|
245
|
+
const centeredBox = boxLines
|
|
246
|
+
.map(line => {
|
|
247
|
+
const visibleLength = stripAnsi(line).length;
|
|
248
|
+
const boxPad = Math.max(0, Math.floor((width - visibleLength) / 2));
|
|
249
|
+
return " ".repeat(boxPad) + line;
|
|
250
|
+
})
|
|
251
|
+
.join("\n");
|
|
252
|
+
|
|
253
|
+
console.log(centeredBox);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (DATA[cmd]) {
|
|
257
|
+
printCenteredBox(cmd, DATA[cmd], cmd === "projects");
|
|
258
|
+
} else if (cmd === "help") {
|
|
259
|
+
const helpItems = Object.keys(DATA).map(key => chalk.green(key));
|
|
260
|
+
helpItems.push(chalk.green("home"), chalk.green("help"), chalk.green("exit"));
|
|
261
|
+
printCenteredBox("Help", helpItems);
|
|
262
|
+
} else if (cmd === "home") {
|
|
263
|
+
render();
|
|
264
|
+
} else if (cmd === "exit") {
|
|
265
|
+
rl.close();
|
|
266
|
+
process.exit();
|
|
267
|
+
} else {
|
|
268
|
+
const errContent = chalk.red("Unknown command. Type 'help' for available commands.");
|
|
269
|
+
const box = boxen(errContent, {
|
|
270
|
+
padding: 1,
|
|
271
|
+
borderStyle: "round",
|
|
272
|
+
borderColor: "red",
|
|
273
|
+
});
|
|
274
|
+
const boxLines = box.split("\n");
|
|
275
|
+
boxLines.forEach(line => {
|
|
276
|
+
const visibleLength = stripAnsi(line).length;
|
|
277
|
+
const padding = Math.max(0, Math.floor((width - visibleLength) / 2));
|
|
278
|
+
console.log(" ".repeat(padding) + line);
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
startInteractiveMode();
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// ----------------------
|
|
286
|
+
// INIT
|
|
287
|
+
// ----------------------
|
|
288
|
+
|
|
289
|
+
render();
|
|
290
|
+
startInteractiveMode();
|
|
291
|
+
|
|
292
|
+
process.stdout.on("resize", () => {
|
|
293
|
+
render();
|
|
294
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "subhadip-a063",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "CLI intro for Subhadip Jana",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"subhadip-a063": "./index.js"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"cli",
|
|
11
|
+
"portfolio",
|
|
12
|
+
"intro"
|
|
13
|
+
],
|
|
14
|
+
"author": "Subhadip Jana",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"boxen": "^8.0.1",
|
|
19
|
+
"cfonts": "^3.3.1",
|
|
20
|
+
"chalk": "^5.6.2",
|
|
21
|
+
"cli-width": "^4.1.0",
|
|
22
|
+
"gradient-string": "^3.0.0",
|
|
23
|
+
"open": "^11.0.0",
|
|
24
|
+
"ora": "^9.3.0",
|
|
25
|
+
"readline": "^1.3.0",
|
|
26
|
+
"strip-ansi": "^7.1.2",
|
|
27
|
+
"terminal-link": "^5.0.0"
|
|
28
|
+
}
|
|
29
|
+
}
|