summaryrefslogtreecommitdiff
path: root/Library/SDK/Modules/Strawberry.Dialog.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-07-07 11:06:12 +0200
committerMinteck <contact@minteck.org>2022-07-07 11:06:12 +0200
commit3e064be8020ed1eccc5cddcac5ab355320ebccb5 (patch)
tree37ca0fa0141b5600955ce5d001a4c7a7745902a0 /Library/SDK/Modules/Strawberry.Dialog.js
parent0e9f2dc57e9df8fbc5a5da6d68d1268278aa4129 (diff)
downloadstrawberry-os-3e064be8020ed1eccc5cddcac5ab355320ebccb5.tar.gz
strawberry-os-3e064be8020ed1eccc5cddcac5ab355320ebccb5.tar.bz2
strawberry-os-3e064be8020ed1eccc5cddcac5ab355320ebccb5.zip
m. working on features scoots doesn't want to work onHEADmane
Diffstat (limited to 'Library/SDK/Modules/Strawberry.Dialog.js')
-rw-r--r--Library/SDK/Modules/Strawberry.Dialog.js23
1 files changed, 15 insertions, 8 deletions
diff --git a/Library/SDK/Modules/Strawberry.Dialog.js b/Library/SDK/Modules/Strawberry.Dialog.js
index 95b0d9d..c5d2bac 100644
--- a/Library/SDK/Modules/Strawberry.Dialog.js
+++ b/Library/SDK/Modules/Strawberry.Dialog.js
@@ -10,11 +10,11 @@ let self = {
process.stdout.write("\n");
}
- console.log(" ".repeat(horizontal) + color.bgWhite[col]("╭───" + "─".repeat(message.length) + "───╮"));
- console.log(" ".repeat(horizontal) + color.bgWhite[col]("│ " + " ".repeat(message.length) + " │"));
- console.log(" ".repeat(horizontal) + color.bgWhite.black(color[col]("│") + " " + message + " " + color[col]("│")));
- console.log(" ".repeat(horizontal) + color.bgWhite[col]("│ " + " ".repeat(message.length) + " │"));
- console.log(" ".repeat(horizontal) + color.bgWhite[col]("╰───" + "─".repeat(message.length) + "───╯"));
+ console.log(" ".repeat(horizontal) + color.bgWhite[col]("┏━━━" + "━".repeat(message.length) + "━━━┓"));
+ console.log(" ".repeat(horizontal) + color.bgWhite[col]("┃ " + " ".repeat(message.length) + " ┃"));
+ console.log(" ".repeat(horizontal) + color.bgWhite.black(color[col]("┃") + " " + message + " " + color[col]("┃")));
+ console.log(" ".repeat(horizontal) + color.bgWhite[col]("┃ " + " ".repeat(message.length) + " ┃"));
+ console.log(" ".repeat(horizontal) + color.bgWhite[col]("┗━━━" + "─".repeat(message.length) + "━━━┛"));
for (let n = 0; n < (vertical - 3); n++) {
process.stdout.write("\n");
@@ -27,7 +27,7 @@ let self = {
return a.length > b.length ? a : b
}, '');
- global.vertical = Math.round(process.stdout.rows / 2 + 1) - 5;
+ global.vertical = Math.round(process.stdout.rows / 2 + 1) - 5 - (lines.length / 2);
let horizontal = Math.round(process.stdout.columns / 2 - (1 + ((longest.length + 8) / 2)));
for (let n = 0; n < vertical; n++) {
@@ -37,8 +37,15 @@ let self = {
console.log(" ".repeat(horizontal) + color.bgWhite[col]("┏━━━" + "━".repeat(longest.length) + "━━━┓"));
console.log(" ".repeat(horizontal) + color.bgWhite[col]("┃ " + " ".repeat(longest.length) + " ┃"));
+ let index = 0;
for (let line of lines) {
- console.log(" ".repeat(horizontal) + color.bgWhite.black(color[col]("┃") + " " + line + " ".repeat(longest.length - line.length) + " " + color[col]("┃")));
+ if (index === 0) {
+ console.log(" ".repeat(horizontal) + color.bgWhite.black(color[col]("┃") + " " + chalk.underline(line) + " ".repeat(longest.length - line.length) + " " + color[col]("┃")));
+ } else {
+ console.log(" ".repeat(horizontal) + color.bgWhite.black(color[col]("┃") + " " + line + " ".repeat(longest.length - line.length) + " " + color[col]("┃")));
+ }
+
+ index++;
}
console.log(" ".repeat(horizontal) + color.bgWhite[col]("┃ " + " ".repeat(longest.length) + " ┃"));
@@ -46,7 +53,7 @@ let self = {
console.log(" ".repeat(horizontal) + color.bgWhite[col]("┃ " + " ".repeat(longest.length) + " ┃"));
console.log(" ".repeat(horizontal) + color.bgWhite[col]("┗━━━" + "━".repeat(longest.length) + "━━━┛"));
- for (let n = 0; n < (vertical - 3); n++) {
+ for (let n = 0; n < (vertical - 3 - lines.length); n++) {
process.stdout.write("\n");
}