-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: splincode <>
- Loading branch information
Showing
43 changed files
with
1,398 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,32 @@ | ||
<header> | ||
<img | ||
routerLink="/" | ||
src="assets/images/web-api.svg" | ||
width="128" | ||
height="128" | ||
alt="Web APIs logo" | ||
class="logo" | ||
/> | ||
<div> | ||
<h1>Web APIs for Angular</h1> | ||
<section> | ||
High quality lightweight wrappers for native Web APIs for idiomatic | ||
use with Angular | ||
</section> | ||
</div> | ||
</header> | ||
<main> | ||
<router-outlet></router-outlet> | ||
</main> | ||
<footer> | ||
Icons made by | ||
<a href="https://www.flaticon.com/authors/freepik" title="Freepik"> | ||
Freepik | ||
</a> | ||
from | ||
<a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> | ||
</footer> | ||
<tui-root> | ||
<header> | ||
<img | ||
routerLink="/" | ||
src="assets/images/web-api.svg" | ||
width="128" | ||
height="128" | ||
alt="Web APIs logo" | ||
class="logo" | ||
/> | ||
<div> | ||
<h1>Web APIs for Angular</h1> | ||
<section> | ||
High quality lightweight wrappers for native Web APIs for | ||
idiomatic use with Angular | ||
</section> | ||
</div> | ||
</header> | ||
<main> | ||
<router-outlet></router-outlet> | ||
</main> | ||
<footer> | ||
Icons made by | ||
<a href="https://www.flaticon.com/authors/freepik" title="Freepik"> | ||
Freepik | ||
</a> | ||
from | ||
<a href="https://www.flaticon.com/" title="Flaticon"> | ||
www.flaticon.com | ||
</a> | ||
</footer> | ||
</tui-root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
apps/demo/src/app/pages/speech/speech-page.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<label class="recognition" [tuiLabel]="label"> | ||
<ng-template #label> | ||
Speech recognition | ||
<tui-tooltip | ||
content="Say «Ok, Angular» to start recording and «Thank you, Angular» to end" | ||
></tui-tooltip> | ||
</ng-template> | ||
<ng-container *ngIf="record$ | async as result; else placeholder"> | ||
<span | ||
*ngFor="let result of result" | ||
class="transcript" | ||
[class.transcript_final]="result.isFinal" | ||
> | ||
{{ result[0].transcript }} | ||
</span> | ||
| ||
</ng-container> | ||
<ng-template #placeholder>Say «Ok, Angular»...</ng-template> | ||
</label> | ||
<tui-select [valueContent]="nameExtractor" [(ngModel)]="voice"> | ||
Voice | ||
<tui-data-list *tuiDataList> | ||
<button | ||
*ngFor="let item of voices$ | async; trackBy: voiceByName" | ||
tuiOption | ||
[value]="item" | ||
> | ||
{{ item.name }} | ||
</button> | ||
</tui-data-list> | ||
</tui-select> | ||
<tui-text-area | ||
class="textarea" | ||
[waTextToSpeech]="text | waUtterance: options" | ||
[waTextToSpeechPaused]="paused" | ||
[(ngModel)]="text" | ||
(waTextToSpeechEnd)="onEnd()" | ||
> | ||
Text | ||
</tui-text-area> | ||
<div class="buttons"> | ||
<button tuiButton type="button" (click)="onClick()"> | ||
{{ paused ? 'Play' : 'Pause' }} | ||
</button> | ||
Tip: say «Show sidebar» | ||
</div> | ||
|
||
<div *tuiSidebar="(open$ | async) || false"> | ||
<div class="sidebar"> | ||
<h2>More from @ng-web-apis</h2> | ||
|
||
<a | ||
href="https://github.com/ng-web-apis/workers" | ||
target="_blank" | ||
class="link" | ||
> | ||
<h3>Workers</h3> | ||
<img | ||
src="https://ng-web-apis.github.io/dist/assets/images/workers.svg" | ||
width="64" | ||
height="64" | ||
alt="Worker API logo" | ||
class="icon" | ||
/> | ||
</a> | ||
|
||
<a | ||
href="https://github.com/ng-web-apis/canvas" | ||
target="_blank" | ||
class="link" | ||
> | ||
<h3>Canvas</h3> | ||
<img | ||
src="https://ng-web-apis.github.io/dist/assets/images/canvas.svg" | ||
width="64" | ||
height="64" | ||
alt="Worker API logo" | ||
class="icon" | ||
/> | ||
</a> | ||
|
||
<a | ||
href="https://github.com/ng-web-apis/audio" | ||
target="_blank" | ||
class="link" | ||
> | ||
<h3>Audio</h3> | ||
<img | ||
src="https://ng-web-apis.github.io/dist/assets/images/audio.svg" | ||
width="64" | ||
height="64" | ||
alt="Worker API logo" | ||
class="icon" | ||
/> | ||
</a> | ||
|
||
<a href="https://ng-web-apis.github.io/" target="_blank" class="link"> | ||
See all | ||
</a> | ||
|
||
Tip: say «Hide sidebar» when you're done | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
:host { | ||
display: block; | ||
} | ||
|
||
.transcript { | ||
opacity: 0.5; | ||
color: var(--tui-text-01); | ||
|
||
&_final { | ||
opacity: 1; | ||
} | ||
} | ||
|
||
.form { | ||
width: 320px; | ||
margin: 0 auto; | ||
} | ||
|
||
.textarea { | ||
margin: 16px 0; | ||
overflow: visible; | ||
} | ||
|
||
.recognition { | ||
margin: 16px 0; | ||
box-shadow: inset 0 0 0 1px gainsboro; | ||
border-radius: var(--tui-radius); | ||
padding: 8px 16px; | ||
color: var(--tui-text-02); | ||
} | ||
|
||
.buttons { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
|
||
.sidebar { | ||
padding: 12px 16px; | ||
} | ||
|
||
.link { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
color: #444; | ||
border-radius: 4px; | ||
border: 1px solid gainsboro; | ||
font-size: 14px; | ||
padding: 16px; | ||
margin: 16px 10px; | ||
box-sizing: border-box; | ||
transition: box-shadow 0.3s; | ||
|
||
&:hover { | ||
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2); | ||
} | ||
} |
Oops, something went wrong.