mirror of
https://github.com/kamranahmedse/driver.js.git
synced 2026-11-02 22:17:14 +08:00
114 lines
2.5 KiB
HTML
114 lines
2.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Vite App</title>
|
|
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
|
font-size: 14px;
|
|
-webkit-font-smoothing: antialiased;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
}
|
|
|
|
.container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 100vh;
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
h1 {
|
|
margin: 40px 0 10px;
|
|
font-size: 48px;
|
|
font-weight: 600;
|
|
text-align: center;
|
|
}
|
|
|
|
h1 sup {
|
|
font-size: 18px;
|
|
font-weight: 400;
|
|
}
|
|
|
|
ul {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 20px 10px 0;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
ul li:before {
|
|
content: "•";
|
|
margin-right: 10px;
|
|
}
|
|
|
|
.buttons {
|
|
display: flex;
|
|
margin-top: 20px;
|
|
gap: 10px;
|
|
}
|
|
|
|
button {
|
|
all: unset;
|
|
border: 1px solid #ccc;
|
|
padding: 5px 15px;
|
|
border-radius: 5px;
|
|
display: block;
|
|
cursor: pointer;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>driver.js <sup>next</sup></h1>
|
|
<p>Rewritten and enhanced version of driver.js</p>
|
|
|
|
<div class="buttons">
|
|
<button id="highlight-btn">Simple Highlight</button>
|
|
<button id="tour-btn">Start Tour</button>
|
|
<button id="highlight-destroy">Destroy after 2s</button>
|
|
</div>
|
|
|
|
<ul>
|
|
<li>Written in TypeScript</li>
|
|
<li>Lightweight — only 5kb gzipped</li>
|
|
<li>No dependencies</li>
|
|
<li>MIT Licensed</li>
|
|
</ul>
|
|
</div>
|
|
<script type="module">
|
|
import { driver } from "./src/driver.ts";
|
|
|
|
const driverObj = driver();
|
|
|
|
document.getElementById("highlight-btn").addEventListener("click", () => {
|
|
driverObj.highlight({
|
|
element: "h1",
|
|
});
|
|
});
|
|
|
|
document
|
|
.getElementById("highlight-destroy")
|
|
.addEventListener("click", () => {
|
|
driverObj.highlight({
|
|
element: "h1",
|
|
});
|
|
setTimeout(() => {
|
|
driverObj.destroy();
|
|
}, 2000);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|