Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Commit

Permalink
feat(playtime): Prefix running progress and chapters with minus
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-heimbuch committed Jun 25, 2017
1 parent 778fc03 commit ae23ba2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/player/progress-bar/Progress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,17 @@
store.dispatch(store.actions.updatePlaytime(event.target.value))
},
onInput (event) {
store.dispatch(store.actions.disableGhostMode())
this.thumbPosition = relativePosition(interpolate(event.target.value), this.duration)
store.dispatch(store.actions.updatePlaytime(event.target.value))
},
onMouseMove (event) {
if (event.offsetY < 13 && event.offsetY > 31) {
if ((event.offsetY < 13 && event.offsetY > 31) || event.offsetX < 0 || event.offsetX > event.target.clientWidth) {
this.thumbActive = false
store.dispatch(store.actions.disableGhostMode())
return
}
this.thumbActive = true
this.ghostPosition = relativePosition(event.offsetX, event.target.clientWidth)
store.dispatch(store.actions.simulatePlaytime(this.duration * event.offsetX / event.target.clientWidth))
Expand Down Expand Up @@ -164,8 +166,6 @@
width: $progress-thumb-width;
pointer-events: none;
transition: all $animation-duration / 2;
&.active {
width: $progress-thumb-active-width;
height: $progress-thumb-active-height;
Expand Down
2 changes: 1 addition & 1 deletion src/components/player/progress-bar/Timer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="timer-progress" :class="playstate" :style="timerStyle(theme)">
<span class="current">{{ secondsToTime(ghost.active ? ghost.time : playtime) }}</span>
<CurrentChapter class="chapter" />
<span class="time">{{ secondsToTime(duration - (ghost.active ? ghost.time : playtime)) }}</span>
<span class="time">-{{ secondsToTime(duration - (ghost.active ? ghost.time : playtime)) }}</span>
</div>
</template>

Expand Down
3 changes: 2 additions & 1 deletion src/components/tabs/chapters/ChapterEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
const remainingTime = (chapter, playtime) => {
if (chapter.active) {
return secondsToTime(chapter.end - playtime)
return `-${secondsToTime(chapter.end - playtime)}`
}
return secondsToTime(chapter.end - chapter.start)
Expand Down Expand Up @@ -82,6 +82,7 @@
.index {
display: block;
text-align: center;
width: 30px;
}
Expand Down

0 comments on commit ae23ba2

Please sign in to comment.