kamrify commited on
Commit
2d06ce3
·
1 Parent(s): a855543

Add overlay color example

Browse files
Files changed (1) hide show
  1. docs/src/pages/index.astro +23 -3
docs/src/pages/index.astro CHANGED
@@ -39,7 +39,7 @@ const starCount = getFormattedStars('kamranahmedse/driver.js');
39
  <div class="py-24 bg-white text-black">
40
  <Container>
41
  <h2 class="text-6xl font-bold mb-6" data-examples-heading>Examples</h2>
42
- <p class="text-2xl text-black mb-12" data-examples-tagline>Here are just a few examples; find more <a
43
  class="text-black underline underline-offset-4" href="/docs/installation">in the documentation</a>.</p>
44
 
45
  <div class="flex flex-wrap gap-3" data-example-btns>
@@ -51,11 +51,11 @@ const starCount = getFormattedStars('kamranahmedse/driver.js');
51
  <ExampleButton id="simple-element-highlight" text="Simple Element Highlight" />
52
  <ExampleButton id="simple-element-highlight-popover" text="Simple Highlight with Popover" />
53
  <ExampleButton id="prevent-close" text="Prevent Tour from Closing" />
54
- <ExampleButton text="Overlay Color" />
55
  <ExampleButton text="Popover Positioning" />
56
  <ExampleButton text="Customizing Popover" />
57
  <ExampleButton text="Hooks for Everything" />
58
- <a href="/"
59
  class="items-center flex text-lg text-gray-900 bg-yellow-300 rounded-xl px-5 hover:bg-yellow-500 hover:text-black">
60
  and much more ...
61
  </a>
@@ -535,5 +535,25 @@ const starCount = getFormattedStars('kamranahmedse/driver.js');
535
 
536
  driverObj.drive();
537
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
538
  </script>
539
  </BaseLayout>
 
39
  <div class="py-24 bg-white text-black">
40
  <Container>
41
  <h2 class="text-6xl font-bold mb-6" data-examples-heading>Examples</h2>
42
+ <p class="text-2xl text-black mb-12" data-examples-tagline>Here are just a few examples; find more and implementation details <a
43
  class="text-black underline underline-offset-4" href="/docs/installation">in the documentation</a>.</p>
44
 
45
  <div class="flex flex-wrap gap-3" data-example-btns>
 
51
  <ExampleButton id="simple-element-highlight" text="Simple Element Highlight" />
52
  <ExampleButton id="simple-element-highlight-popover" text="Simple Highlight with Popover" />
53
  <ExampleButton id="prevent-close" text="Prevent Tour from Closing" />
54
+ <ExampleButton id="overlay-color" text="Overlay Color" />
55
  <ExampleButton text="Popover Positioning" />
56
  <ExampleButton text="Customizing Popover" />
57
  <ExampleButton text="Hooks for Everything" />
58
+ <a href="/docs/installation"
59
  class="items-center flex text-lg text-gray-900 bg-yellow-300 rounded-xl px-5 hover:bg-yellow-500 hover:text-black">
60
  and much more ...
61
  </a>
 
535
 
536
  driverObj.drive();
537
  });
538
+
539
+ const overlayColorBtn = document.getElementById('overlay-color');
540
+ overlayColorBtn.addEventListener('click', () => {
541
+ const driverObj = driver({
542
+ overlayColor: 'red',
543
+ overlayOpacity: 0.5,
544
+ onDestroyed: () => {
545
+ markDone(overlayColorBtn);
546
+ }
547
+ });
548
+
549
+ driverObj.highlight({
550
+ element: '[data-example-btns]',
551
+ popover: {
552
+ title: "Popover Highlight",
553
+ description: "You can also highlight an element with a popover.",
554
+ side: 'top'
555
+ }
556
+ });
557
+ });
558
  </script>
559
  </BaseLayout>