Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions examples/example-components.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,17 @@
const Eyetracker = eyetrack.initEyetracker();
const comp = eyetrack.initComponents(Eyetracker);

// basically a "go to the next stage" button
const clearComponentsButton = document.createElement("button");
clearComponentsButton.textContent = "Next";
clearComponentsButton.addEventListener("click", () => {
comp.clearComponents();
});

async function start() {
const landing = await comp.createLanding();
document.body.append(landing);
// create a wrapper so that the button doesn't stretch b/c landing is flex
let wrapper = document.createElement("div");
let next = clearComponentsButton;
let next = document.createElement("button");
next.innerText = "Next";
// invokes the next step and clears itself
next.addEventListener("click", () => {
next.parentNode.parentNode.remove();
selectorPrompt();
next.parentNode.remove();
});
wrapper.append(next);
landing.append(wrapper);
Expand Down
Loading