marc-leopold/components/ThumbNav.vue

74 lines
1.0 KiB
Vue
Raw Normal View History

2019-01-04 16:18:45 +00:00
<template>
2019-01-30 13:12:36 +00:00
<div class="wrapper"
@click.stop="$emit('navClick')"
>
<div class="svg-container"
:class="{ 'is-reversed': direction === 'right' }"
>
<SVGIcon class="svg-icon"
/>
</div>
</div>
2019-01-04 16:18:45 +00:00
</template>
<script>
2019-01-30 13:12:36 +00:00
import SVGIcon from '@/assets/svg/chevron-left.svg'
2019-01-04 16:18:45 +00:00
export default {
2019-01-30 13:12:36 +00:00
components: {
SVGIcon,
},
2019-01-04 16:18:45 +00:00
props: {
direction: {
type: String,
default: function () {
return 'right'
}
}
},
data () {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
2019-01-30 13:12:36 +00:00
.wrapper {
cursor: pointer;
}
.svg-container {
transition: opacity .3s, transform .5s;
2019-02-13 12:47:21 +00:00
opacity: .6;
2019-01-30 13:12:36 +00:00
transform: none;
@at-root .wrapper:hover & {
opacity: .6;
transform: translate3d(-3px, 0, 0);
}
@at-root .wrapper:hover &.is-reversed {
transform: translate3d(3px, 0, 0);
}
}
.svg-icon {
width: 100%;
min-width: 4rem;
height: 100%;
min-height: 4rem;
overflow: visible;
}
.is-reversed .svg-icon {
transform: scaleX(-1);
}
2019-01-04 16:18:45 +00:00
</style>