diff --git a/index.html b/index.html index 74da68d..499cc2b 100644 --- a/index.html +++ b/index.html @@ -30,8 +30,10 @@

Dashboard

+ id="start-button" + class="button button--lg button--orange text--white mb-3"> + Start Tour +
@@ -77,7 +79,8 @@

Your Daily Graph

-
+
diff --git a/main.js b/main.js index 0e43c01..ee656f7 100644 --- a/main.js +++ b/main.js @@ -1,6 +1,9 @@ import Handhold from './src/handhold'; import handholdData from './steps.json'; -const handhold = new Handhold(); +const startBtn = document.getElementById('start-button'); +console.log({ startBtn }); + +const handhold = new Handhold(startBtn); handhold.setup(handholdData); handhold.init(); \ No newline at end of file diff --git a/src/handhold.mjs b/src/handhold.mjs index 8138fd2..45eeca4 100644 --- a/src/handhold.mjs +++ b/src/handhold.mjs @@ -1,13 +1,13 @@ import './sass/handhold.scss'; export default class Handhold { - constructor() { + constructor(startElement) { this._active = false; this._config; this._currentStep = 1; this._currentStepElement; this._mappedSteps; - this._startBtn = document.querySelector('[data-start-handhold]'); + this._startBtn = startElement || document.querySelector('[data-start-handhold]'); this._stepElements; this._steps; this._listeners;