Skip to content

Commit d730b96

Browse files
committed
Remove references
1 parent e65631a commit d730b96

File tree

5 files changed

+20
-16
lines changed

5 files changed

+20
-16
lines changed

.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.vscode/**
22
.vscode-test/**
33
src/**
4+
!src/assets/pirate.png
45
.gitignore
56
.yarnrc
67
vsc-extension-quickstart.md

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# ProblemSoftware
22

3-
Problems in your software? PirateSoftware will be there to remind you to not code like him!
3+
Problems in your software? A certain pirate will be there to remind you to not code like him!
44

55
Download the extension [here](https://marketplace.visualstudio.com/items?itemName=KennethNg.problemsoftware) or look for `KennethNg.problemsoftware` in the VSCode Extensions tab.
66

77
## Features
88

9-
Adds a view container with a lovely picture of PirateSoftware in his natural habitat.
9+
Adds a view container with a lovely picture of a pirate in his natural habitat.
1010

1111
As your problems increase, so will he.
1212

@@ -19,7 +19,7 @@ Also adds some encouraging messages to motivate you to fix your problems.
1919

2020
This extension contributes the following settings:
2121

22-
- `problemsoftware.maxProblemCount`: Maximum number of problems before PirateSoftware eats your soul.
22+
- `problemsoftware.maxProblemCount`: Maximum number of problems before the pirate eats your soul.
2323

2424
Also adds a nifty command to set it as well:
2525

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "problemsoftware",
33
"displayName": "ProblemSoftware",
4-
"description": "Problems in your software? PirateSoftware will be there to remind you to not code like him!",
5-
"version": "0.1.2",
4+
"description": "Problems in your software? A certain pirate will be there to remind you to not code like him!",
5+
"version": "0.1.3",
66
"publisher": "KennethNg",
77
"repository": {
88
"url": "https://github.com/kennething/problemsoftware"
@@ -25,7 +25,7 @@
2525
"default": 50,
2626
"minimum": 1,
2727
"maximum": 999,
28-
"description": "Maximum number of problems before PirateSoftware eats your soul"
28+
"description": "Maximum number of problems before the pirate eats your soul"
2929
}
3030
}
3131
},
File renamed without changes.

src/extension.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function activate(context: vscode.ExtensionContext) {
2525
const current = config.get<number>("maxProblemCount", 50);
2626

2727
const input = await vscode.window.showInputBox({
28-
prompt: "Enter the maximum number of problems before PirateSoftware eats your soul",
28+
prompt: "Enter the maximum number of problems before the pirate eats your soul",
2929
value: current.toString(),
3030
validateInput: (value) => {
3131
const num = Number(value);
@@ -58,7 +58,7 @@ class MyWebviewViewProvider implements vscode.WebviewViewProvider {
5858
localResourceRoots: [vscode.Uri.file(path.join(this.context.extensionPath, "src", "assets"))]
5959
};
6060

61-
const imagePathOnDisk = vscode.Uri.file(path.join(this.context.extensionPath, "src", "assets", "piratesoftware.png"));
61+
const imagePathOnDisk = vscode.Uri.file(path.join(this.context.extensionPath, "src", "assets", "pirate.png"));
6262
const imageSrc = webview.asWebviewUri(imagePathOnDisk);
6363

6464
webview.html = this.getHtml(imageSrc.toString());
@@ -81,17 +81,17 @@ class MyWebviewViewProvider implements vscode.WebviewViewProvider {
8181
<html lang="en">
8282
<body style="overflow: hidden">
8383
<div>
84-
<img id="problem-image" src="${imageSrc}" width="210px" style="transition: opacity 0.3s; opacity: 0.05;" />
85-
<p id="encouragement" style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; z-index: -1;">0 problems! Good job!</p>
84+
<img id="pirate" src="${imageSrc}" width="210px" style="transition: opacity 0.3s; opacity: 0.05;" />
85+
<p id="encouragement" style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 1;">0 problems! Good job!</p>
8686
</div>
8787
8888
<script>
8989
function getProblemText(count, maxCount) {
9090
if (count === 0) return "0 problems! Good job!";
91-
if (count <= maxCount / 10) return count + " problems, all good gang"; // ? default: 5
92-
if (count <= maxCount / 5) return "You gonna fix those " + count + " problems?"; // ? default: 10
93-
if (count <= maxCount / 2) return "Fix these " + count + " problems NOW!"; // ? default: 25
94-
if (count <= maxCount / 1.25) return count + " problems is NOT a flex lil bro"; // ? default: 40
91+
if (count <= maxCount * 0.1) return count + " problem" + (count === 1 ? '' : 's') + ", all good gang"; // ? default: 5
92+
if (count <= maxCount * 0.2) return "You gonna fix those " + count + " problems?"; // ? default: 10
93+
if (count <= maxCount * 0.5) return "Fix those " + count + " problems NOW!"; // ? default: 25
94+
if (count <= maxCount * 0.8) return count + " problems is NOT a flex lil bro"; // ? default: 40
9595
return count + " problems... lock your doors";
9696
}
9797
@@ -101,9 +101,12 @@ class MyWebviewViewProvider implements vscode.WebviewViewProvider {
101101
102102
const count = message.count;
103103
const maxProblems = message.maxCount;
104-
const opacity = Math.max(0.05, Math.min(1, count / maxProblems));
105104
106-
document.getElementById('problem-image').style.opacity = opacity;
105+
const pirateOpacity = Math.max(0.05, Math.min(1, count / maxProblems));
106+
document.getElementById('pirate').style.opacity = pirateOpacity;
107+
108+
const textOpacity = Math.max(0.5, 1 - (count / maxProblems));
109+
document.getElementById("encouragement").style.opacity = textOpacity;
107110
document.getElementById("encouragement").innerText = getProblemText(count, maxProblems);
108111
});
109112
</script>

0 commit comments

Comments
 (0)