Skip to content

Commit 24112f2

Browse files
authored
Merge pull request #241 from devmount/bugs/240-setlist-presentation-pagination
Replace carousel pagination with custom buttons
2 parents b0ce20f + 85fc12d commit 24112f2

4 files changed

Lines changed: 40 additions & 40 deletions

File tree

frontend/src/assets/main.css

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -150,22 +150,3 @@ kbd > * {
150150
.dp__calendar_header_item {
151151
@apply h-10 w-auto !rounded-sm
152152
}
153-
154-
/* carousel */
155-
.carousel__pagination-button {
156-
@apply w-full h-0.5 !p-0 bg-blade-300 dark:bg-blade-700
157-
}
158-
.carousel__pagination-item {
159-
width: 100%;
160-
}
161-
@media (min-width: 768px) {
162-
.carousel__pagination-button {
163-
@apply w-6 h-6 rounded-full
164-
}
165-
}
166-
.carousel__pagination-button::after {
167-
@apply !hidden
168-
}
169-
.carousel__pagination-button--active {
170-
@apply !bg-spring-600
171-
}

frontend/src/elements/PrimaryButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<button
33
class="
44
text-white py-2 px-3 rounded-sm shadow-m flex justify-center items-center gap-2
5-
hover:bg-opacity-80 hover:shadow-l disabled:opacity-30 disabled:shadow-none hover:disabled:bg-opacity-100
5+
hover:!bg-opacity-80 hover:shadow-l disabled:opacity-30 disabled:shadow-none hover:disabled:bg-opacity-100
66
"
77
:class="{
88
'bg-spring-600 dark:bg-spring-700': !type,

frontend/src/elements/SecondaryButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<button
33
class="
44
py-2 px-3 rounded-sm shadow-md flex justify-center items-center gap-2
5-
hover:bg-opacity-80 hover:shadow-l disabled:opacity-30 disabled:shadow-none hover:disabled:bg-opacity-100
5+
hover:!bg-opacity-80 hover:shadow-l disabled:opacity-30 disabled:shadow-none hover:disabled:bg-opacity-100
66
"
77
:class="{
88
'bg-blade-400 text-white dark:bg-blade-700': !type,

frontend/src/modals/SetlistPresent.vue

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,30 @@
2626
ref="songContentRef"
2727
/>
2828
</slide>
29-
<template #addons>
30-
<pagination class="hidden md:flex z-50 bottom-0 !m-0 left-0 translate-x-0 gap-2" />
31-
</template>
3229
</carousel>
3330
</div>
34-
<!-- toolbar -->
31+
32+
<!-- Toolbar -->
3533
<div
3634
class="group fixed z-40 bottom-2 right-2 w-full flex justify-end items-center gap-1 transition-opacity"
3735
:class="{ 'opacity-0 hover:opacity-100': !chords }"
3836
>
39-
<!-- back navigation -->
37+
<!-- Pagination -->
38+
<div class="hidden md:flex mr-auto ml-6 gap-2">
39+
<secondary-button
40+
v-for="(song, i) in songs"
41+
:key="i"
42+
class="w-8 h-8 !rounded-full"
43+
:class="{
44+
'!bg-spring-600': i === presentation?.data.currentSlide
45+
}"
46+
@click="presentation.slideTo(i)"
47+
>
48+
<span v-if="chords">{{ song.customTuning }}</span>
49+
</secondary-button>
50+
</div>
51+
52+
<!-- Back navigation -->
4053
<secondary-button
4154
class="absolute bottom-0 left-4 md:left-auto md:right-1/2 flex items-center gap-1 mr-0.5"
4255
:disabled="currentPosition <= 0"
@@ -48,12 +61,13 @@
4861
<div class="hidden 2xl:block max-w-3xs truncate">
4962
{{ songs[currentPosition-1].title }}
5063
</div>
51-
<div class="text-lg leading-4 font-mono font-bold text-spring-600 dark:text-spring-400">
64+
<div v-if="chords" class="text-lg leading-4 font-mono font-bold text-spring-600 dark:text-spring-400">
5265
{{ songs[currentPosition-1].customTuning }}
5366
</div>
5467
</div>
5568
</secondary-button>
56-
<!-- forward navigation -->
69+
70+
<!-- Forward navigation -->
5771
<secondary-button
5872
class="absolute bottom-0 left-16 md:left-1/2 flex items-center gap-1 ml-0.5"
5973
:disabled="currentPosition >= songs.length-1"
@@ -64,15 +78,17 @@
6478
<div class="hidden 2xl:block max-w-3xs truncate">
6579
{{ songs[currentPosition+1].title }}
6680
</div>
67-
<div class="text-lg leading-4 font-mono font-bold text-spring-600 dark:text-spring-400">
81+
<div v-if="chords" class="text-lg leading-4 font-mono font-bold text-spring-600 dark:text-spring-400">
6882
{{ songs[currentPosition+1].customTuning }}
6983
</div>
7084
</div>
7185
<icon-arrow-right class="w-5 h-5 stroke-1.5" />
7286
</secondary-button>
73-
<!-- live clock -->
87+
88+
<!-- Live clock -->
7489
<div class="font-mono text-2xl px-4">{{ timeonly }}</div>
75-
<!-- song info -->
90+
91+
<!-- Song info -->
7692
<secondary-button
7793
class="hidden lg:block"
7894
:disabled="!songs[currentPosition]?.note"
@@ -81,7 +97,7 @@
8197
>
8298
<icon-info-circle class="w-5 h-5 stroke-1.5" :class="{ 'stroke-spring-400': showModal.infosongdata }" />
8399
</secondary-button>
84-
<!-- toggle synchronisation -->
100+
<!-- Toggle synchronisation -->
85101
<secondary-button
86102
class="hidden lg:block"
87103
:title="tooltip('sync')"
@@ -90,7 +106,7 @@
90106
<icon-refresh v-if="autoSync" class="w-5 h-5 stroke-1.5 stroke-spring-400" />
91107
<icon-refresh-off v-else class="w-5 h-5 stroke-1.5" />
92108
</secondary-button>
93-
<!-- toggle content visibility -->
109+
<!-- Toggle content visibility -->
94110
<secondary-button
95111
class="hidden lg:block"
96112
:title="tooltip('display')"
@@ -99,15 +115,15 @@
99115
<icon-eye v-if="!hide" class="w-5 h-5 stroke-1.5 stroke-spring-400" />
100116
<icon-eye-off v-else class="w-5 h-5 stroke-1.5" />
101117
</secondary-button>
102-
<!-- toggle theme -->
118+
<!-- Toggle theme -->
103119
<secondary-button
104120
class="hidden lg:block"
105121
:title="tooltip('invert')"
106122
@click="dark = !dark"
107123
>
108124
<icon-brightness class="w-5 h-5 stroke-1.5" :class="{ 'stroke-spring-400': !dark }" />
109125
</secondary-button>
110-
<!-- toggle chords -->
126+
<!-- Toggle chords -->
111127
<secondary-button
112128
class="hidden lg:block"
113129
:title="tooltip('chords')"
@@ -116,7 +132,8 @@
116132
<icon-music v-if="chords" class="w-5 h-5 stroke-1.5 stroke-spring-400" />
117133
<icon-music-off v-else class="w-5 h-5 stroke-1.5" />
118134
</secondary-button>
119-
<!-- dropdown for small viewports -->
135+
136+
<!-- Dropdown for small viewports -->
120137
<div class="lg:hidden">
121138
<dropdown position="up">
122139
<button
@@ -164,15 +181,16 @@
164181
</button>
165182
</dropdown>
166183
</div>
167-
<!-- exit presentation -->
184+
<!-- Exit presentation -->
168185
<button
169186
class="p-2 text-blade-500"
170187
:title="tooltip('close')"
171188
@click="emit('closed')"
172189
>
173190
<icon-x class="w-5 h-5 stroke-1.5" />
174191
</button>
175-
<!-- remote toolbar -->
192+
193+
<!-- Remote toolbar -->
176194
<div
177195
v-if="sync && !autoSync"
178196
class="flex items-center gap-1 p-1 absolute -top-8 right-10 opacity-0 transition-all group-hover:-top-12 group-hover:opacity-100"
@@ -202,7 +220,8 @@
202220
</div>
203221
</div>
204222
</modal>
205-
<!-- modal: info song note -->
223+
224+
<!-- Modal: info song note -->
206225
<info-song-data
207226
:active="showModal.infosongdata"
208227
:song="songs[currentPosition]"
@@ -212,7 +231,7 @@
212231

213232
<script setup>
214233
import 'vue3-carousel/dist/carousel.css';
215-
import { Carousel, Slide, Pagination } from 'vue3-carousel';
234+
import { Carousel, Slide } from 'vue3-carousel';
216235
import { logicOr } from '@vueuse/math';
217236
import { whenever } from '@vueuse/core';
218237
import { reactive, ref, computed, watch, onMounted, onUnmounted, nextTick, inject } from 'vue';

0 commit comments

Comments
 (0)