Skip to content

Commit b431f1e

Browse files
committed
Minor UI improvements.
1 parent 25dcbc9 commit b431f1e

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

src/components/vueperslides/styles.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,15 @@
6868

6969
.vueperslide {
7070
background-position: center;
71-
overflow: hidden;
7271

7372
&__image {background-position: center;}
7473

7574
&__content-wrapper:not(&__content-wrapper--outside-top):not(&__content-wrapper--outside-bottom) {
76-
width: 100%;
77-
height: 100%;
7875
display: flex;
76+
flex: 1 1 auto;
7977
flex-direction: column;
78+
align-items: center;
8079
justify-content: center;
81-
align-content: center;
8280
text-align: center;
8381
}
8482
}

src/components/vueperslides/vueperslide.vue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
@mouseenter="$emit('mouse-enter', { slideIndex, title, content, image, link }, $el)"
1010
@mouseleave="$emit('mouse-leave')")
1111
.vueperslide__image(v-if="image && conf.slideImageInside" :style="imageStyles")
12-
.vueperslide__content-wrapper(v-show="!conf.slideContentOutside")
12+
template(v-show="!conf.slideContentOutside")
1313
slot(name="content")
14-
.vueperslide__title(v-if="title" v-html="title")
15-
.vueperslide__content(v-if="content" v-html="content")
14+
.vueperslide__content-wrapper
15+
.vueperslide__title(v-if="title" v-html="title")
16+
.vueperslide__content(v-if="content" v-html="content")
1617
</template>
1718

1819
<script>
@@ -159,10 +160,10 @@ export default {
159160
.vueperslide {
160161
white-space: normal;
161162
background-size: cover;
162-
display: inline-block;
163-
position: relative;
163+
flex-shrink: 0;
164+
display: block;
164165
width: 100%;
165-
height: 100%;
166+
position: relative;
166167
167168
&[href] {-webkit-user-drag: none;}
168169
@@ -176,7 +177,8 @@ export default {
176177
}
177178
178179
&__content-wrapper:not(&__content-wrapper--outside-top):not(&__content-wrapper--outside-bottom) {
179-
position: absolute;
180+
height: 100%;
181+
margin: auto;
180182
}
181183
182184
.vueperslides--fade & {
@@ -195,6 +197,8 @@ export default {
195197
}
196198
}
197199
200+
.vueperslides--slide-image-inside & {overflow: hidden;}
201+
198202
.vueperslides--3d & {
199203
position: absolute;
200204
// Trickier than rotateY(180deg) translateZ($slideshowWidth / 2);

0 commit comments

Comments
 (0)