marc-leopold/pages/about.vue

153 lines
3.0 KiB
Vue
Raw Normal View History

2019-01-14 10:24:29 +00:00
<template>
2019-01-27 15:52:30 +00:00
<ContentPage heading="About Me" class="about">
2019-02-15 11:14:36 +00:00
<div class="about-content" :class="{ 'no-content-container': isNoContent }">
<h2 class="heading heading-top">{{ title }}</h2>
<div v-html="body"></div>
2019-01-27 15:52:30 +00:00
</div>
<BackgroundImageLoader slot="background"
class="background"
2019-02-04 11:47:25 +00:00
:image-url="imageUrl"
2019-01-27 15:52:30 +00:00
>
<div slot="overlay" class="background-tint background-overlay"></div>
</BackgroundImageLoader>
2019-01-14 10:24:29 +00:00
</ContentPage>
</template>
<script>
import ContentPage from '@/components/ContentPage'
2019-01-27 15:52:30 +00:00
import BackgroundImageLoader from '@/components/BackgroundImageLoader'
2019-01-14 10:24:29 +00:00
export default {
2019-01-31 10:20:14 +00:00
name: 'AboutPage',
2019-01-14 10:24:29 +00:00
components: {
2019-01-27 15:52:30 +00:00
ContentPage,
BackgroundImageLoader,
2019-01-14 10:24:29 +00:00
},
2019-01-31 10:20:14 +00:00
head () {
2019-01-14 10:24:29 +00:00
return {
2019-01-31 10:20:14 +00:00
title: 'About Me',
2019-02-04 12:53:18 +00:00
meta: [{
hid: 'description',
name: 'description',
content: 'All about the work of photographer Marc Leopold, his philosophy and inspirations.'
}],
2019-01-14 10:24:29 +00:00
}
2019-01-31 10:20:14 +00:00
},
2019-02-12 12:41:44 +00:00
async asyncData ({ $axios }) {
2019-02-15 11:14:36 +00:00
try {
const isNoContent = false
let { title, imageUrl, body } = await $axios.$get('/api/v1/about')
if (!body || body.length < 1) {
throw new Error('No body in response')
} else if (!imageUrl || imageUrl.length < 1) {
imageUrl = '/img/default-about.jpg'
}
return { title, imageUrl, body, isNoContent }
} catch {
return {
title: 'Coming Soon',
imageUrl: '/img/default-about.jpg',
body: `<div class="no-services">
<p class="no-conttent-text">Please check back, I will be updating this page shortly.</p>
</div>
`,
isNoContent: true,
}
}
2019-02-04 11:47:25 +00:00
},
2019-01-14 10:24:29 +00:00
}
</script>
<style scoped lang="scss">
2019-01-27 15:52:30 +00:00
.about {
font-size: 1rem;
}
.about-content {
color: $color__neutral-800;
text-shadow: 0 0 3px #000;
@media (min-width: 60em) {
padding: 1rem 2rem;
}
}
2019-02-15 11:14:36 +00:00
.about-content /deep/ blockquote {
2019-01-27 15:52:30 +00:00
font-size: 1.4em;
margin-bottom: 1.5rem;
padding: 1.5rem;
text-align: center;
}
2019-02-15 11:14:36 +00:00
.about-content /deep/ blockquote p {
2019-01-27 15:52:30 +00:00
color: $color__neutral-700;
text-shadow: 0 0 3px #000;
}
.heading {
color: $color__neutral-900;
2019-01-31 10:50:58 +00:00
@include font-title(400);
2019-01-27 15:52:30 +00:00
text-align: center;
}
.heading-top {
margin-bottom: 1.5rem;
}
2019-02-15 11:14:36 +00:00
.about-content /deep/ ul {
2019-01-27 15:52:30 +00:00
padding: 0;
margin: 0;
list-style: none;
text-align: center;
font-size: 1.2em;
line-height: 1.2;
margin-bottom: 4.5rem;
}
2019-02-15 11:14:36 +00:00
.about-content /deep/ li {
2019-01-27 15:52:30 +00:00
position: relative;
padding: 1.25rem 0 1.25rem;
&::after {
content: '';
position: absolute;
width: 2rem;
height: 1px;
left: 50%;
bottom: 0;
transform: translateX(-50%);
background-color: rgba($color__neutral-500, .6);
}
&:first-child {
padding-top: 0;
}
&:last-child {
padding-bottom: 0;
&::after {
display: none;
}
}
}
2019-02-15 11:14:36 +00:00
.about-content /deep/ h2 {
text-align: center;
}
.about-content /deep/ .background-overlay {
2019-01-27 15:52:30 +00:00
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
2019-01-14 10:24:29 +00:00
</style>