Skip to content

Commit

Permalink
Fix audiobar icon spacing with large icons (#413)
Browse files Browse the repository at this point in the history
* Remove DaisyUI btn class (which want to be aligned flex-start)
* Manually layout buttons with padding and alignment
  • Loading branch information
chrisvire authored Nov 2, 2023
1 parent 664ab5d commit cb1dd93
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/lib/components/AudioBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -62,48 +62,42 @@ TODO:
</script>

<div class={audioBarClass} style:background-color={backgroundColor}>
<div class="dy-button-group audio-repeat">
{#if showRepeatMode}
<button
class="dy-btn-sm dy-btn-ghost"
on:click={() => playMode.next($refs.hasAudio?.timingFile)}
>
<svelte:component this={playModeIconOptions[$playMode.mode]} color={iconColor} />
</button>
{/if}
</div>
{#if showRepeatMode}
<button
class="audio-control-buttons"
on:click={() => playMode.next($refs.hasAudio?.timingFile)}
>
<svelte:component this={playModeIconOptions[$playMode.mode]} color={iconColor} />
</button>
{/if}
<!-- Play Controls -->
<div class="dy-btn-group audio-controls" style:direction="ltr">
<button class="dy-btn-sm dy-btn-ghost" on:click={() => skip(-1)}>
<div class="audio-controls" style:direction="ltr">
<button class="audio-control-buttons" on:click={() => skip(-1)}>
<AudioIcon.Prev color={iconColor} />
</button>

{#if $refs.hasAudio?.timingFile}
<button class="dy-btn-sm dy-btn-ghost" on:click={() => changeVerse(-1)}>
<button class="audio-control-buttons" on:click={() => changeVerse(-1)}>
<AudioIcon.RW color={iconColor} />
</button>
{/if}
<button
class="dy-btn-sm dy-btn-ghost"
class:dy-btn-lg={config.mainFeatures['audio-play-button-size'] === 'large'}
on:click={() => playPause()}
>
<button class="audio-control-buttons" on:click={() => playPause()}>
{#if !$audioPlayer.playing}
<svelte:component this={playIcon} color={iconPlayColor} size={playIconSize} />
{:else}
<AudioIcon.Pause color={iconColor} size={playIconSize} />
{/if}
</button>
{#if $refs.hasAudio?.timingFile}
<button class="dy-btn-sm dy-btn-ghost" on:click={() => changeVerse(1)}>
<button class="audio-control-buttons" on:click={() => changeVerse(1)}>
<AudioIcon.FF color={iconColor} />
</button>
{/if}
<button class="dy-btn-sm dy-btn-ghost" on:click={() => skip(1)}>
<button class="audio-control-buttons" on:click={() => skip(1)}>
<AudioIcon.Skip color={iconColor} />
</button>
</div>
<div class="dy-button-group audio-speed">
<div class="audio-speed audio-control-buttons">
{#if showSpeed}
<AudioPlaybackSpeed />
{/if}
Expand Down Expand Up @@ -163,11 +157,17 @@ TODO:
place-self: center;
}
.audio-controls {
display: inline-flex;
grid-row: 1;
grid-column: 2;
place-self: center;
align-items: center;
}
.audio-control-buttons {
margin-inline-start: 12px;
margin-inline-end: 12px;
place-self: center;
}
.audio-speed {
grid-row: 1;
grid-column: 3;
Expand Down

0 comments on commit cb1dd93

Please sign in to comment.