ngx-joyride
Version:
[](https://badge.fury.io/js/ngx-joyride) [](https://travis-ci.org/tnicola/ngx-joyride) [ {
this.documentService = documentService;
this.optionsService = optionsService;
this.rendererFactory = rendererFactory;
this.lastXScroll = 0;
this.lastYScroll = 0;
this.setRenderer();
}
setRenderer() {
this.renderer = this.rendererFactory.createRenderer(null, null);
}
draw(step) {
this.elementRef = step.targetViewContainer;
this.targetAbsoluteTop = this.getTargetTotalTop(step);
this.targetAbsoluteLeft = this.getTargetTotalLeft(step);
this.currentBackdropContainer = this.renderer.createElement('div');
this.renderer.addClass(this.currentBackdropContainer, 'backdrop-container');
this.renderer.setStyle(this.currentBackdropContainer, 'position', 'fixed');
this.renderer.setStyle(this.currentBackdropContainer, 'top', '0px');
this.renderer.setStyle(this.currentBackdropContainer, 'left', '0px');
this.renderer.setStyle(this.currentBackdropContainer, 'width', '100%');
this.renderer.setStyle(this.currentBackdropContainer, 'height', '100%');
this.renderer.setStyle(this.currentBackdropContainer, 'z-index', '1000');
this.renderer.setAttribute(this.currentBackdropContainer, 'id', 'backdrop-' + step.name);
this.backdropContent = this.renderer.createElement('div');
this.renderer.addClass(this.backdropContent, 'backdrop-content');
this.renderer.setStyle(this.backdropContent, 'position', 'relative');
this.renderer.setStyle(this.backdropContent, 'height', '100%');
this.renderer.setStyle(this.backdropContent, 'display', 'flex');
this.renderer.setStyle(this.backdropContent, 'flex-direction', 'column');
this.renderer.appendChild(this.currentBackdropContainer, this.backdropContent);
this.backdropTop = this.renderer.createElement('div');
this.renderer.addClass(this.backdropTop, 'joyride-backdrop');
this.renderer.addClass(this.backdropTop, 'backdrop-top');
this.renderer.setStyle(this.backdropTop, 'width', '100%');
this.renderer.setStyle(this.backdropTop, 'height', this.targetAbsoluteTop - this.lastYScroll + 'px');
this.renderer.setStyle(this.backdropTop, 'flex-shrink', '0');
this.renderer.setStyle(this.backdropTop, 'background-color', `rgba(${this.optionsService.getBackdropColor()}, 0.7)`);
this.renderer.appendChild(this.backdropContent, this.backdropTop);
this.backdropMiddleContainer = this.renderer.createElement('div');
this.renderer.addClass(this.backdropMiddleContainer, 'backdrop-middle-container');
this.renderer.setStyle(this.backdropMiddleContainer, 'height', this.elementRef.element.nativeElement.offsetHeight + 'px');
this.renderer.setStyle(this.backdropMiddleContainer, 'width', '100%');
this.renderer.setStyle(this.backdropMiddleContainer, 'flex-shrink', '0');
this.renderer.appendChild(this.backdropContent, this.backdropMiddleContainer);
this.backdropMiddleContent = this.renderer.createElement('div');
this.renderer.addClass(this.backdropMiddleContent, 'backdrop-middle-content');
this.renderer.setStyle(this.backdropMiddleContent, 'display', 'flex');
this.renderer.setStyle(this.backdropMiddleContent, 'width', '100%');
this.renderer.setStyle(this.backdropMiddleContent, 'height', '100%');
this.renderer.appendChild(this.backdropMiddleContainer, this.backdropMiddleContent);
this.leftBackdrop = this.renderer.createElement('div');
this.renderer.addClass(this.leftBackdrop, 'joyride-backdrop');
this.renderer.addClass(this.leftBackdrop, 'backdrop-left');
this.renderer.setStyle(this.leftBackdrop, 'flex-shrink', '0');
this.renderer.setStyle(this.leftBackdrop, 'width', this.targetAbsoluteLeft - this.lastXScroll + 'px');
this.renderer.setStyle(this.leftBackdrop, 'background-color', `rgba(${this.optionsService.getBackdropColor()}, 0.7)`);
this.renderer.appendChild(this.backdropMiddleContent, this.leftBackdrop);
this.targetBackdrop = this.renderer.createElement('div');
this.renderer.addClass(this.targetBackdrop, 'backdrop-target');
this.renderer.setStyle(this.targetBackdrop, 'flex-shrink', '0');
this.renderer.setStyle(this.targetBackdrop, 'width', this.elementRef.element.nativeElement.offsetWidth + 'px');
this.renderer.appendChild(this.backdropMiddleContent, this.targetBackdrop);
this.rightBackdrop = this.renderer.createElement('div');
this.renderer.addClass(this.rightBackdrop, 'joyride-backdrop');
this.renderer.addClass(this.rightBackdrop, 'backdrop-right');
this.renderer.setStyle(this.rightBackdrop, 'width', '100%');
this.renderer.setStyle(this.rightBackdrop, 'background-color', `rgba(${this.optionsService.getBackdropColor()}, 0.7)`);
this.renderer.appendChild(this.backdropMiddleContent, this.rightBackdrop);
this.backdropBottom = this.renderer.createElement('div');
this.renderer.addClass(this.backdropBottom, 'joyride-backdrop');
this.renderer.addClass(this.backdropBottom, 'backdrop-bottom');
this.renderer.setStyle(this.backdropBottom, 'width', '100%');
this.renderer.setStyle(this.backdropBottom, 'height', '100%');
this.renderer.setStyle(this.backdropBottom, 'background-color', `rgba(${this.optionsService.getBackdropColor()}, 0.7)`);
this.renderer.appendChild(this.backdropContent, this.backdropBottom);
this.removeLastBackdrop();
this.drawCurrentBackdrop();
this.lastBackdropContainer = this.currentBackdropContainer;
}
remove() {
this.removeLastBackdrop();
}
redrawTarget(step) {
this.targetAbsoluteLeft = this.getTargetTotalLeft(step);
this.targetAbsoluteTop = this.getTargetTotalTop(step);
this.handleVerticalScroll(step);
this.handleHorizontalScroll(step);
}
getTargetTotalTop(step) {
let targetVC = step.targetViewContainer;
return step.isElementOrAncestorFixed
? this.documentService.getElementFixedTop(targetVC.element)
: this.documentService.getElementAbsoluteTop(targetVC.element);
}
getTargetTotalLeft(step) {
let targetVC = step.targetViewContainer;
return step.isElementOrAncestorFixed
? this.documentService.getElementFixedLeft(targetVC.element)
: this.documentService.getElementAbsoluteLeft(targetVC.element);
}
redraw(step, scroll) {
if (this.lastYScroll !== scroll.scrollY) {
this.lastYScroll = scroll.scrollY;
if (this.elementRef) {
this.handleVerticalScroll(step);
}
}
if (this.lastXScroll !== scroll.scrollX) {
this.lastXScroll = scroll.scrollX;
if (this.elementRef) {
this.handleHorizontalScroll(step);
}
}
}
handleHorizontalScroll(step) {
let newBackdropLeftWidth = step.isElementOrAncestorFixed ? this.targetAbsoluteLeft : this.targetAbsoluteLeft - this.lastXScroll;
if (newBackdropLeftWidth >= 0) {
this.renderer.setStyle(this.leftBackdrop, 'width', newBackdropLeftWidth + 'px');
this.renderer.setStyle(this.targetBackdrop, 'width', this.elementRef.element.nativeElement.offsetWidth + 'px');
}
else {
this.handleTargetPartialWidth(newBackdropLeftWidth);
}
}
handleTargetPartialWidth(newBackdropLeftWidth) {
this.renderer.setStyle(this.leftBackdrop, 'width', 0 + 'px');
let visibleTargetWidth = this.elementRef.element.nativeElement.offsetWidth + newBackdropLeftWidth;
if (visibleTargetWidth >= 0) {
this.renderer.setStyle(this.targetBackdrop, 'width', visibleTargetWidth + 'px');
}
else {
this.renderer.setStyle(this.targetBackdrop, 'width', 0 + 'px');
}
}
handleVerticalScroll(step) {
let newBackdropTopHeight = step.isElementOrAncestorFixed ? this.targetAbsoluteTop : this.targetAbsoluteTop - this.lastYScroll;
if (newBackdropTopHeight >= 0) {
this.renderer.setStyle(this.backdropTop, 'height', newBackdropTopHeight + 'px');
this.renderer.setStyle(this.backdropMiddleContainer, 'height', this.elementRef.element.nativeElement.offsetHeight + 'px');
}
else {
this.handleTargetPartialHeight(newBackdropTopHeight);
}
}
handleTargetPartialHeight(newBackdropTopHeight) {
this.renderer.setStyle(this.backdropTop, 'height', 0 + 'px');
let visibleTargetHeight = this.elementRef.element.nativeElement.offsetHeight + newBackdropTopHeight;
if (visibleTargetHeight >= 0) {
this.renderer.setStyle(this.backdropMiddleContainer, 'height', visibleTargetHeight + 'px');
}
else {
this.renderer.setStyle(this.backdropMiddleContainer, 'height', 0 + 'px');
}
}
removeLastBackdrop() {
if (this.lastBackdropContainer) {
this.renderer.removeChild(document.body, this.lastBackdropContainer);
this.lastBackdropContainer = undefined;
}
}
drawCurrentBackdrop() {
this.renderer.appendChild(document.body, this.currentBackdropContainer);
}
}
JoyrideBackdropService.decorators = [
{ type: Injectable }
];
JoyrideBackdropService.ctorParameters = () => [
{ type: DocumentService },
{ type: JoyrideOptionsService },
{ type: RendererFactory2 }
];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiam95cmlkZS1iYWNrZHJvcC5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbm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