mirror of
https://github.com/astefanutti/decktape.git
synced 2024-09-11 22:27:11 +03:00
BREAKING CHANGE: Please run node 12.20 or higher BREAKING CHANGE: This package is now a pure esm, please [read this](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
39 lines
778 B
JavaScript
39 lines
778 B
JavaScript
export const create = page => new Inspire(page);
|
|
|
|
class Inspire {
|
|
|
|
constructor(page) {
|
|
this.page = page;
|
|
}
|
|
|
|
getName() {
|
|
return 'Inspire';
|
|
}
|
|
|
|
isActive() {
|
|
return this.page.evaluate(_ =>
|
|
typeof Inspire === 'object');
|
|
}
|
|
|
|
configure() {
|
|
return this.page.evaluate(_ => document.getElementById('timer').style.display = 'none');
|
|
}
|
|
|
|
slideCount() {
|
|
return this.page.evaluate(_ =>
|
|
document.querySelectorAll('.slide, .delayed, .delayed-children > *').length);
|
|
}
|
|
|
|
hasNextSlide() {
|
|
return this.page.evaluate(_ => Inspire.index + 1 in Inspire.slides);
|
|
}
|
|
|
|
nextSlide() {
|
|
return this.page.evaluate(_ => Inspire.next(false));
|
|
}
|
|
|
|
currentSlideIndex() {
|
|
return this.page.evaluate(_ => Inspire.slides[Inspire.slide].id);
|
|
}
|
|
}
|