mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-11-03 19:07:00 -05:00 
			
		
		
		
	Update playback speed to no longer use font-mono, adjust position of popup
This commit is contained in:
		
							parent
							
								
									b2d41f0583
								
							
						
					
					
						commit
						0bc58c254f
					
				@ -1,9 +1,9 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div ref="wrapper" class="relative ml-4 sm:ml-8" v-click-outside="clickOutside">
 | 
			
		||||
    <div class="flex items-center justify-center text-gray-300 cursor-pointer h-full" @mousedown.prevent @mouseup.prevent @click="setShowMenu(true)">
 | 
			
		||||
      <span class="font-mono uppercase text-gray-200 text-sm sm:text-base">{{ playbackRate.toFixed(1) }}<span class="text-base">x</span></span>
 | 
			
		||||
      <span class="text-gray-200 text-sm sm:text-base">{{ playbackRate.toFixed(1) }}<span class="text-base">x</span></span>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div v-show="showMenu" class="absolute -top-20 z-20 bg-bg border-black-200 border shadow-xl rounded-lg" :style="{ left: menuLeft + 'px' }">
 | 
			
		||||
    <div v-show="showMenu" class="absolute -top-[5.5rem] z-20 bg-bg border-black-200 border shadow-xl rounded-lg" :style="{ left: menuLeft + 'px' }">
 | 
			
		||||
      <div class="absolute -bottom-1.5 right-0 w-full flex justify-center" :style="{ left: arrowLeft + 'px' }">
 | 
			
		||||
        <div class="arrow-down" />
 | 
			
		||||
      </div>
 | 
			
		||||
@ -11,12 +11,12 @@
 | 
			
		||||
        <template v-for="rate in rates">
 | 
			
		||||
          <div :key="rate" class="h-full border-black-300 w-11 cursor-pointer border rounded-sm" :class="value === rate ? 'bg-black-100' : 'hover:bg-black hover:bg-opacity-10'" style="min-width: 44px; max-width: 44px" @click="set(rate)">
 | 
			
		||||
            <div class="w-full h-full flex justify-center items-center">
 | 
			
		||||
              <p class="text-xs text-center font-mono">{{ rate }}<span class="text-sm">x</span></p>
 | 
			
		||||
              <p class="text-xs text-center">{{ rate }}<span class="text-sm">x</span></p>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </template>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="w-full py-1 px-4">
 | 
			
		||||
      <div class="w-full py-1 px-1">
 | 
			
		||||
        <div class="flex items-center justify-between">
 | 
			
		||||
          <ui-icon-btn :disabled="!canDecrement" icon="remove" @click="decrement" />
 | 
			
		||||
          <p class="px-2 text-2xl sm:text-3xl">{{ playbackRate }}<span class="text-2xl">x</span></p>
 | 
			
		||||
@ -41,7 +41,7 @@ export default {
 | 
			
		||||
      currentPlaybackRate: 0,
 | 
			
		||||
      MIN_SPEED: 0.5,
 | 
			
		||||
      MAX_SPEED: 10,
 | 
			
		||||
      menuLeft: -92,
 | 
			
		||||
      menuLeft: -96,
 | 
			
		||||
      arrowLeft: 0
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
@ -89,9 +89,9 @@ export default {
 | 
			
		||||
      if (boundingBox.left + 110 > window.innerWidth - 10) {
 | 
			
		||||
        this.menuLeft = window.innerWidth - 230 - boundingBox.left
 | 
			
		||||
 | 
			
		||||
        this.arrowLeft = Math.abs(this.menuLeft) - 92
 | 
			
		||||
        this.arrowLeft = Math.abs(this.menuLeft) - 96
 | 
			
		||||
      } else {
 | 
			
		||||
        this.menuLeft = -92
 | 
			
		||||
        this.menuLeft = -96
 | 
			
		||||
        this.arrowLeft = 0
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
@ -2,8 +2,6 @@
 | 
			
		||||
  <div class="w-full -mt-6">
 | 
			
		||||
    <div class="w-full relative mb-1">
 | 
			
		||||
      <div class="absolute -top-10 lg:top-0 right-0 lg:right-2 flex items-center h-full">
 | 
			
		||||
        <!-- <span class="material-symbols text-2xl cursor-pointer" @click="toggleFullscreen(true)">expand_less</span> -->
 | 
			
		||||
 | 
			
		||||
        <controls-playback-speed-control v-model="playbackRate" @input="setPlaybackRate" @change="playbackRateChanged" class="mx-2 block" />
 | 
			
		||||
 | 
			
		||||
        <ui-tooltip direction="top" :text="$strings.LabelVolume">
 | 
			
		||||
@ -15,7 +13,7 @@
 | 
			
		||||
            <span v-if="!sleepTimerSet" class="material-symbols text-2xl">snooze</span>
 | 
			
		||||
            <div v-else class="flex items-center">
 | 
			
		||||
              <span class="material-symbols text-lg text-warning">snooze</span>
 | 
			
		||||
              <p class="text-sm sm:text-lg text-warning font-mono font-semibold text-center px-0.5 sm:pb-0.5 sm:min-w-8">{{ sleepTimerRemainingString }}</p>
 | 
			
		||||
              <p class="text-sm sm:text-lg text-warning font-semibold text-center px-0.5 sm:pb-0.5 sm:min-w-8">{{ sleepTimerRemainingString }}</p>
 | 
			
		||||
            </div>
 | 
			
		||||
          </button>
 | 
			
		||||
        </ui-tooltip>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user