kamrify commited on
Commit
6b9b285
·
1 Parent(s): 61db60d

Make homepage responsive

Browse files
docs/src/components/Container.astro CHANGED
@@ -1,3 +1,3 @@
1
- <div class="max-w-[1050px] mx-auto px-10">
2
  <slot />
3
  </div>
 
1
+ <div class="max-w-[1050px] mx-auto px-7 sm:px-10">
2
  <slot />
3
  </div>
docs/src/components/{examples/ExampleButton.tsx → ExampleButton.tsx} RENAMED
@@ -11,7 +11,7 @@ export function ExampleButton(props: ExampleButtonProps) {
11
  <button
12
  id={id}
13
  onClick={onClick}
14
- className="bg-transparent rounded-xl py-2 px-4 font-medium text-black border-2 border-black text-lg hover:bg-yellow-300 hover:text-black transition-colors duration-100">
15
  { text }
16
  </button>
17
  );
 
11
  <button
12
  id={id}
13
  onClick={onClick}
14
+ className="bg-transparent rounded-lg lg:rounded-xl py-2 px-4 font-medium text-black border-2 border-black md:text-base lg:text-lg hover:bg-yellow-300 hover:text-black transition-colors duration-100">
15
  { text }
16
  </button>
17
  );
docs/src/components/Examples.astro ADDED
@@ -0,0 +1,527 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ import { ExampleButton } from "./ExampleButton";
3
+ ---
4
+ <h2 class="text-4xl md:text-5xl lg:text-6xl font-bold mb-3 md:mb-4 lg:mb-6" data-examples-heading>Examples</h2>
5
+ <p class="text-base md:text-xl lg:text-2xl text-black leading-6" data-examples-tagline>Here are just a few examples; find more <a
6
+ class="text-black underline underline-offset-4" href="/docs/installation">in the documentation</a>.</p>
7
+
8
+ <div class="flex flex-wrap gap-2 md:gap-2 lg:gap-3 my-6 md:my-8 lg:my-12" data-example-btns>
9
+ <ExampleButton id="animated-tour" text="Animated Tour" />
10
+ <ExampleButton id="static-tour" text="Non-Animated Tour" />
11
+ <ExampleButton id="async-tour" text="Async Tour" />
12
+ <ExampleButton id="no-element" text="No Element" />
13
+ <ExampleButton id="confirm-on-exit" text="Confirm on Exit" />
14
+ <ExampleButton id="show-progress" text="Show Progress" />
15
+ <ExampleButton id="simple-element-highlight" text="Simple Highlight" />
16
+ <ExampleButton id="simple-element-highlight-popover" text="Highlight with Popover" />
17
+ <ExampleButton id="prevent-close" text="Prevent Closing" />
18
+ <ExampleButton id="overlay-color" text="Overlay Color" />
19
+ <ExampleButton id="popover-position" text="Popover Positioning" />
20
+ <ExampleButton id="customizing-popover" text="Customizing Popover" />
21
+ <ExampleButton id="hooks-everything" text="Hooks for Everything" />
22
+ <a href="/docs/installation"
23
+ class="items-center flex text-base md:text-base lg:text-lg text-gray-900 bg-yellow-300 rounded-lg lg:rounded-xl px-5 py-2 hover:bg-yellow-500 hover:text-black">
24
+ and much more ...
25
+ </a>
26
+ </div>
27
+
28
+ <script>
29
+ import { driver } from "driver.js";
30
+ import "driver.js/dist/driver.css";
31
+ import { mountDummyElement, removeDummyElement } from "../components/CodeSample";
32
+
33
+ function markDone(btn) {
34
+ btn.classList.add("bg-gray-300", "hover:bg-gray-200", "line-through");
35
+ }
36
+
37
+ const demoTourButton = document.querySelector("[data-demo-tour]");
38
+ demoTourButton.addEventListener("click", () => {
39
+ const driverObj = driver({
40
+ popoverClass: "driverjs-theme",
41
+ showButtons: ["next", "previous"],
42
+ steps: [
43
+ {
44
+ element: "[data-hero-text]",
45
+ popover: {
46
+ title: "Before we start",
47
+ description: "This is just one use-case, make sure to look at the docs for more use-cases and examples.",
48
+ nextBtnText: "Okay, start!",
49
+ side: "bottom",
50
+ align: "start"
51
+ }
52
+ },
53
+ {
54
+ element: "[data-driver-tagline]",
55
+ popover: {
56
+ title: "Focus Anything",
57
+ description: "You can use it to highlight literally anything, images, text, svg, div, span, li etc.",
58
+ side: "bottom",
59
+ align: "start"
60
+ }
61
+ },
62
+ {
63
+ element: "[data-driver-name]",
64
+ popover: {
65
+ title: "Why Driver.js",
66
+ description: "It's lightweight, has no dependencies, is MIT licensed, is highly customizable, and is super easy to use.",
67
+ side: "bottom",
68
+ align: "start"
69
+ }
70
+ },
71
+ {
72
+ element: "[data-docs-link]",
73
+ popover: {
74
+ title: "More Powerful than Ever",
75
+ description: "Driver.js has been completely rewritten from scratch and is now more powerful than ever.",
76
+ side: "bottom",
77
+ align: "start"
78
+ }
79
+ },
80
+ {
81
+ element: "[data-example-btns]",
82
+ popover: {
83
+ title: "Examples",
84
+ description: "Here are some examples to give you a rough idea.",
85
+ side: "bottom",
86
+ align: "start"
87
+ }
88
+ },
89
+ {
90
+ element: "[data-example-btns] a:last-child",
91
+ popover: {
92
+ title: "Visit Docs",
93
+ description: "Make sure to visit the docs for more examples and use-cases.",
94
+ side: "top",
95
+ align: "start"
96
+ }
97
+ },
98
+ {
99
+ element: "[data-github-link]",
100
+ popover: {
101
+ title: "MIT Licensed",
102
+ description: "Driver.js is MIT licensed and is used by thousands of companies around the world.",
103
+ side: "top",
104
+ align: "start"
105
+ }
106
+ },
107
+ {
108
+ popover: {
109
+ description: "<img style='width: 270px; height: 206.65px; margin-bottom: 10px; border-radius: 5px;' src='https://i.imgur.com/3WpTnyA.gif' />That's it for now, make sure to <a class='underline font-medium' href='/docs/installation'>visit the docs</a> for more examples and use-cases.",
110
+ side: "bottom",
111
+ align: "start",
112
+ showButtons: [],
113
+ popoverClass: "default-theme"
114
+ }
115
+ }
116
+ ]
117
+ });
118
+
119
+ driverObj.drive();
120
+ });
121
+
122
+ const animatedTourBtn = document.getElementById('animated-tour');
123
+ animatedTourBtn.addEventListener("click", () => {
124
+ const driverObj = driver({
125
+ popoverClass: "driverjs-theme",
126
+ showButtons: ["next", "previous"],
127
+ steps: [
128
+ {
129
+ element: "[data-examples-heading]",
130
+ popover: {
131
+ title: "Animated Tour",
132
+ description: "Animated tour can simply be achieved by setting `animate` option true.",
133
+ side: "bottom",
134
+ align: "start"
135
+ }
136
+ },
137
+ {
138
+ element: "[data-examples-tagline]",
139
+ popover: {
140
+ title: "Just an Example",
141
+ description: "We don't have many steps in this example, but you can have as many as you want.",
142
+ side: "bottom",
143
+ align: "start"
144
+ }
145
+ },
146
+ {
147
+ element: "[data-examples-tagline] a",
148
+ popover: {
149
+ title: "That's it for now",
150
+ description: "Make sure to visit the docs for more examples and use-cases.",
151
+ side: "bottom",
152
+ align: "start"
153
+ }
154
+ },
155
+ ],
156
+ onDestroyed: () => {
157
+ markDone(animatedTourBtn);
158
+ }
159
+ });
160
+
161
+ driverObj.drive();
162
+ });
163
+
164
+ const staticTourBtn = document.getElementById('static-tour');
165
+ staticTourBtn.addEventListener("click", () => {
166
+ const driverObj = driver({
167
+ animate: false,
168
+ popoverClass: "driverjs-theme",
169
+ showButtons: ["next", "previous"],
170
+ steps: [
171
+ {
172
+ element: "[data-examples-heading]",
173
+ popover: {
174
+ title: "Static Tour",
175
+ description: "This is a static tour, which means that it won't be animated.",
176
+ side: "bottom",
177
+ align: "start"
178
+ }
179
+ },
180
+ {
181
+ element: "[data-examples-tagline]",
182
+ popover: {
183
+ title: "Just an Example",
184
+ description: "We don't have many steps in this example, but you can have as many as you want.",
185
+ side: "bottom",
186
+ align: "start"
187
+ }
188
+ },
189
+ {
190
+ element: "[data-examples-tagline] a",
191
+ popover: {
192
+ title: "That's it for now",
193
+ description: "Make sure to visit the docs for more examples and use-cases.",
194
+ side: "bottom",
195
+ align: "start"
196
+ }
197
+ },
198
+ ],
199
+ onDestroyed: () => {
200
+ markDone(staticTourBtn);
201
+ }
202
+ });
203
+
204
+ driverObj.drive();
205
+ });
206
+
207
+ const asyncTourBtn = document.getElementById('async-tour');
208
+ asyncTourBtn.addEventListener("click", () => {
209
+ const driverObj = driver({
210
+ animate: true,
211
+ popoverClass: "driverjs-theme",
212
+ showButtons: ["next", "previous"],
213
+ steps: [
214
+ {
215
+ popover: {
216
+ title: "Async Tour",
217
+ description: "You can also use Driver.js to create async tours. Element for the next step doesn't exist -- we will create before moving next.",
218
+ side: "bottom",
219
+ align: "start",
220
+ onNextClick: () => {
221
+ mountDummyElement();
222
+ driverObj.moveNext();
223
+ }
224
+ }
225
+ },
226
+ {
227
+ element: '.dynamic-el',
228
+ popover: {
229
+ title: "New Element",
230
+ description: "This element was created after the first step and will be destroyed after this step.",
231
+ side: "bottom",
232
+ align: "start",
233
+ onPrevClick: () => {
234
+ removeDummyElement();
235
+ driverObj.movePrevious();
236
+ },
237
+ onNextClick: () => {
238
+ removeDummyElement();
239
+ driverObj.moveNext();
240
+ }
241
+ }
242
+ },
243
+ {
244
+ popover: {
245
+ title: "More in Docs",
246
+ description: "There is a detailed guide on <a href='/docs/async-tour/' target='_blank' class='underline font-bold'>how to create async</a> tours in the documentation.",
247
+ side: "bottom",
248
+ align: "start",
249
+ onPrevClick: () => {
250
+ mountDummyElement();
251
+ driverObj.movePrevious();
252
+ }
253
+ }
254
+ },
255
+ ],
256
+ onDestroyed: () => {
257
+ markDone(asyncTourBtn);
258
+ }
259
+ });
260
+
261
+ driverObj.drive();
262
+ });
263
+
264
+ const exitConfirm = document.getElementById('confirm-on-exit');
265
+ exitConfirm.addEventListener("click", () => {
266
+ const driverObj = driver({
267
+ animate: true,
268
+ popoverClass: "driverjs-theme",
269
+ showButtons: ["next", "previous"],
270
+ steps: [
271
+ {
272
+ element: "[data-examples-heading]",
273
+ popover: {
274
+ title: "Confirm on Exit",
275
+ description: "You can also ask for confirmation before exiting the tour.",
276
+ side: "bottom",
277
+ align: "start"
278
+ }
279
+ },
280
+ {
281
+ element: "[data-examples-tagline]",
282
+ popover: {
283
+ title: "Just an Example",
284
+ description: "We don't have many steps in this example, but you can have as many as you want.",
285
+ side: "bottom",
286
+ align: "start"
287
+ }
288
+ },
289
+ {
290
+ element: "[data-examples-tagline] a",
291
+ popover: {
292
+ title: "That's it for now",
293
+ description: "Make sure to visit the docs for more examples and use-cases.",
294
+ side: "bottom",
295
+ align: "start"
296
+ }
297
+ },
298
+ ],
299
+ onDestroyStarted: () => {
300
+ if (!driverObj.hasNextStep() || confirm("Are you sure?")) {
301
+ driverObj.destroy();
302
+ }
303
+ },
304
+ onDestroyed: () => {
305
+ markDone(exitConfirm);
306
+ }
307
+ });
308
+
309
+ driverObj.drive();
310
+ });
311
+
312
+ const showProgressBtn = document.getElementById('show-progress');
313
+ showProgressBtn.addEventListener('click', () => {
314
+ const driverObj = driver({
315
+ animate: true,
316
+ showProgress: true,
317
+ showButtons: ["next", "previous"],
318
+ steps: [
319
+ {
320
+ element: "[data-examples-heading]",
321
+ popover: {
322
+ title: "Show Progress",
323
+ description: "You can set `showProgress` to `true` and progress will be shown in the footer.",
324
+ side: "bottom",
325
+ align: "start"
326
+ }
327
+ },
328
+ {
329
+ element: "[data-examples-tagline]",
330
+ popover: {
331
+ title: "Just an Example",
332
+ description: "We don't have many steps in this example, but you can have as many as you want.",
333
+ side: "bottom",
334
+ align: "start"
335
+ }
336
+ },
337
+ {
338
+ element: "[data-examples-tagline] a",
339
+ popover: {
340
+ title: "That's it for now",
341
+ description: "Make sure to visit the docs for more examples and use-cases.",
342
+ side: "bottom",
343
+ align: "start"
344
+ }
345
+ },
346
+ ],
347
+ onDestroyed: () => {
348
+ markDone(showProgressBtn);
349
+ }
350
+ });
351
+
352
+ driverObj.drive();
353
+ });
354
+
355
+ const simpleHighlightBtn = document.getElementById('simple-element-highlight');
356
+ simpleHighlightBtn.addEventListener('click', () => {
357
+ const driverObj = driver({
358
+ popoverClass: 'driverjs-theme',
359
+ onDestroyed: () => {
360
+ markDone(simpleHighlightBtn);
361
+ }
362
+ });
363
+
364
+ driverObj.highlight({
365
+ element: '[data-example-btns]'
366
+ })
367
+ });
368
+
369
+ const simpleHighlightPopoverBtn = document.getElementById('simple-element-highlight-popover');
370
+ simpleHighlightPopoverBtn.addEventListener('click', () => {
371
+ const driverObj = driver({
372
+ popoverClass: 'driverjs-theme',
373
+ onDestroyed: () => {
374
+ markDone(simpleHighlightPopoverBtn);
375
+ }
376
+ });
377
+
378
+ driverObj.highlight({
379
+ element: '[data-example-btns]',
380
+ popover: {
381
+ title: "Popover Highlight",
382
+ description: "You can also highlight an element with a popover.",
383
+ side: 'top'
384
+ }
385
+ });
386
+ });
387
+
388
+ const noElementbtn = document.getElementById('no-element');
389
+ noElementbtn.addEventListener('click', () => {
390
+ const driverObj = driver({
391
+ popoverClass: 'driverjs-theme',
392
+ onDestroyed: () => {
393
+ markDone(noElementbtn);
394
+ }
395
+ });
396
+
397
+ driverObj.highlight({
398
+ popover: {
399
+ title: "Without Element",
400
+ description: "You can also show a popover without highlighting an element. For example, this popover is shown without highlighting anything.",
401
+ }
402
+ });
403
+ });
404
+
405
+ const preventCloseBtn = document.getElementById('prevent-close');
406
+ preventCloseBtn.addEventListener('click', () => {
407
+ const driverObj = driver({
408
+ animate: true,
409
+ allowClose: false,
410
+ showProgress: true,
411
+ showButtons: ["next", "previous"],
412
+ steps: [
413
+ {
414
+ element: "[data-examples-heading]",
415
+ popover: {
416
+ title: "Show Progress",
417
+ description: "You can set `showProgress` to `true` and progress will be shown in the footer.",
418
+ side: "bottom",
419
+ align: "start"
420
+ }
421
+ },
422
+ {
423
+ element: "[data-examples-tagline]",
424
+ popover: {
425
+ title: "Just an Example",
426
+ description: "We don't have many steps in this example, but you can have as many as you want.",
427
+ side: "bottom",
428
+ align: "start"
429
+ }
430
+ },
431
+ {
432
+ element: "[data-examples-tagline] a",
433
+ popover: {
434
+ title: "That's it for now",
435
+ description: "Make sure to visit the docs for more examples and use-cases.",
436
+ side: "bottom",
437
+ align: "start"
438
+ }
439
+ },
440
+ ],
441
+ onDestroyed: () => {
442
+ markDone(preventCloseBtn);
443
+ }
444
+ });
445
+
446
+ driverObj.drive();
447
+ });
448
+
449
+ const overlayColorBtn = document.getElementById('overlay-color');
450
+ overlayColorBtn.addEventListener('click', () => {
451
+ const driverObj = driver({
452
+ overlayColor: 'red',
453
+ overlayOpacity: 0.5,
454
+ onDestroyed: () => {
455
+ markDone(overlayColorBtn);
456
+ }
457
+ });
458
+
459
+ driverObj.highlight({
460
+ element: '[data-example-btns]',
461
+ popover: {
462
+ title: "Popover Highlight",
463
+ description: "You can also highlight an element with a popover.",
464
+ side: 'top'
465
+ }
466
+ });
467
+ });
468
+
469
+ const popoverPositionBtn = document.getElementById('popover-position');
470
+ popoverPositionBtn.addEventListener('click', () => {
471
+ const driverObj = driver({
472
+ onDestroyed: () => {
473
+ markDone(popoverPositionBtn);
474
+ }
475
+ });
476
+
477
+ driverObj.highlight({
478
+ element: '#popover-position',
479
+ popover: {
480
+ title: "Popover Position",
481
+ description: "You can also change the position of the popover using `side` and `align` options.<br /> Allowed sides are `top`, `bottom`, `left` and `right`. Allowed aligns are `start`, `center` and `end`.",
482
+ side: 'top',
483
+ align: 'start'
484
+ }
485
+ });
486
+ });
487
+
488
+ const customizingBtn = document.getElementById('customizing-popover');
489
+ customizingBtn.addEventListener('click', () => {
490
+ const driverObj = driver({
491
+ popoverClass: 'driverjs-theme',
492
+ onDestroyed: () => {
493
+ markDone(customizingBtn);
494
+ }
495
+ });
496
+
497
+ driverObj.highlight({
498
+ element: '#customizing-popover',
499
+ popover: {
500
+ title: "Customizing Popover",
501
+ description: "Add your own class using `popoverClass` or use `onPopoverRendered` to get full control over the popover. <br /><br /> Visit these pages which cover <a class='font-medium underline' href='/docs/styling-popover'>styling</a> and <a class='font-medium underline' href='/docs/buttons'>customizing popovers</a> in detail.",
502
+ side: 'top',
503
+ align: 'start'
504
+ }
505
+ });
506
+ });
507
+
508
+ const hooksEverythingBtn = document.getElementById('hooks-everything');
509
+ hooksEverythingBtn.addEventListener('click', () => {
510
+ const driverObj = driver({
511
+ popoverClass: 'driverjs-theme',
512
+ onDestroyed: () => {
513
+ markDone(hooksEverythingBtn);
514
+ }
515
+ });
516
+
517
+ driverObj.highlight({
518
+ element: '#hooks-everything',
519
+ popover: {
520
+ title: "Hooks for Everything",
521
+ description: "Have a look at the <a class='font-medium underline' href='/docs/configuration'>configuration</a> page to see how you can use hooks to control the driver.",
522
+ side: 'top',
523
+ align: 'start'
524
+ }
525
+ });
526
+ });
527
+ </script>
docs/src/components/FeatureMarquee.tsx CHANGED
@@ -19,10 +19,10 @@ const featureList = [
19
  export function FeatureMarquee() {
20
  return (
21
  <Marquee autoFill>
22
- <p className="py-4 text-2xl whitespace-nowrap">
23
  { featureList.map((featureItem, index) => (
24
  <React.Fragment key={index}>
25
- { featureItem }<span className="mx-3">&middot;</span>
26
  </React.Fragment>
27
  ))}
28
  </p>
 
19
  export function FeatureMarquee() {
20
  return (
21
  <Marquee autoFill>
22
+ <p className="py-2.5 md:py-3.5 lg:py-4 text-lg md:text-xl lg:text-2xl whitespace-nowrap">
23
  { featureList.map((featureItem, index) => (
24
  <React.Fragment key={index}>
25
+ { featureItem }<span className="mx-2 md:mx-3">&middot;</span>
26
  </React.Fragment>
27
  ))}
28
  </p>
docs/src/components/HeroSection.astro ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ import Container from "./Container.astro";
3
+ ---
4
+ <div class="bg-yellow-300">
5
+ <Container>
6
+ <div class="py-10 md:py-14 lg:py-20 flex justify-start items-center gap-4">
7
+ <div class="flex-grow" data-hero-text>
8
+ <h1 data-driver-name class="text-7xl md:text-8xl lg:text-9xl mb-2 md:mb-3 lg:mb-4 font-bold">driver.js</h1>
9
+ <p data-driver-tagline class="text-md md:text-2xl lg:text-3xl">Product tours, highlights, contextual help and more.</p>
10
+ <div class="mt-4 md:mt-8 lg:mt-10 flex flex-col sm:flex-row gap-2 items-stretch">
11
+ <button data-demo-tour class="bg-black rounded-xl py-2 md:py-3 px-6 font-medium text-white text-lg md:text-xl focus:outline-0">
12
+ Show Demo Tour
13
+ </button>
14
+ <a href="/docs/installation"
15
+ data-docs-link
16
+ class="bg-white rounded-xl py-2 md:py-3 px-6 font-medium text-black text-lg md:text-xl focus:outline-0 border-4 border-black text-center">
17
+ Get Started
18
+ </a>
19
+ </div>
20
+ </div>
21
+ <div class="flex-shrink-0 hidden sm:flex">
22
+ <img src="/driver.svg" alt="Hero Image" class="sm:h-48 md:h-60 lg:h-72" />
23
+ </div>
24
+ </div>
25
+ </Container>
26
+ </div>
docs/src/components/OpenSourceLove.astro ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ import Container from "./Container.astro";
3
+ import { getFormattedStars } from "../lib/github";
4
+
5
+ const starCount = getFormattedStars('kamranahmedse/driver.js');
6
+ ---
7
+ <div class="py-10 md:py-12 lg:py-24 bg-white text-black border-t-2 border-t-black">
8
+ <Container>
9
+ <div class="flex items-center">
10
+ <div>
11
+ <h2 class="text-3xl md:text-4xl lg:text-6xl font-bold mb-4">Loved by Many</h2>
12
+ <p class="md:text-xl lg:text-2xl text-black mb-6 lg:mb-8">With millions of downloads, Driver.js is an <span class="font-bold">MIT licensed</span>
13
+ opensource
14
+ project and is used by
15
+ thousands of companies around the world.</p>
16
+
17
+ <div class="flex flex-col sm:flex-row gap-2 md:gap-3">
18
+ <a href="https://github.com/kamranahmedse/driver.js"
19
+ data-github-link
20
+ target="_blank"
21
+ class="flex justify-center items-center font-medium text-lg md:text-xl lg:text-2xl rounded-lg lg:rounded-xl py-2 lg:py-3 px-5 bg-yellow-300 border-black hover:bg-yellow-400">
22
+ <span class="mr-3 inline-flex items-center"><img src="/star.svg" alt="Hero Image" class="h-5 md:h-7 mr-1 md:mr-2" /> { starCount }</span>
23
+ GitHub Stars
24
+ </a>
25
+ <a href="/docs/installation"
26
+ class="bg-black justify-center text-white flex items-center font-medium text-lg md:text-xl lg:text-2xl border-4 border-black rounded-lg lg:rounded-xl py-2 lg:py-3 px-5 hover:bg-gray-800">
27
+ Start Using Driver.js
28
+ </a>
29
+ </div>
30
+ </div>
31
+ <img src="/thumbs.svg" alt="Hero Image" class="hidden lg:block h-36 ml-16" />
32
+ </div>
33
+ </Container>
34
+ </div>
docs/src/components/UsecaseItem.astro CHANGED
@@ -7,12 +7,12 @@ export interface Props {
7
  const { title, description } = Astro.props;
8
  ---
9
 
10
- <div class="flex flex-col gap-4">
11
- <span class="border-b-2 border-b-black block w-[50px]"></span>
12
- <h3 class="text-3xl font-bold text-black">
13
  { title }
14
  </h3>
15
- <p class="text-xl text-black">
16
  { description }
17
  </p>
18
  </div>
 
7
  const { title, description } = Astro.props;
8
  ---
9
 
10
+ <div class="flex flex-col gap-2 md:gap-2 lg:gap-4 pt-2">
11
+ <span class="border-b-2 border-b-black block w-[30px] md:w-[40px] lg:w-[50px]"></span>
12
+ <h3 class="text-xl md:text-2xl lg:text-3xl mt-2 md:mt-3 lg:mt-0 font-bold text-black">
13
  { title }
14
  </h3>
15
+ <p class="md:text-lg lg:text-xl text-black">
16
  { description }
17
  </p>
18
  </div>
docs/src/components/UsecaseList.astro ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ import UsecaseItem from "./UsecaseItem.astro";
3
+ ---
4
+ <p class="text-base md:text-xl lg:text-2xl text-black">Due to it's extensive API, driver.js can be used for a wide range of use
5
+ cases.</p>
6
+ <div class="grid grid-cols-1 sm:grid-cols-2 gap-4 md:gap-6 lg:gap-12 mt-10">
7
+ <UsecaseItem
8
+ title="Onboard Users"
9
+ description="Onboard your users by explaining how to use your product and answer common questions."
10
+ />
11
+ <UsecaseItem
12
+ title="Remove Distractions"
13
+ description="With highlight feature, you can remove distractions and focus your users attention on what matters."
14
+ />
15
+ <UsecaseItem
16
+ title="Contextual Help"
17
+ description="Provide contextual help for your users, explain how to use your product and answer common questions."
18
+ />
19
+ <UsecaseItem
20
+ title="Feature Adoption"
21
+ description="Highlight new features, explain how to use them and make sure your users don't miss them."
22
+ />
23
+ </div>
docs/src/components/examples/SimpleHighlight.tsx DELETED
@@ -1,25 +0,0 @@
1
- import { useEffect } from "react";
2
- import { Config, driver } from "driver.js";
3
- import "driver.js/dist/driver.css";
4
-
5
- import type { DriveStep } from "driver.js";
6
-
7
- type SimpleHighlightProps = {
8
- config?: Config;
9
- step: DriveStep;
10
- };
11
-
12
- export function SimpleHighlight(props: SimpleHighlightProps) {
13
- const { config, step } = props;
14
-
15
- function onClick() {
16
- const driverObj = driver(config);
17
- driverObj.highlight(step);
18
- }
19
-
20
- return (
21
- <button onClick={onClick} className="w-full rounded-md bg-black p-2 text-white">
22
- Highlight Something
23
- </button>
24
- );
25
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docs/src/content/guides/installation.mdx CHANGED
@@ -4,8 +4,6 @@ groupTitle: "Introduction"
4
  sort: 1
5
  ---
6
 
7
- import { SimpleHighlight } from "../../components/examples/SimpleHighlight.js";
8
-
9
  Run one of the following commands to install the package:
10
 
11
  ```bash
 
4
  sort: 1
5
  ---
6
 
 
 
7
  Run one of the following commands to install the package:
8
 
9
  ```bash
docs/src/pages/index.astro CHANGED
@@ -3,634 +3,48 @@ import BaseLayout from "../layouts/BaseLayout.astro";
3
  import { FeatureMarquee } from "../components/FeatureMarquee";
4
  import Container from "../components/Container.astro";
5
  import UsecaseItem from "../components/UsecaseItem.astro";
6
- import { ExampleButton } from "../components/examples/ExampleButton";
7
- import { getFormattedStars } from "../lib/github";
8
-
9
- const starCount = getFormattedStars('kamranahmedse/driver.js');
 
10
  ---
11
  <BaseLayout>
12
- <div class="bg-yellow-300">
13
- <Container>
14
- <div class="py-10 md:py-20 flex justify-start items-center gap-4">
15
- <div class="flex-grow" data-hero-text>
16
- <h1 data-driver-name class="text-5xl md:text-9xl mb-2 md:mb-4 font-bold">driver.js</h1>
17
- <p data-driver-tagline class="text-md md:text-3xl">Product tours, highlights, contextual help and more.</p>
18
- <div class="mt-4 md:mt-12 mb-2 flex gap-2 items-stretch">
19
- <button data-demo-tour class="bg-black rounded-lg md:rounded-xl py-2 md:py-4 px-5 font-medium text-white text-base md:text-xl focus:outline-0">
20
- Show Demo Tour
21
- </button>
22
- <a href="/docs/installation"
23
- data-docs-link
24
- class="flex items-center font-bold text-xl border-4 border-black rounded-xl px-5 bg-white">
25
- Get Started
26
- </a>
27
- </div>
28
- </div>
29
- <div class="flex-shrink-0 hidden md:flex">
30
- <img src="/driver.svg" alt="Hero Image" class="h-72" />
31
- </div>
32
- </div>
33
- </Container>
34
- </div>
35
- <div class="bg-white overflow-x-hidden overflow-y-hidden relative h-[64px] border-b-2 border-b-black" data-feat-marquee>
36
  <FeatureMarquee client:only />
37
  </div>
38
 
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>
46
- <ExampleButton id="animated-tour" text="Animated Tour" />
47
- <ExampleButton id="static-tour" text="Non-Animated Tour" />
48
- <ExampleButton id="async-tour" text="Async Tour" />
49
- <ExampleButton id="no-element" text="No Element" />
50
- <ExampleButton id="confirm-on-exit" text="Confirm on Exit" />
51
- <ExampleButton id="show-progress" text="Show Progress" />
52
- <ExampleButton id="simple-element-highlight" text="Simple Highlight" />
53
- <ExampleButton id="simple-element-highlight-popover" text="Highlight with Popover" />
54
- <ExampleButton id="prevent-close" text="Prevent Closing" />
55
- <ExampleButton id="overlay-color" text="Overlay Color" />
56
- <ExampleButton id="popover-position" text="Popover Positioning" />
57
- <ExampleButton id="customizing-popover" text="Customizing Popover" />
58
- <ExampleButton id="hooks-everything" text="Hooks for Everything" />
59
- <a href="/docs/installation"
60
- class="items-center flex text-lg text-gray-900 bg-yellow-300 rounded-xl px-5 hover:bg-yellow-500 hover:text-black">
61
- and much more ...
62
- </a>
63
- </div>
64
-
65
- <p class="text-2xl my-14 text-black">Due to it's extensive API, driver.js can be used for a wide range of use
66
- cases.</p>
67
- <div class="grid grid-cols-1 md:grid-cols-2 gap-12">
68
- <UsecaseItem
69
- title="Onboard Users"
70
- description="Onboard your users by explaining how to use your product and answer common questions."
71
- />
72
- <UsecaseItem
73
- title="Remove Distractions"
74
- description="With highlight feature, you can remove distractions and focus your users attention on what matters."
75
- />
76
- <UsecaseItem
77
- title="Contextual Help"
78
- description="Provide contextual help for your users, explain how to use your product and answer common questions."
79
- />
80
- <UsecaseItem
81
- title="Feature Adoption"
82
- description="Highlight new features, explain how to use them and make sure your users don't miss them."
83
- />
84
- </div>
85
  </Container>
86
  </div>
87
 
88
- <div class="py-24 bg-white text-black border-t-2 border-t-black">
89
- <Container>
90
- <div class="flex items-center">
91
- <div>
92
- <h2 class="text-6xl font-bold mb-4">Loved by Many</h2>
93
- <p class="text-2xl text-black mb-8">With millions of downloads, Driver.js is an <span class="font-bold">MIT licensed</span>
94
- opensource
95
- project and is used by
96
- thousands of companies around the world.</p>
97
-
98
- <div class="flex gap-3">
99
- <a href="https://github.com/kamranahmedse/driver.js"
100
- data-github-link
101
- target="_blank"
102
- class="flex items-center font-medium text-2xl rounded-xl py-3 px-5 bg-yellow-300 border-black hover:bg-yellow-400">
103
- <span class="mr-3 inline-flex items-center"><img src="/star.svg" alt="Hero Image" class="h-7 mr-2" /> { starCount }</span>
104
- GitHub Stars
105
- </a>
106
- <a href="/docs/installation"
107
- class="bg-black text-white flex items-center font-medium text-2xl border-4 border-black rounded-xl py-3 px-5 hover:bg-gray-800">
108
- Start Using Driver.js
109
- </a>
110
- </div>
111
- </div>
112
- <img src="/thumbs.svg" alt="Hero Image" class="h-36 ml-16" />
113
- </div>
114
- </Container>
115
- </div>
116
 
117
  <div class="py-8 bg-black text-white">
118
  <Container>
119
  <p class="text-lg text-white text-center">
120
- MIT Licensed &copy; 2023 <span class="mx-3">&middot;</span>
121
- <a href="/docs/installation" class="">
122
- Docs
123
- </a>
124
- <a href="https://github.com/kamranahmedse/driver.js" target="_blank" class="ml-5">
125
- GitHub
126
- <img src="/arrow.svg" class="h-3 inline-block ml-2" alt="GitHub" />
127
- </a>
128
- <a href="https://twitter.com/kamrify" target="_blank" class=" ml-5">
129
- Twitter
130
- <img src="/arrow.svg" class="h-3 inline-block ml-2" alt="GitHub" />
131
- </a>
 
 
 
132
  </p>
133
  </Container>
134
  </div>
135
-
136
- <script>
137
- import { driver } from "driver.js";
138
- import "driver.js/dist/driver.css";
139
- import { mountDummyElement, removeDummyElement } from "../components/CodeSample";
140
-
141
- function markDone(btn) {
142
- btn.classList.add("bg-gray-300", "hover:bg-gray-200", "line-through");
143
- }
144
-
145
- const demoTourButton = document.querySelector("[data-demo-tour]");
146
- demoTourButton.addEventListener("click", () => {
147
- const driverObj = driver({
148
- popoverClass: "driverjs-theme",
149
- showButtons: ["next", "previous"],
150
- steps: [
151
- {
152
- element: "[data-hero-text]",
153
- popover: {
154
- title: "Before we start",
155
- description: "This is just one use-case, make sure to look at the docs for more use-cases and examples.",
156
- nextBtnText: "Okay, start!",
157
- side: "bottom",
158
- align: "start"
159
- }
160
- },
161
- {
162
- element: "[data-driver-tagline]",
163
- popover: {
164
- title: "Focus Anything",
165
- description: "You can use it to highlight literally anything, images, text, svg, div, span, li etc.",
166
- side: "bottom",
167
- align: "start"
168
- }
169
- },
170
- {
171
- element: "[data-driver-name]",
172
- popover: {
173
- title: "Why Driver.js",
174
- description: "It's lightweight, has no dependencies, is MIT licensed, is highly customizable, and is super easy to use.",
175
- side: "bottom",
176
- align: "start"
177
- }
178
- },
179
- {
180
- element: "[data-docs-link]",
181
- popover: {
182
- title: "More Powerful than Ever",
183
- description: "Driver.js has been completely rewritten from scratch and is now more powerful than ever.",
184
- side: "bottom",
185
- align: "start"
186
- }
187
- },
188
- {
189
- element: "[data-example-btns]",
190
- popover: {
191
- title: "Examples",
192
- description: "Here are some examples to give you a rough idea.",
193
- side: "bottom",
194
- align: "start"
195
- }
196
- },
197
- {
198
- element: "[data-example-btns] a:last-child",
199
- popover: {
200
- title: "Visit Docs",
201
- description: "Make sure to visit the docs for more examples and use-cases.",
202
- side: "top",
203
- align: "start"
204
- }
205
- },
206
- {
207
- element: "[data-github-link]",
208
- popover: {
209
- title: "MIT Licensed",
210
- description: "Driver.js is MIT licensed and is used by thousands of companies around the world.",
211
- side: "top",
212
- align: "start"
213
- }
214
- },
215
- {
216
- popover: {
217
- description: "<img style='width: 270px; height: 206.65px; margin-bottom: 10px; border-radius: 5px;' src='https://i.imgur.com/3WpTnyA.gif' />That's it for now, make sure to <a class='underline font-medium' href='/docs/installation'>visit the docs</a> for more examples and use-cases.",
218
- side: "bottom",
219
- align: "start",
220
- showButtons: [],
221
- popoverClass: "default-theme"
222
- }
223
- }
224
- ]
225
- });
226
-
227
- driverObj.drive();
228
- });
229
-
230
- const animatedTourBtn = document.getElementById('animated-tour');
231
- animatedTourBtn.addEventListener("click", () => {
232
- const driverObj = driver({
233
- popoverClass: "driverjs-theme",
234
- showButtons: ["next", "previous"],
235
- steps: [
236
- {
237
- element: "[data-examples-heading]",
238
- popover: {
239
- title: "Animated Tour",
240
- description: "Animated tour can simply be achieved by setting `animate` option true.",
241
- side: "bottom",
242
- align: "start"
243
- }
244
- },
245
- {
246
- element: "[data-examples-tagline]",
247
- popover: {
248
- title: "Just an Example",
249
- description: "We don't have many steps in this example, but you can have as many as you want.",
250
- side: "bottom",
251
- align: "start"
252
- }
253
- },
254
- {
255
- element: "[data-examples-tagline] a",
256
- popover: {
257
- title: "That's it for now",
258
- description: "Make sure to visit the docs for more examples and use-cases.",
259
- side: "bottom",
260
- align: "start"
261
- }
262
- },
263
- ],
264
- onDestroyed: () => {
265
- markDone(animatedTourBtn);
266
- }
267
- });
268
-
269
- driverObj.drive();
270
- });
271
-
272
- const staticTourBtn = document.getElementById('static-tour');
273
- staticTourBtn.addEventListener("click", () => {
274
- const driverObj = driver({
275
- animate: false,
276
- popoverClass: "driverjs-theme",
277
- showButtons: ["next", "previous"],
278
- steps: [
279
- {
280
- element: "[data-examples-heading]",
281
- popover: {
282
- title: "Static Tour",
283
- description: "This is a static tour, which means that it won't be animated.",
284
- side: "bottom",
285
- align: "start"
286
- }
287
- },
288
- {
289
- element: "[data-examples-tagline]",
290
- popover: {
291
- title: "Just an Example",
292
- description: "We don't have many steps in this example, but you can have as many as you want.",
293
- side: "bottom",
294
- align: "start"
295
- }
296
- },
297
- {
298
- element: "[data-examples-tagline] a",
299
- popover: {
300
- title: "That's it for now",
301
- description: "Make sure to visit the docs for more examples and use-cases.",
302
- side: "bottom",
303
- align: "start"
304
- }
305
- },
306
- ],
307
- onDestroyed: () => {
308
- markDone(staticTourBtn);
309
- }
310
- });
311
-
312
- driverObj.drive();
313
- });
314
-
315
- const asyncTourBtn = document.getElementById('async-tour');
316
- asyncTourBtn.addEventListener("click", () => {
317
- const driverObj = driver({
318
- animate: true,
319
- popoverClass: "driverjs-theme",
320
- showButtons: ["next", "previous"],
321
- steps: [
322
- {
323
- popover: {
324
- title: "Async Tour",
325
- description: "You can also use Driver.js to create async tours. Element for the next step doesn't exist -- we will create before moving next.",
326
- side: "bottom",
327
- align: "start",
328
- onNextClick: () => {
329
- mountDummyElement();
330
- driverObj.moveNext();
331
- }
332
- }
333
- },
334
- {
335
- element: '.dynamic-el',
336
- popover: {
337
- title: "New Element",
338
- description: "This element was created after the first step and will be destroyed after this step.",
339
- side: "bottom",
340
- align: "start",
341
- onPrevClick: () => {
342
- removeDummyElement();
343
- driverObj.movePrevious();
344
- },
345
- onNextClick: () => {
346
- removeDummyElement();
347
- driverObj.moveNext();
348
- }
349
- }
350
- },
351
- {
352
- popover: {
353
- title: "More in Docs",
354
- description: "There is a detailed guide on <a href='/docs/async-tour/' target='_blank' class='underline font-bold'>how to create async</a> tours in the documentation.",
355
- side: "bottom",
356
- align: "start",
357
- onPrevClick: () => {
358
- mountDummyElement();
359
- driverObj.movePrevious();
360
- }
361
- }
362
- },
363
- ],
364
- onDestroyed: () => {
365
- markDone(asyncTourBtn);
366
- }
367
- });
368
-
369
- driverObj.drive();
370
- });
371
-
372
- const exitConfirm = document.getElementById('confirm-on-exit');
373
- exitConfirm.addEventListener("click", () => {
374
- const driverObj = driver({
375
- animate: true,
376
- popoverClass: "driverjs-theme",
377
- showButtons: ["next", "previous"],
378
- steps: [
379
- {
380
- element: "[data-examples-heading]",
381
- popover: {
382
- title: "Confirm on Exit",
383
- description: "You can also ask for confirmation before exiting the tour.",
384
- side: "bottom",
385
- align: "start"
386
- }
387
- },
388
- {
389
- element: "[data-examples-tagline]",
390
- popover: {
391
- title: "Just an Example",
392
- description: "We don't have many steps in this example, but you can have as many as you want.",
393
- side: "bottom",
394
- align: "start"
395
- }
396
- },
397
- {
398
- element: "[data-examples-tagline] a",
399
- popover: {
400
- title: "That's it for now",
401
- description: "Make sure to visit the docs for more examples and use-cases.",
402
- side: "bottom",
403
- align: "start"
404
- }
405
- },
406
- ],
407
- onDestroyStarted: () => {
408
- if (!driverObj.hasNextStep() || confirm("Are you sure?")) {
409
- driverObj.destroy();
410
- }
411
- },
412
- onDestroyed: () => {
413
- markDone(exitConfirm);
414
- }
415
- });
416
-
417
- driverObj.drive();
418
- });
419
-
420
- const showProgressBtn = document.getElementById('show-progress');
421
- showProgressBtn.addEventListener('click', () => {
422
- const driverObj = driver({
423
- animate: true,
424
- showProgress: true,
425
- showButtons: ["next", "previous"],
426
- steps: [
427
- {
428
- element: "[data-examples-heading]",
429
- popover: {
430
- title: "Show Progress",
431
- description: "You can set `showProgress` to `true` and progress will be shown in the footer.",
432
- side: "bottom",
433
- align: "start"
434
- }
435
- },
436
- {
437
- element: "[data-examples-tagline]",
438
- popover: {
439
- title: "Just an Example",
440
- description: "We don't have many steps in this example, but you can have as many as you want.",
441
- side: "bottom",
442
- align: "start"
443
- }
444
- },
445
- {
446
- element: "[data-examples-tagline] a",
447
- popover: {
448
- title: "That's it for now",
449
- description: "Make sure to visit the docs for more examples and use-cases.",
450
- side: "bottom",
451
- align: "start"
452
- }
453
- },
454
- ],
455
- onDestroyed: () => {
456
- markDone(showProgressBtn);
457
- }
458
- });
459
-
460
- driverObj.drive();
461
- });
462
-
463
- const simpleHighlightBtn = document.getElementById('simple-element-highlight');
464
- simpleHighlightBtn.addEventListener('click', () => {
465
- const driverObj = driver({
466
- popoverClass: 'driverjs-theme',
467
- onDestroyed: () => {
468
- markDone(simpleHighlightBtn);
469
- }
470
- });
471
-
472
- driverObj.highlight({
473
- element: '[data-example-btns]'
474
- })
475
- });
476
-
477
- const simpleHighlightPopoverBtn = document.getElementById('simple-element-highlight-popover');
478
- simpleHighlightPopoverBtn.addEventListener('click', () => {
479
- const driverObj = driver({
480
- popoverClass: 'driverjs-theme',
481
- onDestroyed: () => {
482
- markDone(simpleHighlightPopoverBtn);
483
- }
484
- });
485
-
486
- driverObj.highlight({
487
- element: '[data-example-btns]',
488
- popover: {
489
- title: "Popover Highlight",
490
- description: "You can also highlight an element with a popover.",
491
- side: 'top'
492
- }
493
- });
494
- });
495
-
496
- const noElementbtn = document.getElementById('no-element');
497
- noElementbtn.addEventListener('click', () => {
498
- const driverObj = driver({
499
- popoverClass: 'driverjs-theme',
500
- onDestroyed: () => {
501
- markDone(noElementbtn);
502
- }
503
- });
504
-
505
- driverObj.highlight({
506
- popover: {
507
- title: "Without Element",
508
- description: "You can also show a popover without highlighting an element. For example, this popover is shown without highlighting anything.",
509
- }
510
- });
511
- });
512
-
513
- const preventCloseBtn = document.getElementById('prevent-close');
514
- preventCloseBtn.addEventListener('click', () => {
515
- const driverObj = driver({
516
- animate: true,
517
- allowClose: false,
518
- showProgress: true,
519
- showButtons: ["next", "previous"],
520
- steps: [
521
- {
522
- element: "[data-examples-heading]",
523
- popover: {
524
- title: "Show Progress",
525
- description: "You can set `showProgress` to `true` and progress will be shown in the footer.",
526
- side: "bottom",
527
- align: "start"
528
- }
529
- },
530
- {
531
- element: "[data-examples-tagline]",
532
- popover: {
533
- title: "Just an Example",
534
- description: "We don't have many steps in this example, but you can have as many as you want.",
535
- side: "bottom",
536
- align: "start"
537
- }
538
- },
539
- {
540
- element: "[data-examples-tagline] a",
541
- popover: {
542
- title: "That's it for now",
543
- description: "Make sure to visit the docs for more examples and use-cases.",
544
- side: "bottom",
545
- align: "start"
546
- }
547
- },
548
- ],
549
- onDestroyed: () => {
550
- markDone(preventCloseBtn);
551
- }
552
- });
553
-
554
- driverObj.drive();
555
- });
556
-
557
- const overlayColorBtn = document.getElementById('overlay-color');
558
- overlayColorBtn.addEventListener('click', () => {
559
- const driverObj = driver({
560
- overlayColor: 'red',
561
- overlayOpacity: 0.5,
562
- onDestroyed: () => {
563
- markDone(overlayColorBtn);
564
- }
565
- });
566
-
567
- driverObj.highlight({
568
- element: '[data-example-btns]',
569
- popover: {
570
- title: "Popover Highlight",
571
- description: "You can also highlight an element with a popover.",
572
- side: 'top'
573
- }
574
- });
575
- });
576
-
577
- const popoverPositionBtn = document.getElementById('popover-position');
578
- popoverPositionBtn.addEventListener('click', () => {
579
- const driverObj = driver({
580
- onDestroyed: () => {
581
- markDone(popoverPositionBtn);
582
- }
583
- });
584
-
585
- driverObj.highlight({
586
- element: '#popover-position',
587
- popover: {
588
- title: "Popover Position",
589
- description: "You can also change the position of the popover using `side` and `align` options.<br /> Allowed sides are `top`, `bottom`, `left` and `right`. Allowed aligns are `start`, `center` and `end`.",
590
- side: 'top',
591
- align: 'start'
592
- }
593
- });
594
- });
595
-
596
- const customizingBtn = document.getElementById('customizing-popover');
597
- customizingBtn.addEventListener('click', () => {
598
- const driverObj = driver({
599
- popoverClass: 'driverjs-theme',
600
- onDestroyed: () => {
601
- markDone(customizingBtn);
602
- }
603
- });
604
-
605
- driverObj.highlight({
606
- element: '#customizing-popover',
607
- popover: {
608
- title: "Customizing Popover",
609
- description: "Add your own class using `popoverClass` or use `onPopoverRendered` to get full control over the popover. <br /><br /> Visit these pages which cover <a class='font-medium underline' href='/docs/styling-popover'>styling</a> and <a class='font-medium underline' href='/docs/buttons'>customizing popovers</a> in detail.",
610
- side: 'top',
611
- align: 'start'
612
- }
613
- });
614
- });
615
-
616
- const hooksEverythingBtn = document.getElementById('hooks-everything');
617
- hooksEverythingBtn.addEventListener('click', () => {
618
- const driverObj = driver({
619
- popoverClass: 'driverjs-theme',
620
- onDestroyed: () => {
621
- markDone(hooksEverythingBtn);
622
- }
623
- });
624
-
625
- driverObj.highlight({
626
- element: '#hooks-everything',
627
- popover: {
628
- title: "Hooks for Everything",
629
- description: "Have a look at the <a class='font-medium underline' href='/docs/configuration'>configuration</a> page to see how you can use hooks to control the driver.",
630
- side: 'top',
631
- align: 'start'
632
- }
633
- });
634
- });
635
- </script>
636
  </BaseLayout>
 
3
  import { FeatureMarquee } from "../components/FeatureMarquee";
4
  import Container from "../components/Container.astro";
5
  import UsecaseItem from "../components/UsecaseItem.astro";
6
+ import { ExampleButton } from "../components/ExampleButton";
7
+ import HeroSection from "../components/HeroSection.astro";
8
+ import Examples from "../components/Examples.astro";
9
+ import UsecaseList from "../components/UsecaseList.astro";
10
+ import OpenSourceLove from "../components/OpenSourceLove.astro";
11
  ---
12
  <BaseLayout>
13
+ <HeroSection />
14
+ <div
15
+ class="bg-white overflow-x-hidden overflow-y-hidden relative h-[48px] md:h-[56px] lg:h-[64px] border-b-2 border-b-black"
16
+ data-feat-marquee>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  <FeatureMarquee client:only />
18
  </div>
19
 
20
+ <div class="py-10 md:py-12 lg:py-24 bg-white text-black">
21
  <Container>
22
+ <Examples />
23
+ <UsecaseList />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  </Container>
25
  </div>
26
 
27
+ <OpenSourceLove />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  <div class="py-8 bg-black text-white">
30
  <Container>
31
  <p class="text-lg text-white text-center">
32
+ MIT Licensed &copy; 2023
33
+ <span class="hidden sm:inline">
34
+ <span class="mx-3">&middot;</span>
35
+ <a href="/docs/installation" class="">
36
+ Docs
37
+ </a>
38
+ <a href="https://github.com/kamranahmedse/driver.js" target="_blank" class="ml-5">
39
+ GitHub
40
+ <img src="/arrow.svg" class="h-3 inline-block ml-2" alt="GitHub" />
41
+ </a>
42
+ <a href="https://twitter.com/kamrify" target="_blank" class=" ml-5">
43
+ Twitter
44
+ <img src="/arrow.svg" class="h-3 inline-block ml-2" alt="GitHub" />
45
+ </a>
46
+ </span>
47
  </p>
48
  </Container>
49
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  </BaseLayout>