marc-leopold/components/ContentPage.vue

133 lines
2.1 KiB
Vue
Raw Normal View History

2019-01-03 14:06:28 +00:00
<template>
2019-01-14 11:06:38 +00:00
<article class="content-page">
2019-01-24 09:44:26 +00:00
<h1 v-if="heading !== ''" class="page-heading title">{{ heading }}</h1>
2019-01-03 14:06:28 +00:00
<section class="content-container">
<div v-if="$slots.default" class="content">
2019-01-03 18:15:02 +00:00
<slot></slot>
</div>
2019-01-03 14:06:28 +00:00
</section>
<div v-if="$slots.background" class="background">
<slot name="background"></slot>
2019-01-03 14:49:25 +00:00
</div>
2019-01-14 11:06:38 +00:00
</article>
2019-01-03 14:06:28 +00:00
</template>
<script>
export default {
props: {
heading: {
type: String,
2019-01-24 09:44:26 +00:00
required: false,
default: '',
2019-01-03 14:06:28 +00:00
}
},
data () {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
2019-01-03 17:52:38 +00:00
$z-index-bottom: 5;
$z-index-top: 10;
2019-01-03 14:06:28 +00:00
.content-page {
position: relative;
2019-01-03 17:52:38 +00:00
display: flex;
flex-direction: column;
2019-01-03 14:06:28 +00:00
width: 100%;
height: 100%;
padding: $site-menu__header-width 0 0 0;
@media (min-width: $bp__layout) {
padding: 0 0 0 $site-menu__header-width;
}
2019-01-27 15:52:30 +00:00
background-color: $color__neutral-100;
2019-01-03 14:06:28 +00:00
}
2019-01-03 14:49:25 +00:00
.content-container {
2019-01-03 17:52:38 +00:00
z-index: $z-index-top;
2019-01-03 14:49:25 +00:00
position: relative;
2019-01-03 17:52:38 +00:00
height: 100%;
2019-01-03 18:15:02 +00:00
width: 100%;
2019-01-03 17:52:38 +00:00
overflow-y: auto;
overflow-x: hidden;
@media (min-width: $bp__layout) {
position: absolute;
top: 0;
right: 0;
}
2019-01-03 14:49:25 +00:00
}
2019-01-03 18:15:02 +00:00
.content {
position: absolute;
width: 100%;
2019-01-27 18:26:13 +00:00
min-height: 100%;
2019-01-03 18:15:02 +00:00
top: 0;
right: 0;
2019-01-27 15:52:30 +00:00
padding: .5rem 1rem 2rem;
2019-01-03 18:32:11 +00:00
2019-01-03 18:15:02 +00:00
@media (min-width: $bp__layout) {
width: 50%;
2019-01-24 09:44:26 +00:00
padding: 1rem;
2019-01-03 18:32:11 +00:00
2019-01-27 15:52:30 +00:00
background-color: rgba(0, 0, 0, .5);
2019-01-03 18:15:02 +00:00
}
2019-01-03 18:32:11 +00:00
color: #fff; // TEMP
2019-01-03 18:15:02 +00:00
}
2019-01-03 17:52:38 +00:00
.page-heading {
z-index: $z-index-top;
position: relative;
2019-01-27 15:52:30 +00:00
margin: 1rem;
2019-01-03 17:52:38 +00:00
@media (min-width: $bp__layout) {
2019-01-24 09:44:26 +00:00
width: 14em;
max-width: calc(50% - #{$site-menu__header-width} - 3rem);
2019-01-27 15:52:30 +00:00
margin: 2rem 1rem 1rem 2rem;
2019-01-24 09:44:26 +00:00
}
}
.title {
@include font-title();
color: $color__neutral-900;
2019-01-27 15:52:30 +00:00
text-align: center;
@media (min-width: $bp__layout) {
font-size: 3.7vw;
text-align: left;
}
2019-01-24 09:44:26 +00:00
@media (min-width: 90em) {
font-size: 3.5rem;
2019-01-03 17:52:38 +00:00
}
2019-01-03 14:49:25 +00:00
}
.background {
z-index: $z-index-bottom;
2019-01-03 14:49:25 +00:00
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
2019-01-27 15:52:30 +00:00
opacity: .5;
@media (min-width: $bp__layout) {
opacity: 1;
}
2019-01-03 14:49:25 +00:00
}
2019-01-03 14:06:28 +00:00
</style>