Skip to content

Commit 658140d

Browse files
committed
Add functionality to display 'Ask Me About' text on badge
1 parent 7594446 commit 658140d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

public/script.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,14 @@ function drawBadge() {
240240
const githubHandleY = (canvas.height) - bottomMargin - textHeight;
241241
const jobTitleY = githubHandleY - textHeight - lineHeightGap;
242242

243+
// Draw Ask Me About
244+
const askmeabout = document.getElementById('askmeabout').value;
245+
if (askmeabout) {
246+
ctx.font = `14px "Mona Sans"`;
247+
const askMeText = `Ask me about: ${askmeabout}`;
248+
ctx.fillText(askMeText, leftMargin, jobTitleY - textHeight - lineHeightGap);
249+
}
250+
243251
// Draw the text
244252
ctx.fillText(jobtitle, leftMargin, jobTitleY);
245253
ctx.fillText(githubhandle, leftMargin, githubHandleY);

0 commit comments

Comments
 (0)