diff --git a/index.html b/index.html
index 4e6c11a..b0a81d0 100644
--- a/index.html
+++ b/index.html
@@ -81,6 +81,8 @@
+
+
@@ -105,6 +107,24 @@
driver({ animate: false }).highlight({ element: "ul" });
});
+ document
+ .getElementById("dark-highlight-btn")
+ .addEventListener("click", () => {
+ driver({
+ animate: true,
+ opacity: 0.9,
+ }).highlight({ element: "ul" });
+ });
+
+ document
+ .getElementById("dim-highlight-btn")
+ .addEventListener("click", () => {
+ driver({
+ animate: true,
+ opacity: 0.2,
+ }).highlight({ element: ".buttons" });
+ });
+
document
.getElementById("transition-highlight-btn")
.addEventListener("click", () => {
diff --git a/src/config.ts b/src/config.ts
index c87561a..b116566 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -1,6 +1,7 @@
export type Config = {
animate?: boolean;
allowClose?: boolean;
+ opacity?: number;
};
let currentConfig: Config = {};
@@ -9,6 +10,7 @@ export function configure(config: Config = {}) {
currentConfig = {
animate: true,
allowClose: true,
+ opacity: 0.7,
...config,
};
}
diff --git a/src/stage.ts b/src/stage.ts
index 0608a7e..87796fa 100644
--- a/src/stage.ts
+++ b/src/stage.ts
@@ -1,6 +1,7 @@
import { easeInOutQuad } from "./math";
import { onDriverClick } from "./events";
import { trigger } from "./hooks";
+import { getConfig } from "./config";
export type StageDefinition = {
x: number;
@@ -158,7 +159,7 @@ function createStageSvg(stage: StageDefinition): SVGSVGElement {
cutoutPath.setAttribute("d", generateSvgCutoutPathString(stage));
cutoutPath.style.fill = "rgb(0,0,0)";
- cutoutPath.style.opacity = `0.7`;
+ cutoutPath.style.opacity = `${getConfig("opacity")}`;
cutoutPath.style.pointerEvents = "auto";
cutoutPath.style.cursor = "auto";