avancement tuto
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
cb62ad1605
commit
ec59956625
@ -1,41 +1,110 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import introJs from 'intro.js';
|
||||
import { ModalService } from '../modal/modal.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class IntroService {
|
||||
private intro = introJs();
|
||||
constructor(private modalService: ModalService) {}
|
||||
|
||||
constructor() {}
|
||||
private sleep(ms: number): Promise<void> {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
async startIntro() {
|
||||
await new Promise<void>((resolve) => {
|
||||
const intro = introJs();
|
||||
intro.setOptions({
|
||||
tooltipClass: 'custom-tooltip-with-avatar',
|
||||
steps: [
|
||||
{ intro: 'Welcome to the web let me show you around!' },
|
||||
{ element: '#timeline', intro: 'This is the logo of Memory Map.' },
|
||||
{ element: '#quete', intro: 'Click here to open the search bar on mobile.' },
|
||||
],
|
||||
exitOnOverlayClick: false,
|
||||
disableInteraction: false,
|
||||
});
|
||||
|
||||
intro.oncomplete(() => {
|
||||
resolve();
|
||||
});
|
||||
|
||||
intro.start();
|
||||
});
|
||||
await this.sleep(300);
|
||||
|
||||
await new Promise<void>((resolve) => {
|
||||
const intro = introJs();
|
||||
|
||||
intro.setOptions({
|
||||
tooltipClass: 'custom-tooltip-with-avatar',
|
||||
steps: [
|
||||
{ element: '#add', intro: 'salut voici le bouton' },
|
||||
{ element: '#add-pin-modal-title', intro: 'salut voici le bouton' },
|
||||
{ element: '#add-pin-modal-localisation', intro: 'Here is the modal to add a new pin!' },
|
||||
{ element: '#add-pin-modal-image', intro: 'Here is the modal to add a new pin!' },
|
||||
{ element: '#add-pin-modal-description', intro: 'Here is the modal to add a new pin!' },
|
||||
{ element: '#add-pin-modal-date', intro: 'Here is the modal to add a new pin!' },
|
||||
{ element: '#add-pin-modal-validate', intro: 'Here is the modal to add a new pin!' },
|
||||
],
|
||||
exitOnOverlayClick: false,
|
||||
disableInteraction: false,
|
||||
});
|
||||
|
||||
startIntro() {
|
||||
this.intro.setOptions({
|
||||
intro.onchange(async (element) => {
|
||||
if (element?.id === 'add-pin-modal-title') {
|
||||
this.modalService.openModal('add-pin-modal');
|
||||
await this.sleep(300);
|
||||
}
|
||||
});
|
||||
|
||||
intro.onexit(() => {
|
||||
this.modalService.closeModal('add-pin-modal');
|
||||
resolve();
|
||||
});
|
||||
|
||||
intro.oncomplete(() => {
|
||||
this.modalService.closeModal('add-pin-modal');
|
||||
resolve();
|
||||
});
|
||||
|
||||
intro.start();
|
||||
});
|
||||
|
||||
await this.sleep(300);
|
||||
|
||||
await new Promise<void>((resolve) => {
|
||||
const intro = introJs();
|
||||
intro.setOptions({
|
||||
tooltipClass: 'custom-tooltip-with-avatar',
|
||||
steps: [
|
||||
{
|
||||
intro: 'Welcome to the web let me show you around!'
|
||||
},
|
||||
{
|
||||
element: '#timeline',
|
||||
intro: 'This is the logo of Memory Map.'
|
||||
},
|
||||
{
|
||||
element: '#quete',
|
||||
intro: 'Click here to open the search bar on mobile.'
|
||||
},
|
||||
{
|
||||
element: '#add',
|
||||
intro: 'This button toggles the mobile navigation menu.'
|
||||
},
|
||||
{
|
||||
element: '#friend',
|
||||
intro: 'Here is the main navigation menu.'
|
||||
},
|
||||
{ element: '#friend', intro: 'Here is the main navigation menu.' },
|
||||
{ element: '#friend-search-bar', intro: 'Here is the main navigation menu.' },
|
||||
{ element: '#friend-list', intro: 'Here is the main navigation menu.' }
|
||||
],
|
||||
exitOnOverlayClick: false,
|
||||
disableInteraction: false,
|
||||
});
|
||||
|
||||
this.intro.start();
|
||||
intro.onchange(async (element) => {
|
||||
if (element?.id === 'friend-search-bar') {
|
||||
this.modalService.openModal('friend-modal');
|
||||
await this.sleep(300);
|
||||
}
|
||||
});
|
||||
|
||||
intro.onexit(() => {
|
||||
this.modalService.closeModal('friend-modal');
|
||||
resolve();
|
||||
});
|
||||
|
||||
intro.oncomplete(() => {
|
||||
this.modalService.closeModal('friend-modal');
|
||||
resolve();
|
||||
});
|
||||
|
||||
intro.start();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 25 KiB |
Loading…
Reference in new issue