miracle/components/PageHeader.vue

98 lines
2.4 KiB
Vue
Raw Normal View History

2020-12-26 09:50:33 +00:00
<template>
<div class="relative group page-header">
2021-01-07 21:16:51 +00:00
<component is="style">
:root {
2021-01-09 20:21:26 +00:00
--bg-ps: {{ positioning }};
--bg-sm: url('{{ require('@/assets/images/bg/'+normalImageType+'/bg-sm.jpg') }}');
--bg-md: url('{{ require('@/assets/images/bg/'+normalImageType+'/bg-md.jpg') }}');
--bg-lg: url('{{ require('@/assets/images/bg/'+normalImageType+'/bg-lg.jpg') }}');
--bg-xl: url('{{ require('@/assets/images/bg/'+normalImageType+'/bg-xl.jpg') }}');
--bg-xxl: url('{{ require('@/assets/images/bg/'+normalImageType+'/bg-xxl.jpg') }}');
}
2021-01-07 21:16:51 +00:00
</component>
2020-12-26 09:50:33 +00:00
<div class="h-full w-full page-header-background">
<div class="w-full h-full opacity-50 bg-black">
</div>
</div>
<div class="absolute bottom-0 py-2 left-0 right-0">
<div class="container mx-auto main">
<div>
<slot></slot>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: [ 'imageType' ],
computed: {
normalImageType() {
return this.imageType ?? '283-yuika';
2021-01-09 20:21:26 +00:00
},
positioning() {
switch(this.normalImageType) {
case '283-yuika':
return 'right 25% top 20%';
case 'cue-mei':
return 'center top';
case 'cue-mei2':
return 'center top';
case '765-yuriko':
return 'right 15% top 10%';
2021-01-09 20:35:43 +00:00
case '765-yuriko2':
return 'right 35% top 30%';
2021-01-09 20:21:26 +00:00
default:
return 'center';
}
}
},
2020-12-26 09:50:33 +00:00
}
</script>
<style>
.page-header {
width: 100%;
min-height: 200px;
height: 70vh;
@apply text-white font-light;
}
.page-header a {
@apply text-white;
}
@screen md {
.page-header {
min-height: 300px;
height: 70vh;
}
}
.page-header-background {
background-image: var(--bg-sm);
2020-12-26 09:50:33 +00:00
background-size: cover;
2021-01-09 20:21:26 +00:00
background-position: var(--bg-ps);
2020-12-26 09:50:33 +00:00
}
@screen sm {
.page-header-background {
background-image: var(--bg-md);
2020-12-26 09:50:33 +00:00
}
}
@screen md {
.page-header-background {
background-image: var(--bg-lg);
2020-12-26 09:50:33 +00:00
}
}
@screen lg {
.page-header-background {
background-image: var(--bg-xl);
2020-12-26 09:50:33 +00:00
}
}
@screen xl {
.page-header-background {
background-image: var(--bg-xxl);
2020-12-26 09:50:33 +00:00
}
}
</style>