{
);
}
}
+
+ private updateNeopixel() {
+ const { neopixel } = this.props;
+ const rgbColor = `rgb(${neopixel[0] +
+ (255 - neopixel[0]) * CONSTANTS.LED_TINT_FACTOR},
+ ${neopixel[1] +
+ (255 - neopixel[1]) * CONSTANTS.LED_TINT_FACTOR},${neopixel[2] +
+ (255 - neopixel[2]) * CONSTANTS.LED_TINT_FACTOR})`;
+
+ if (this.neopixel.current) {
+ this.neopixel.current.setAttribute("fill", rgbColor);
+ }
+ if (this.pixelStopGradient.current) {
+ if (neopixel === DEFAULT_CLUE_STATE.neopixel) {
+ this.pixelStopGradient.current.setAttribute(
+ "stop-opacity",
+ "0"
+ );
+ } else {
+ this.pixelStopGradient.current.setAttribute(
+ "stop-opacity",
+ "1"
+ );
+ }
+ this.pixelStopGradient.current.setAttribute("stop-color", rgbColor);
+ }
+ }
}
diff --git a/src/view/components/clue/__snapshots__/Clue.spec.tsx.snap b/src/view/components/clue/__snapshots__/Clue.spec.tsx.snap
new file mode 100644
index 000000000..099a3de7a
--- /dev/null
+++ b/src/view/components/clue/__snapshots__/Clue.spec.tsx.snap
@@ -0,0 +1,1160 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Clue component should render correctly 1`] = `
+Array [
+
+
+ The simulator will run the .py file you have focused on.
+
+
+
+
+
+
+
+
,
+ ,
+]
+`;
diff --git a/src/view/components/cpx/Cpx.spec.tsx b/src/view/components/cpx/Cpx.spec.tsx
index deb6da57d..24c53d551 100644
--- a/src/view/components/cpx/Cpx.spec.tsx
+++ b/src/view/components/cpx/Cpx.spec.tsx
@@ -4,7 +4,7 @@ import { IntlProvider } from "react-intl";
import * as testRenderer from "react-test-renderer";
import { Cpx } from "./Cpx";
-describe("Device component", () => {
+describe("CPX component", () => {
it("should render correctly", () => {
const component = testRenderer
.create(
diff --git a/src/view/components/cpx/__snapshots__/Cpx.spec.tsx.snap b/src/view/components/cpx/__snapshots__/Cpx.spec.tsx.snap
index 5120fb0a4..3a41b60f6 100644
--- a/src/view/components/cpx/__snapshots__/Cpx.spec.tsx.snap
+++ b/src/view/components/cpx/__snapshots__/Cpx.spec.tsx.snap
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`Device component should render correctly 1`] = `
+exports[`CPX component should render correctly 1`] = `
Array [
;
}
diff --git a/src/view/constants.ts b/src/view/constants.ts
index 1a4351b43..9358452ee 100644
--- a/src/view/constants.ts
+++ b/src/view/constants.ts
@@ -46,6 +46,7 @@ export const CONSTANTS = {
"The simulator will run the .py file you have focused on.",
SIMULATOR_BUTTON_WIDTH: 60,
TOOLBAR_INFO: `Explore what's on the board:`,
+ LED_TINT_FACTOR: 0.5,
};
export const AB_BUTTONS_KEYS = {
BTN_A: "BTN_A",
diff --git a/src/view/styles/Clue.css b/src/view/styles/Clue.css
deleted file mode 100644
index 45a9e3d92..000000000
--- a/src/view/styles/Clue.css
+++ /dev/null
@@ -1,131 +0,0 @@
-.cls-1 {
- fill: #097054;
-}
-.cls-1,
-.cls-13,
-.cls-14,
-.cls-15,
-.cls-23,
-.cls-9 {
- stroke: #000;
-}
-.cls-1,
-.cls-11,
-.cls-12,
-.cls-13,
-.cls-14,
-.cls-15,
-.cls-17,
-.cls-22,
-.cls-23,
-.cls-3,
-.cls-4,
-.cls-5,
-.cls-6,
-.cls-9 {
- stroke-miterlimit: 10;
-}
-.cls-1,
-.cls-23 {
- stroke-width: 1.99px;
-}
-.cls-18,
-.cls-2 {
- fill: #fff;
-}
-.cls-11,
-.cls-12,
-.cls-17,
-.cls-23,
-.cls-3,
-.cls-4,
-.cls-5,
-.cls-6,
-.cls-7,
-.cls-8 {
- fill: none;
-}
-.cls-11,
-.cls-12,
-.cls-17,
-.cls-3,
-.cls-4,
-.cls-5,
-.cls-6,
-.cls-7,
-.cls-8 {
- stroke: #fff;
-}
-.cls-3 {
- stroke-width: 2px;
-}
-.cls-12,
-.cls-17,
-.cls-4,
-.cls-5,
-.cls-6,
-.cls-7,
-.cls-8 {
- stroke-linecap: round;
-}
-.cls-4,
-.cls-7 {
- stroke-width: 1.63px;
-}
-.cls-5 {
- stroke-width: 1.41px;
-}
-.cls-6 {
- stroke-width: 1.6px;
-}
-.cls-7,
-.cls-8 {
- stroke-linejoin: round;
-}
-.cls-8 {
- stroke-width: 1.63px;
-}
-.cls-10,
-.cls-15,
-.cls-9 {
- fill: #7e7272;
-}
-.cls-22,
-.cls-9 {
- stroke-width: 1.5px;
-}
-.cls-12 {
- stroke-width: 1.71px;
-}
-.cls-13 {
- fill: #6599ff;
-}
-.cls-13,
-.cls-14,
-.cls-15 {
- stroke-width: 0.25px;
-}
-.cls-16 {
- fill: #ffde00;
-}
-.cls-17 {
- stroke-width: 2.02px;
-}
-.cls-18 {
- font-size: 7px;
- font-family: SegoeUI-Bold, Segoe UI;
- font-weight: 700;
- letter-spacing: -0.02em;
-}
-.cls-19 {
- letter-spacing: -0.03em;
-}
-.cls-20 {
- letter-spacing: -0.05em;
-}
-.cls-21 {
- letter-spacing: 0em;
-}
-.cls-22 {
- stroke: #7e7272;
-}
diff --git a/src/view/styles/Microbit.css b/src/view/styles/SimulatorSvg.css
similarity index 61%
rename from src/view/styles/Microbit.css
rename to src/view/styles/SimulatorSvg.css
index f96655fa0..9e9deb4fb 100644
--- a/src/view/styles/Microbit.css
+++ b/src/view/styles/SimulatorSvg.css
@@ -24,7 +24,7 @@ svg.sim.grayscale {
}
.sim-text-outside {
font-size: 25px;
- fill: var(--vscode-descriptionForeground);
+ fill: var(--vscode-foreground);
}
.sim-board,
.sim-display,
@@ -38,6 +38,9 @@ sim-button {
.sim-button-outer:active {
fill: orange;
}
+.sim-button-outer {
+ fill: #7e7272;
+}
.sim-button-key-press {
fill: orange;
@@ -174,3 +177,135 @@ sim-button {
-webkit-user-select: none;
-ms-user-select: none;
}
+.sim-button {
+ stroke: none;
+}
+.sim-button:active {
+ stroke: none;
+}
+.cls-1 {
+ fill: #097054;
+}
+.cls-1,
+.cls-14,
+.cls-23,
+.cls-9 {
+ stroke: #000;
+}
+.cls-1,
+.cls-11,
+.cls-12,
+.cls-14,
+.cls-17,
+.cls-22,
+.cls-23,
+.cls-3,
+.cls-4,
+.cls-5,
+.cls-6,
+.cls-9 {
+ stroke-miterlimit: 10;
+}
+.cls-1,
+.cls-23 {
+ stroke-width: 1.99px;
+}
+.cls-18,
+.cls-2 {
+ fill: #fff;
+}
+.cls-11,
+.cls-12,
+.cls-17,
+.cls-23,
+.cls-3,
+.cls-4,
+.cls-5,
+.cls-6,
+.cls-7,
+.cls-8 {
+ fill: none;
+}
+.cls-11,
+.cls-12,
+.cls-17,
+.cls-3,
+.cls-4,
+.cls-5,
+.cls-6,
+.cls-7,
+.cls-8 {
+ stroke: #fff;
+}
+.cls-3 {
+ stroke-width: 2px;
+}
+.cls-12,
+.cls-17,
+.cls-4,
+.cls-5,
+.cls-6,
+.cls-7,
+.cls-8 {
+ stroke-linecap: round;
+}
+.cls-4,
+.cls-7 {
+ stroke-width: 1.63px;
+}
+.cls-5 {
+ stroke-width: 1.41px;
+}
+.cls-6 {
+ stroke-width: 1.6px;
+}
+.cls-7,
+.cls-8 {
+ stroke-linejoin: round;
+}
+.cls-8 {
+ stroke-width: 1.63px;
+}
+.cls-10,
+.cls-9 {
+ fill: #7e7272;
+}
+.cls-22,
+.cls-9 {
+ stroke-width: 1.5px;
+}
+.cls-12 {
+ stroke-width: 1.71px;
+}
+
+.cls-14 {
+ stroke-width: 0.25px;
+}
+.cls-16 {
+ fill: #ffde00;
+}
+.cls-17 {
+ stroke-width: 2.02px;
+}
+.cls-18 {
+ font-size: 7px;
+ font-family: SegoeUI-Bold, Segoe UI;
+ font-weight: 700;
+ letter-spacing: -0.02em;
+}
+.cls-19 {
+ letter-spacing: -0.03em;
+}
+.cls-20 {
+ letter-spacing: -0.05em;
+}
+.cls-21 {
+ letter-spacing: 0em;
+}
+.cls-22 {
+ stroke: #7e7272;
+}
+.sim-text-outside-clue {
+ font-size: 14px;
+ fill: var(--vscode-foreground);
+}