-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbin.js
More file actions
executable file
·99 lines (91 loc) · 2.4 KB
/
bin.js
File metadata and controls
executable file
·99 lines (91 loc) · 2.4 KB
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
#!/usr/bin/env node
const chalk = require('chalk');
// Define colors and styles
const primary = chalk.hex('#33ddff'); // Lighter blue for borders
const secondary = chalk.hex('#36ff33'); // Green for brackets
const accent = chalk.hex('#33ffd1'); // Bright green for URLs
const subtle = chalk.hex('#AEB6BF'); // Subtle gray for dividers
const highlight = chalk.hex('#339cff').bold; // Blue for the name
// Card dimensions - fixed width for better alignment
const width = 54;
// Create borders with exact width
const topBorder = primary('╭' + '─'.repeat(width) + '╮');
const bottomBorder = primary('╰' + '─'.repeat(width) + '╯');
// Function to create a line with perfectly aligned borders
const createLine = (text) => {
// Strip ANSI codes for accurate length calculation
const cleanText = text.replace(/\u001b\[\d+(;\d+)*m/g, '');
const padding = width - cleanText.length;
return primary('│') + text + ' '.repeat(padding) + primary('│');
};
// Empty line and divider
const emptyLine = createLine(' '.repeat(width));
const divider = createLine(' ' + subtle('━'.repeat(width - 2)) + ' ');
// Build the card with precise spacing
const card = [
'',
topBorder,
emptyLine,
createLine(
' ' +
secondary('{') +
highlight('Johan Kuijt') +
secondary('}') +
' ' +
primary('</') +
accent('johankuijt.com') +
primary('>')
),
divider,
emptyLine,
createLine(
' ' +
secondary('⚙') +
' ' +
chalk.cyanBright('Work') +
' :: ' +
chalk.white('Freelance Developer @ Re:Stacks')
),
createLine(
' ' +
highlight('★') +
' ' +
chalk.cyanBright('GitHub') +
' :: ' +
chalk.greenBright.underline('https://github.com/yo-han')
),
createLine(
' ' +
chalk.magentaBright('✉') +
' ' +
chalk.cyanBright('Email') +
' :: ' +
chalk.greenBright.underline('hello@johankuijt.com')
),
createLine(
' ' +
chalk.blueBright('⌂') +
' ' +
chalk.cyanBright('Web') +
' :: ' +
chalk.greenBright.underline('https://johankuijt.com')
),
emptyLine,
divider,
createLine(
' ' +
subtle('>') +
' ' +
subtle('Run') +
' ' +
secondary('npx') +
' ' +
highlight('johankuijt') +
' ' +
subtle('anytime to see this card')
),
emptyLine,
bottomBorder,
'',
].join('\n');
console.log(card);