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 { Injectable } from '@angular/core';
|
||||||
import introJs from 'intro.js';
|
import introJs from 'intro.js';
|
||||||
|
import { ModalService } from '../modal/modal.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class IntroService {
|
export class IntroService {
|
||||||
private intro = introJs();
|
constructor(private modalService: ModalService) {}
|
||||||
|
|
||||||
constructor() {}
|
private sleep(ms: number): Promise<void> {
|
||||||
|
return new Promise(resolve => setTimeout(resolve, ms));
|
||||||
startIntro() {
|
}
|
||||||
this.intro.setOptions({
|
|
||||||
steps: [
|
async startIntro() {
|
||||||
{
|
await new Promise<void>((resolve) => {
|
||||||
intro: 'Welcome to the web let me show you around!'
|
const intro = introJs();
|
||||||
},
|
intro.setOptions({
|
||||||
{
|
tooltipClass: 'custom-tooltip-with-avatar',
|
||||||
element: '#timeline',
|
steps: [
|
||||||
intro: 'This is the logo of Memory Map.'
|
{ 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: '#quete',
|
],
|
||||||
intro: 'Click here to open the search bar on mobile.'
|
exitOnOverlayClick: false,
|
||||||
},
|
disableInteraction: false,
|
||||||
{
|
});
|
||||||
element: '#add',
|
|
||||||
intro: 'This button toggles the mobile navigation menu.'
|
intro.oncomplete(() => {
|
||||||
},
|
resolve();
|
||||||
{
|
});
|
||||||
element: '#friend',
|
|
||||||
intro: 'Here is the main navigation menu.'
|
intro.start();
|
||||||
},
|
});
|
||||||
],
|
await this.sleep(300);
|
||||||
exitOnOverlayClick: false,
|
|
||||||
disableInteraction: false,
|
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,
|
||||||
|
});
|
||||||
|
|
||||||
|
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();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.intro.start();
|
await this.sleep(300);
|
||||||
|
|
||||||
|
await new Promise<void>((resolve) => {
|
||||||
|
const intro = introJs();
|
||||||
|
intro.setOptions({
|
||||||
|
tooltipClass: 'custom-tooltip-with-avatar',
|
||||||
|
steps: [
|
||||||
|
{ 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,
|
||||||
|
});
|
||||||
|
|
||||||
|
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