Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 40 additions & 4 deletions src/component/telemachy.component.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.overlay {
position: absolute;
background: rgba(0, 0, 0, 0.5);
pointer-events: none;
/*pointer-events: none;*/
Comment thread
timvdalen marked this conversation as resolved.
Outdated
z-index: 9000000;
transition: all 0.25s ease;
}
.explanation {
position: absolute;
min-width: 220px;
min-width: 700px;
z-index: 9000000;
transition: all 0.25s ease;
border-width: 1px;
Expand Down Expand Up @@ -45,12 +45,11 @@
height: calc(100% - 29px);
}
.popup .controls {
position: absolute;
bottom: 1em;
}
.controls a {
cursor: pointer;
font-size: 1.5em;
font-size: 1.2em;
font-weight: 100;
margin-left: 0.5em;
margin-right: 0.5em;
Expand Down Expand Up @@ -80,3 +79,40 @@
.ytpopup .content {
padding: 1em;
}

.flex-container{
display: flex;
}

.step-button {
flex: 1;
display: flex;
align-items: center;
justify-content: flex-start;
flex-grow: 2;
}

.step-counter {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
flex-grow: 2;
padding-right: 15%;
}

.end-button {
flex: 1;
display: flex;
align-items: center;
justify-content: flex-end;
}

.horizontal-line {
margin-top: 20px;
height: 2px;
border: none;
color: #333;
background-color: #269189;
text-align: center;
}
46 changes: 27 additions & 19 deletions src/component/telemachy.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
<iframe width="853" height="480" [src]="getVideoUrl()" frameborder="0" allowfullscreen class="video"></iframe>
<div class="ytpopup">
<div class="content">
<div class="controls">
<a *ngIf="canGoBack()" (click)="previous()">&larr;</a>
<a *ngIf="!canFinish()" (click)="next()">&rarr;</a>
<a *ngIf="!canFinish()" (click)="skip()">skip</a>
<a *ngIf="canFinish()" (click)="finish()">finish</a>
<span>({{progress}}/{{total}})</span>
<div class="controls flex-container">
<div class="step-button">
<a *ngIf="canGoBack()" (click)="previous()"><< Prev</a>
<a *ngIf="!canFinish()" (click)="next()">Next >></a>
</div>
<span class="step-counter">({{progress}}/{{total}})</span>
<a *ngIf="!canFinish()" (click)="skip()" class="end-button">End tour</a>
<a *ngIf="canFinish()" (click)="finish()" class="end-button">finish</a>
</div>
</div>
</div>
Expand All @@ -20,12 +22,15 @@
<div class="popup">
<div class="content">
<div [innerHtml]="asHtmlTourStep(step).body" class="body"></div>
<div class="controls">
<a *ngIf="canGoBack()" (click)="previous()">&larr;</a>
<a *ngIf="!canFinish()" (click)="next()">&rarr;</a>
<a *ngIf="!canFinish()" (click)="skip()">skip</a>
<a *ngIf="canFinish()" (click)="finish()">finish</a>
<span>({{progress}}/{{total}})</span>
<hr class="horizontal-line"/>
<div class="controls flex-container">
<div class="step-button">
<a *ngIf="canGoBack()" (click)="previous()"><< Prev</a>
<a *ngIf="!canFinish()" (click)="next()">Next >></a>
</div>
<span class="step-counter">({{progress}}/{{total}})</span>
<a *ngIf="!canFinish()" (click)="skip()" class="end-button">End tour</a>
<a *ngIf="canFinish()" (click)="finish()" class="end-button">finish</a>
</div>
</div>
</div>
Expand All @@ -36,15 +41,18 @@
<div class="overlay" [ngStyle]="{left: asElementTourStep(step).left, top: asElementTourStep(step).bottom, width: asElementTourStep(step).fromLeft, height: asElementTourStep(step).toBottom}"></div>
<div class="overlay" [ngStyle]="{left: asElementTourStep(step).right, top: asElementTourStep(step).top, width: asElementTourStep(step).toRight, height: asElementTourStep(step).height}"></div>

<div class="explanation" [ngStyle]="{left: asElementTourStep(step).left, top: asElementTourStep(step).bottom, width: (asElementTourStep(step).domElement.getBoundingClientRect().width - 2) + 'px'}">
<div class="explanation" [ngStyle]="{left: asElementTourStep(step).leftContent, top: asElementTourStep(step).bottom, width: (asElementTourStep(step).domElement.getBoundingClientRect().width - 2) + 'px'}">
<div class="content">
<div [innerHtml]="asElementTourStep(step).body"></div>
<div class="controls">
<a *ngIf="canGoBack()" (click)="previous()">&larr;</a>
<a *ngIf="!canFinish()" (click)="next()">&rarr;</a>
<a *ngIf="!canFinish()" (click)="skip()">skip</a>
<a *ngIf="canFinish()" (click)="finish()">finish</a>
<span>({{progress}}/{{total}})</span>
<hr class="horizontal-line"/>
<div class="controls flex-container">
<div class="step-button">
<a *ngIf="canGoBack()" (click)="previous()"><< Prev</a>
<a *ngIf="!canFinish()" (click)="next()">Next >></a>
</div>
<span class="step-counter">({{progress}}/{{total}})</span>
<a *ngIf="!canFinish()" (click)="skip()" class="end-button">End tour</a>
<a *ngIf="canFinish()" (click)="finish()" class="end-button">finish</a>
</div>
</div>
</div>
Expand Down
11 changes: 11 additions & 0 deletions src/step/element.step.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ export class ElementTourStep extends TourStep {
}
return (this.domElement.getBoundingClientRect().left + window.pageXOffset) + 'px';
}
get leftContent(): string {
if (!this.domElement) {
return '0';
}

if (((this.domElement.getBoundingClientRect().left + window.pageXOffset) - window.innerWidth) >= -700) {
return ((window.innerWidth - 720) + 'px');
}
console.log(((this.domElement.getBoundingClientRect().left + window.pageXOffset) - window.innerWidth));
Comment thread
timvdalen marked this conversation as resolved.
Outdated
return (this.domElement.getBoundingClientRect().left + window.pageXOffset) + 'px';
}
get right(): string {
if (!this.domElement) {
return '0';
Expand Down