white-space : nowrap;
가로 길이가 정해져 있어도, 요소가 가로 크기에 구애받지 않고 한줄로 쭉 나온다.
overflow: hidden;
넘치는 요소를 숨겨준다.
text-overflow: ellipses;
텍스트의 넘치는 요소를 ... 으로 자연스럽게 숨겨준다.
backdrop-filter: blur(4px) grayscale();
뒷배경을 블러처리 해 준다.
// MovieItem.vue
<template>
<div
:style="{ backgroundImage: `url(${movie.Poster})`}"
class="movie">
<div class="info">
<div class="year">
{{ movie.Year }}
</div>
<div class="title">
{{ movie.Title }}
</div>
</div>
</div>
</template>
<script>
export default {
props: {
movie: {
type: Object,
default: () => ({})
}
}
}
</script>
<style lang="scss" scoped>
@import "~/scss/main";
.movie {
$width: 168px;
width: $width;
height: $width * 3 / 2;
margin: 10px;
border-radius: 4px;
background-color: $gray-400;
background-size: cover;
overflow: hidden;
position: relative;
&:hover {
left: 0;
top: 0;
border: 6px solid $primary;
}
.info {
background-color: rgb($black, .3);
width: 100%;
padding: 14px;
text-align: center;
position: absolute;
left: 0;
bottom: 0;
backdrop-filter: blur(10px);
.year {
color: $primary;
}
.title {
color: $white;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
</style>