File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,21 @@ const frames = [
2222 `
2323] ;
2424
25+ // Create a multi-color border effect
26+ function colorBorder ( message ) {
27+ const border = '===============================' ;
28+ return `
29+ ${ chalk . blue ( border ) }
30+ ${ chalk . green ( message ) }
31+ ${ chalk . magenta ( border ) }
32+ ` ;
33+ }
34+
2535export function celebrate ( message ) {
2636 let frameIndex = 0 ;
2737 const animation = setInterval ( ( ) => {
2838 process . stdout . write ( '\x1B[2J\x1B[3J\x1B[H' ) ;
29- console . log ( chalk . rainbow ( `
30- ===============================
31- ${ message }
32- ===============================
33- ` ) ) ;
39+ console . log ( colorBorder ( message ) ) ;
3440 console . log ( chalk . cyan ( frames [ frameIndex ] ) ) ;
3541 frameIndex = ( frameIndex + 1 ) % frames . length ;
3642 } , 200 ) ;
@@ -39,10 +45,6 @@ export function celebrate(message) {
3945 setTimeout ( ( ) => {
4046 clearInterval ( animation ) ;
4147 process . stdout . write ( '\x1B[2J\x1B[3J\x1B[H' ) ;
42- console . log ( chalk . green ( `
43- ===============================
44- ${ message }
45- ===============================
46- ` ) ) ;
48+ console . log ( colorBorder ( message ) ) ;
4749 } , 2000 ) ;
4850}
You can’t perform that action at this time.
0 commit comments