generated from nicorac/ionic-capacitor-angular-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- player moved to page bottom - list can now be scrolled (fully) while playing - list vertical scrollbar now appears only when scrolling - cleaned up list style - improved items multiselection
- Loading branch information
Showing
15 changed files
with
561 additions
and
411 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
59 changes: 34 additions & 25 deletions
59
src/app/components/audio-player/audio-player.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 |
---|---|---|
@@ -1,34 +1,43 @@ | ||
<div class="progress"> | ||
<ion-range | ||
label="{{ progress() | toHms }}" | ||
labelPlacement="end" | ||
<div class="progress-label">{{ progress() | toHms }}</div> | ||
<ion-range class="range-bar" | ||
[disabled]="!ready()" | ||
[value]="progress()" | ||
[max]="duration()" | ||
(ionKnobMoveEnd)="onIonKnobMoveEnd($event)" | ||
/> | ||
<div class="progress-label">{{ duration() | toHms }}</div> | ||
</div> | ||
|
||
<div class="controls"> | ||
<ion-icon | ||
class="buttons" | ||
color="primary" | ||
[class.disabled]="!ready()" | ||
name="play-back" | ||
(click)="onSeek(-1)" | ||
/> | ||
<ion-icon | ||
class="buttons" | ||
color="primary" | ||
[class.disabled]="!ready()" | ||
[name]="status() !== PlayerStatusEnum.Playing ? 'play' : 'pause'" | ||
(click)="toggle()" | ||
/> | ||
<ion-icon | ||
class="buttons" | ||
color="primary" | ||
[class.disabled]="!ready()" | ||
name="play-forward" | ||
(click)="onSeek(+1)" | ||
/> | ||
<div class="controls" [class.disabled]="!ready()"> | ||
|
||
<div class="button" (click)="onSeek(-1)"> | ||
<div class="button-in"> | ||
<ion-icon | ||
class="icon" | ||
color="primary" | ||
name="play-back" | ||
/> | ||
</div> | ||
</div> | ||
|
||
<div class="button play" (click)="toggle()"> | ||
<div class="button-in"> | ||
<ion-icon | ||
class="icon" | ||
[name]="status() !== PlayerStatusEnum.Playing ? 'play' : 'pause'" | ||
/> | ||
</div> | ||
</div> | ||
|
||
<div class="button" (click)="onSeek(+1)"> | ||
<div class="button-in"> | ||
<ion-icon | ||
class="icon" | ||
color="primary" | ||
name="play-forward" | ||
/> | ||
</div> | ||
</div> | ||
|
||
</div> |
111 changes: 104 additions & 7 deletions
111
src/app/components/audio-player/audio-player.component.scss
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,23 +1,120 @@ | ||
$buttonSize: 2.5em; | ||
|
||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
border-top-left-radius: 18px; | ||
border-top-right-radius: 18px; | ||
gap: 0; | ||
padding: .6em 1em; | ||
user-select: none; | ||
box-shadow: 0 -2px 4px -1px rgba(0, 0, 0, 0.2), | ||
0 -4px 5px 0 rgba(0, 0, 0, 0.14), | ||
0 -1px 10px 0 rgba(0, 0, 0, 0.12); | ||
--button-shadow-color: rgba(0,0,0,0.2); | ||
} | ||
|
||
:host-context(.dark) :host { | ||
--button-shadow-color: rgba(255,255,255,0.1); | ||
} | ||
|
||
.controls { | ||
display: flex; | ||
gap: 2em; | ||
align-items: center; | ||
gap: 1.5em; | ||
} | ||
|
||
.buttons { | ||
font-size: 2em; | ||
line-height: 0; | ||
.button, | ||
.button-in { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
border-radius: 50%; | ||
} | ||
|
||
.button { | ||
background: var(--player-background-color); | ||
box-shadow: 0px 0px 6px 3px var(--button-shadow-color); | ||
position: relative; | ||
cursor: pointer; | ||
width: $buttonSize; | ||
height: $buttonSize; | ||
|
||
.button-in { | ||
width: 100%; | ||
height: 100%; | ||
|
||
.icon { | ||
height: 65%; | ||
width: 65%; | ||
} | ||
|
||
&:active { | ||
width: 100%; | ||
height: 100%; | ||
border: 1px solid var(--ion-color-primary-darker); | ||
box-shadow: inset 0px 0px 5px 0px var(--ion-color-step-700); | ||
|
||
.icon { | ||
height: 55%; | ||
width: 55%; | ||
} | ||
} | ||
|
||
} | ||
|
||
// increase size of play button | ||
&.play { | ||
width: calc($buttonSize * 1.3); | ||
height: calc($buttonSize * 1.3); | ||
border: 3px solid var(--ion-color-primary-darker); | ||
color: var(--ion-background-color); | ||
|
||
.button-in { | ||
background-color: var(--ion-color-primary); | ||
|
||
&:active { | ||
border: none; | ||
box-shadow: inset -3px -3px 5px 0.1px var(--ion-color-step-700), inset 3px 3px 5px 0.7px var(--ion-color-step-800); | ||
} | ||
} | ||
} | ||
|
||
// decrease size of action buttons | ||
&.actions { | ||
width: calc($buttonSize * .7); | ||
height: calc($buttonSize * .7); | ||
} | ||
|
||
} | ||
|
||
.progress { | ||
display: flex; | ||
gap: .5em; | ||
display: grid; | ||
grid-template-columns: min-content minmax(0, 1fr) min-content; | ||
align-items: center; | ||
gap: 1em; | ||
width: 100%; | ||
} | ||
|
||
.progress-label { | ||
color: var(--ion-color-step-600) | ||
} | ||
|
||
.range-bar { | ||
--bar-height: 5px; | ||
--knob-size: 24px; | ||
} | ||
|
||
ion-range::part(bar) { | ||
background: var(--ion-background-color); | ||
box-shadow: color-mix(in srgb, var(--ion-color-primary-darker), transparent 80%) 0px 0px 0px 1px; | ||
} | ||
|
||
ion-range::part(bar-active) { | ||
background: var(--ion-color-primary); | ||
} | ||
|
||
|
||
ion-range::part(knob) { | ||
background: var(--ion-color-primary-darker); | ||
} |
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
Oops, something went wrong.