Skip to content

Instantly share code, notes, and snippets.

@AnteaterKit
Created February 13, 2021 12:41
Show Gist options
  • Save AnteaterKit/961da1b202e432e0075f0f2491d270f6 to your computer and use it in GitHub Desktop.
Save AnteaterKit/961da1b202e432e0075f0f2491d270f6 to your computer and use it in GitHub Desktop.
<div class="speak-wrapper">
<div class="speak-btns">
<button tuiButton type="button" (click)='pause()'>Start</button>
<button style="margin-left: 16px;" tuiButton type="button" (click)='pause()'>Stop</button>
</div>
<div #scrollRef class="speak-content">
<div *ngFor='let item of texts; let i = index'>
<div #item class="speak-content__item">
<div class="speak-content__item__speach" [waTextToSpeech]="text | waUtterance: options"
[waTextToSpeechPaused]='paused' (waTextToSpeechBoundary)="onWaTextToSpeechBoundary($event)"
(waTextToSpeechEnd)="onEnd(item, i)">
</div>
<div *ngIf='i === selectedBlock; else simpleItem' highlight [currentCharPosition]="currentPosition"
class="speak-content__item__text">
{{item}}
</div>
<ng-template #simpleItem>
{{item}}
</ng-template>
</div>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment