This repository has been archived by the owner on May 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(chapters): Adds support for chapter images
- Loading branch information
1 parent
063e342
commit f4af652
Showing
27 changed files
with
522 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
"env": { | ||
"AVA": { | ||
"plugins": [ | ||
"transform-runtime", | ||
[ | ||
"babel-plugin-webpack-alias", | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<template> | ||
<div class="poster" id="header-poster"> | ||
<div class="poster-container" :style="posterStyle"> | ||
<img class="poster-image" :src="posterSrc" :alt="alternativeText" @error="onImageLoad"> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { mapState, mapActions } from 'redux-vuex' | ||
import selectors from 'store/selectors' | ||
export default { | ||
data: mapState({ | ||
theme: 'theme', | ||
episode: 'episode', | ||
show: 'show', | ||
components: 'components', | ||
visibleComponents: 'visibleComponents', | ||
chapterPoster: selectors.selectCurrentChapterImage, | ||
playtime: 'playtime' | ||
}), | ||
computed: { | ||
posterStyle () { | ||
return { | ||
'border-color': this.theme.player.poster | ||
} | ||
}, | ||
posterSrc () { | ||
if (this.playtime === 0) { | ||
return this.episode.poster || this.show.poster | ||
} | ||
return this.chapterPoster || this.episode.poster || this.show.poster | ||
}, | ||
alternativeText () { | ||
if (this.episode.poster) { | ||
return this.$t('A11Y.ALT_EPISODE_COVER') | ||
} | ||
if (this.show.poster) { | ||
return this.$t('A11Y.ALT_SHOW_COVER') | ||
} | ||
} | ||
}, | ||
methods: mapActions({ | ||
onImageLoad: ({ dispatch, actions }) => { | ||
dispatch(actions.toggleInfoPoster(false)) | ||
} | ||
}), | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
@import '~styles/variables'; | ||
.poster { | ||
margin: 0 $margin 0 0; | ||
} | ||
.poster-container { | ||
height: $poster-size; | ||
line-height: 0; | ||
border-width: 2px; | ||
border-style: solid; | ||
.poster-image { | ||
max-height: 100%; | ||
max-width: none; | ||
width: auto; | ||
} | ||
} | ||
</style> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.