Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Commit

Permalink
Merge branch 'silvester-pari-overlay-patch'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Hayes committed Dec 12, 2018
2 parents 2b8eec5 + 4ea04cc commit eac1b07
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/TwentyTwenty.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<img :src="before" alt="before"
v-on:mousedown.prevent
v-bind:style="beforeImgStyle" />
<div class="twentytwenty-overlay">
<div class="twentytwenty-overlay"
v-bind:style="overlayStyle">
<div v-if="beforeLabel" class="twentytwenty-before-label">{{beforeLabel}}</div>
<div v-if="afterLabel" class="twentytwenty-after-label">{{afterLabel}}</div>
</div>
Expand All @@ -28,7 +29,8 @@ export default {
imgOffset: null,
slideOffset: this.offset,
sliding: false,
containerStyle: {}
containerStyle: {},
overlayStyle: {}
}
},
Expand Down Expand Up @@ -66,6 +68,7 @@ export default {
startSlide (event) {
this.sliding = true
this.moveSlide(event)
this.overlayStyle = { opacity: 0 }
},
moveSlide (event) {
Expand All @@ -77,7 +80,10 @@ export default {
}
},
endSlide () { this.sliding = false },
endSlide () {
this.sliding = false
this.overlayStyle = {}
},
resize () {
this.containerStyle = {};
Expand Down Expand Up @@ -175,7 +181,7 @@ export default {
.twentytwenty-container .twentytwenty-overlay .twentytwenty-after-label {
right: 0;
}
.twentytwenty-container .twentytwenty-overlay:hover {
.twentytwenty-container:hover > .twentytwenty-overlay {
opacity: 1;
}
.twentytwenty-container .twentytwenty-handle {
Expand Down

0 comments on commit eac1b07

Please sign in to comment.