Update highlight demo
Browse files- favicon.svg +0 -15
- index.html +3 -33
- src/driver.ts +1 -5
- src/stage.ts +1 -1
favicon.svg
DELETED
index.html
CHANGED
|
@@ -2,7 +2,6 @@
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
-
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>Vite App</title>
|
| 8 |
|
|
@@ -70,38 +69,9 @@
|
|
| 70 |
|
| 71 |
const driverObj = driver();
|
| 72 |
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
popover: {
|
| 77 |
-
title: "Welcome to driver.js!",
|
| 78 |
-
description: "It's a rewritten version of driver.js",
|
| 79 |
-
position: "bottom",
|
| 80 |
-
},
|
| 81 |
-
});
|
| 82 |
-
}, 1000);
|
| 83 |
-
|
| 84 |
-
window.setTimeout(() => {
|
| 85 |
-
driverObj.highlight({
|
| 86 |
-
element: "p",
|
| 87 |
-
popover: {
|
| 88 |
-
title: "Welcome to driver.js!",
|
| 89 |
-
description: "It's a rewritten version of driver.js",
|
| 90 |
-
position: "bottom",
|
| 91 |
-
},
|
| 92 |
-
});
|
| 93 |
-
}, 2000);
|
| 94 |
-
|
| 95 |
-
window.setTimeout(() => {
|
| 96 |
-
driverObj.highlight({
|
| 97 |
-
element: "ul",
|
| 98 |
-
popover: {
|
| 99 |
-
title: "Welcome to driver.js!",
|
| 100 |
-
description: "It's a rewritten version of driver.js",
|
| 101 |
-
position: "bottom",
|
| 102 |
-
},
|
| 103 |
-
});
|
| 104 |
-
}, 3000);
|
| 105 |
</script>
|
| 106 |
</body>
|
| 107 |
</html>
|
|
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
|
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
<title>Vite App</title>
|
| 7 |
|
|
|
|
| 69 |
|
| 70 |
const driverObj = driver();
|
| 71 |
|
| 72 |
+
driverObj.highlight({
|
| 73 |
+
element: "li",
|
| 74 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
</script>
|
| 76 |
</body>
|
| 77 |
</html>
|
src/driver.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
| 1 |
import { initEvents, destroyEvents } from "./events";
|
| 2 |
import { destroyHighlight, highlight } from "./highlight";
|
| 3 |
import { destroyStage } from "./stage";
|
|
|
|
| 4 |
|
| 5 |
export type DriveStep = {
|
| 6 |
element?: string | Element;
|
| 7 |
-
popover: {
|
| 8 |
-
title: string;
|
| 9 |
-
description: string;
|
| 10 |
-
position: "top" | "bottom" | "left" | "right";
|
| 11 |
-
};
|
| 12 |
};
|
| 13 |
|
| 14 |
export function driver() {
|
|
|
|
| 1 |
import { initEvents, destroyEvents } from "./events";
|
| 2 |
import { destroyHighlight, highlight } from "./highlight";
|
| 3 |
import { destroyStage } from "./stage";
|
| 4 |
+
import "./style.css";
|
| 5 |
|
| 6 |
export type DriveStep = {
|
| 7 |
element?: string | Element;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
};
|
| 9 |
|
| 10 |
export function driver() {
|
src/stage.ts
CHANGED
|
@@ -153,7 +153,7 @@ function createStageSvg(stage: StageDefinition): SVGSVGElement {
|
|
| 153 |
}
|
| 154 |
|
| 155 |
function generateSvgCutoutPathString(stage: StageDefinition) {
|
| 156 |
-
const padding =
|
| 157 |
const radius = 5;
|
| 158 |
|
| 159 |
const windowX = window.innerWidth;
|
|
|
|
| 153 |
}
|
| 154 |
|
| 155 |
function generateSvgCutoutPathString(stage: StageDefinition) {
|
| 156 |
+
const padding = 4;
|
| 157 |
const radius = 5;
|
| 158 |
|
| 159 |
const windowX = window.innerWidth;
|