Skip to content

Commit a2b2c3c

Browse files
committed
api: the github_dark is the default theme now :)
1 parent 2259bf4 commit a2b2c3c

File tree

4 files changed

+28
-30
lines changed

4 files changed

+28
-30
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build": "tsc -p .",
88
"build:client": "npm run build --prefix client",
99
"start": "node dist/app.js",
10-
"start:client": "npm start --prefix client",
10+
"start:client": "npm run dev --prefix client",
1111
"deploy": "npm run deploy --prefix client",
1212
"dev": "nodemon src/app.ts",
1313
"format": "prettier --write .",

src/cards/card-builder.ts

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,74 +43,74 @@ export default class CardBuilder {
4343
return result;
4444
}
4545

46-
public title(_title = "My Tech Stack"): CardBuilder {
46+
public title(_title = "My Tech Stack") {
4747
this.card.setTitle(title.parse(_title));
4848
return this;
4949
}
5050

51-
public lineCount(_lineCount = "1"): CardBuilder {
51+
public lineCount(_lineCount = "1") {
5252
this.card.setLineCount(lineCount.parse(Number(_lineCount)));
5353
return this;
5454
}
5555

56-
public align(_align = "left"): CardBuilder {
56+
public align(_align = "left") {
5757
this.card.setBadgeAlign(align.parse(_align));
5858
return this;
5959
}
6060

61-
public titleAlign(_titleAlign = "left"): CardBuilder {
61+
public titleAlign(_titleAlign = "left") {
6262
this.card.setTitleAlign(align.parse(_titleAlign));
6363
return this;
6464
}
6565

66-
public border(_showBorder = "true"): CardBuilder {
66+
public border(_showBorder = "true") {
6767
this.card.setShowBorder(
6868
showBorder.parse(_showBorder === "false" ? false : true)
6969
);
7070
return this;
7171
}
7272

73-
public hideTitle(_hideTitle = "false"): CardBuilder {
73+
public hideTitle(_hideTitle = "false") {
7474
this.card.setHideTitle(_hideTitle === "true");
7575
return this;
7676
}
7777

78-
public borderRadius(_borderRadius = "4.5"): CardBuilder {
78+
public borderRadius(_borderRadius = "4.5") {
7979
this.card.setBorderRadius(borderRadius.parse(Number(_borderRadius)));
8080
return this;
8181
}
8282

83-
public fontWeight(_fontWeight = "semibold"): CardBuilder {
83+
public fontWeight(_fontWeight = "semibold") {
8484
this.card.setFontWeight(fontWeight.parse(_fontWeight));
8585
return this;
8686
}
8787

88-
public fontSize(_fontSize = "18"): CardBuilder {
88+
public fontSize(_fontSize = "18") {
8989
this.card.setFontSize(fontSize.parse(Number(_fontSize)));
9090
return this;
9191
}
9292

93-
public theme(_theme = "github"): CardBuilder {
93+
public theme(_theme = "github_dark") {
9494
this.card.setTheme(getThemeByName(_theme));
9595
return this;
9696
}
9797

98-
public family(_fontFamily = "Segoe UI"): CardBuilder {
98+
public family(_fontFamily = "Segoe UI") {
9999
this.card.setFontFamily(fontFamily.parse(_fontFamily));
100100
return this;
101101
}
102102

103-
public gap(_gap = "10"): CardBuilder {
103+
public gap(_gap = "10") {
104104
this.card.setGap(gap.parse(Number(_gap)));
105105
return this;
106106
}
107107

108-
public lineHeight(_lh = "7"): CardBuilder {
108+
public lineHeight(_lh = "7") {
109109
this.card.setLineHeight(lineHeight.parse(Number(_lh)));
110110
return this;
111111
}
112112

113-
public bgColor(bgColor = ""): CardBuilder {
113+
public bgColor(bgColor = "") {
114114
if (isHexColor(bgColor)) {
115115
this.card.setTheme({
116116
...this.card.getTheme(),
@@ -121,7 +121,7 @@ export default class CardBuilder {
121121
return this;
122122
}
123123

124-
public borderColor(border = ""): CardBuilder {
124+
public borderColor(border = "") {
125125
if (isHexColor(border)) {
126126
this.card.setTheme({
127127
...this.card.getTheme(),
@@ -132,7 +132,7 @@ export default class CardBuilder {
132132
return this;
133133
}
134134

135-
public badgeColor(badge = ""): CardBuilder {
135+
public badgeColor(badge = "") {
136136
if (isHexColor(badge)) {
137137
this.card.setTheme({
138138
...this.card.getTheme(),
@@ -143,7 +143,7 @@ export default class CardBuilder {
143143
return this;
144144
}
145145

146-
public titleColor(title = ""): CardBuilder {
146+
public titleColor(title = "") {
147147
if (isHexColor(title)) {
148148
this.card.setTheme({
149149
...this.card.getTheme(),
@@ -154,7 +154,7 @@ export default class CardBuilder {
154154
return this;
155155
}
156156

157-
public hideBackground(hb = "false"): CardBuilder {
157+
public hideBackground(hb = "false") {
158158
if (hb.toString() === "true") {
159159
this.card.setTheme({
160160
...this.card.getTheme(),
@@ -165,9 +165,7 @@ export default class CardBuilder {
165165
return this;
166166
}
167167

168-
public lines(
169-
cb: (line: number, addBadge: (b: Badge) => void) => void
170-
): CardBuilder {
168+
public lines(cb: (line: number, addBadge: (b: Badge) => void) => void) {
171169
// for loop from 1 to the line count
172170
// each iteration calls the callback function
173171
for (let i = 1; i <= this.card.getLineCount(); i++) {

src/cards/card.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default class Card {
2020

2121
public constructor() {
2222
this.title = "My Tech Stack";
23-
this.theme = getThemeByName("github");
23+
this.theme = getThemeByName("github_dark");
2424
this.badgeAlign = "left";
2525
this.titleAlign = "left";
2626
this.showBorder = true;

src/cards/themes.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ import { Theme } from "./types";
66
*/
77
export const themes: Map<string, Theme> = new Map<string, Theme>();
88

9-
themes.set("github", {
10-
backgroundColor: "#FFFFFF",
11-
borderColor: "#D8DEE4",
12-
titleColor: "#0969DA",
13-
badgeColor: "#EAEFFC",
14-
});
159
themes.set("github_dark", {
1610
backgroundColor: "#0D1117",
1711
borderColor: "#21262D",
1812
titleColor: "#58A6FF",
1913
badgeColor: "#161B22",
2014
});
15+
themes.set("github", {
16+
backgroundColor: "#FFFFFF",
17+
borderColor: "#D8DEE4",
18+
titleColor: "#0969DA",
19+
badgeColor: "#EAEFFC",
20+
});
2121
themes.set("github_dark_green", {
2222
backgroundColor: "#0D1117",
2323
borderColor: "#21262D",
@@ -286,7 +286,7 @@ themes.set("fleet", {
286286
/**
287287
* Searches for the specified theme in the themes map.
288288
* If the theme is not present in the map, then the default
289-
* github theme gets returned.
289+
* github_dark theme gets returned.
290290
*
291291
* @param {string} name The name of the theme.
292292
* @returns {Theme} The found theme.

0 commit comments

Comments
 (0)