Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(audio-player): change slider knob design- visible on hover/focus onl (VIV-1990) #2090

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
17 changes: 16 additions & 1 deletion libs/components/src/lib/audio-player/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
```js
import '@vonage/vivid/audio-player';
```

or, if you need to use a unique prefix:

```js
Expand Down Expand Up @@ -43,6 +42,22 @@ registerAudioPlayer('your-prefix');
</vwc-tab-panel>
</vwc-tabs>

## Knob Opacity

```html preview
<p>Native Audio Player</p>
<audio
style="width: 90%;"
rachelbt marked this conversation as resolved.
Show resolved Hide resolved
src="https://freetestdata.com/wp-content/uploads/2021/09/Free_Test_Data_2MB_MP3.mp3"
controls
></audio>
<p>Vivid Audio Player</p>
<vwc-audio-player
style="max-inline-size: 500px;"
rachelbt marked this conversation as resolved.
Show resolved Hide resolved
src="https://freetestdata.com/wp-content/uploads/2021/09/Free_Test_Data_2MB_MP3.mp3"
></vwc-audio-player>
```

## Audio Source

Use the `src` attribute to add an audio track to the Audio Player.
Expand Down
2 changes: 1 addition & 1 deletion libs/components/src/lib/audio-player/audio-player.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
align-items: center;
padding: 8px;
color: var(#{constants.$vvd-color-canvas-text});
gap: 16px;
gap: 8px;
inline-size: 100%;
user-select: none;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ function renderSlider(context: VividElementDefinitionContext) {
max="100"
ariaValuetext="${(x) => formatTime(x.currentTime)}"
connotation="${(x) => x.connotation}"
?disabled="${(x) => x.disabled || !x.duration}">
?disabled="${(x) => x.disabled || !x.duration}"
internal-part>
</${sliderTag}>`;
}

Expand Down
26 changes: 26 additions & 0 deletions libs/components/src/lib/slider/slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ $track-thickness: 2px;
(var(#{variables.$thumb-interaction-indicator-size}) - $track-thickness) /
2
);
overflow: hidden;
block-size: 100%;
inline-size: $track-thickness;

Expand Down Expand Up @@ -255,3 +256,28 @@ $track-thickness: 2px;
color: var(#{constants.$vvd-color-canvas-text});
font: var(#{constants.$vvd-typography-base-bold});
}

/* Customize for Audio-Player */
/* stylelint-disable */
:host([internal-part]) {
.thumb-container {
opacity: 0;
transition: opacity 0.2s ease;
}
.control {
&.horizontal {
.track {
top: 16px;
block-size: 4px;
}
}

&:hover,
&:focus {
.thumb-container {
opacity: 1;
}
}
}
}
/* stylelint-enable */
Loading