mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
824 B
TypeScript
42 lines
824 B
TypeScript
import Shepherd from 'shepherd.js';
|
|
import { steps } from './steps';
|
|
import './style.less';
|
|
|
|
const KEY = 'com.msgbyte.intro/hasRun';
|
|
|
|
if (!window.localStorage.getItem(KEY)) {
|
|
const tour = new Shepherd.Tour({
|
|
useModalOverlay: true,
|
|
defaultStepOptions: {
|
|
classes: 'shadow-md',
|
|
scrollTo: true,
|
|
arrow: false,
|
|
modalOverlayOpeningRadius: 4,
|
|
modalOverlayOpeningPadding: 4,
|
|
buttons: [
|
|
{
|
|
text: '跳过引导',
|
|
secondary: true,
|
|
action() {
|
|
this.complete();
|
|
},
|
|
},
|
|
{
|
|
text: '下一步',
|
|
action() {
|
|
this.next();
|
|
},
|
|
},
|
|
],
|
|
},
|
|
});
|
|
|
|
tour.on('complete', () => {
|
|
window.localStorage.setItem(KEY, 'true');
|
|
});
|
|
|
|
tour.addSteps(steps);
|
|
|
|
tour.start();
|
|
}
|