1
0
Fork 0

div updates

This commit is contained in:
Tommy Vedvik 2019-02-27 09:13:03 +01:00
parent fa6eaae94f
commit d4dfdc073f
6 changed files with 52 additions and 18 deletions

View file

@ -8,7 +8,7 @@
body { body {
background-color: var(--bg-color); background-color: var(--bg-color);
color: var(--body-color); color: var(--body-color);
transition: color 1s, background-color .5s; transition: color .6s, background-color .6s;
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif; font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
margin:0; margin:0;
padding:0; padding:0;
@ -17,21 +17,20 @@ body {
a:not(.button) { a:not(.button) {
color: var(--link-color); color: var(--link-color);
transition: color 1s; transition: color .6s;
&:hover { &:hover {
opacity: .8; opacity: .8;
} }
} }
h1,h2,h3,h4,h5,h6 { h1,h2,h3,h4,h5,h6 {
transition: color 1s; transition: color .6s;
color: var(--title-color); color: var(--title-color);
} }
.bg-highlight { .bg-highlight {
background-color: var(--bg-highlight-color); background-color: var(--bg-highlight-color);
transition: background-color .5s; transition: background-color .6s;
padding: var(--space); padding: var(--space);
border-radius: 5px; border-radius: 5px;
box-shadow: 1px 1px 5px 0 rgba(0,0,0,.02), 1px 1px 15px 0 rgba(0,0,0,.03); box-shadow: 1px 1px 5px 0 rgba(0,0,0,.02), 1px 1px 15px 0 rgba(0,0,0,.03);

View file

@ -1,8 +1,12 @@
<template> <template>
<div class="author"> <div class="author">
<g-image class="author__image" src="~/assets/images/author.jpg" width="240" height="240" blur="5" /> <g-image class="author__image" src="~/assets/images/author.jpg" width="240" height="240" blur="5" />
<h1 v-if="siteTitle" class="author__siteTitle">{{ siteTitle }}</h1> <h1 v-if="siteTitle" class="author__site-title">{{ siteTitle }}</h1>
<p class="author__intro">A minimalistic and simple blog starter for Gridsome that uses Markdown for content.</p> <p class="author__intro">A minimalistic and simple blog starter for Gridsome that uses Markdown for content.</p>
<p class="author__links">
<a href="#">Twitter</a>
<a href="#">GitHub</a>
</p>
</div> </div>
</template> </template>
@ -30,8 +34,15 @@ export default {
opacity: .8; opacity: .8;
} }
&__siteTitle { &__site-title {
font-size: 1.5em; font-size: 1.5em;
} }
&__links {
margin-top: -.5em;
a {
margin: 0 .5em;
}
}
} }
</style> </style>

View file

@ -1,16 +1,18 @@
<template> <template>
<div class="post-card bg-highlight"> <div class="post-card bg-highlight">
<h2 v-html="post.title" /> <h2 v-html="post.title" />
{{ post }} <p v-html="post.excerpt" />
<p> <PostMeta :post="post" />
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Pariatur excepturi labore tempore expedita, et iste tenetur suscipit explicabo! Dolores, aperiam non officia eos quod asperiores
</p>
<g-link class="post-card__link" :to="post.path">Link</g-link> <g-link class="post-card__link" :to="post.path">Link</g-link>
</div> </div>
</template> </template>
<script> <script>
import PostMeta from '~/components/PostMeta'
export default { export default {
components: {
PostMeta
},
props: ['post'], props: ['post'],
} }
</script> </script>

View file

@ -0,0 +1,16 @@
<template>
<div class="post-meta">Posted 19. February 2019. <strong>3 min</strong> read</div>
</template>
<script>
export default {
props: ['post']
}
</script>
<style lang="scss">
.post-meta {
font-size: .8em;
opacity: .7;
}
</style>

View file

@ -4,7 +4,7 @@
<header class="header"> <header class="header">
<div class="header__left"> <div class="header__left">
<g-link v-if="$route.params.slug" class="logo" to="/"> <g-link v-if="$route.params.slug" class="logo" to="/">
<span class="logo__text"> Gridsome Blog Starter</span> <span class="logo__text">Gridsome Blog Starter</span>
</g-link> </g-link>
</div> </div>
<div class="header__right"> <div class="header__right">

View file

@ -2,12 +2,12 @@
<Layout> <Layout>
<div class="post-title"> <div class="post-title">
<h1 class="post-title__text"> {{ $page.post.title }} </h1> <h1 class="post-title__text"> {{ $page.post.title }} </h1>
<p class="post-title__meta">Posted 19. February 2019. <strong>3 min</strong> read</p> <PostMeta :post="$page.post" />
</div> </div>
<div class="post bg-highlight"> <div class="post bg-highlight">
<div class="post__header"> <div class="post__header">
<!-- Add anything here --> <!-- Add anything here. Like a featured image -->
</div> </div>
<div class="post__content" v-html="$page.post.content" /> <div class="post__content" v-html="$page.post.content" />
<div class="post__footer"> <div class="post__footer">
@ -24,10 +24,13 @@
</template> </template>
<script> <script>
import PostMeta from '~/components/PostMeta'
import Author from '~/components/Author.vue' import Author from '~/components/Author.vue'
export default { export default {
components: { components: {
Author Author,
PostMeta
} }
} }
</script> </script>
@ -42,13 +45,12 @@ query Post ($path: String!) {
</page-query> </page-query>
<style lang="scss"> <style lang="scss">
.post-title { .post-title {
padding: calc(var(--space) / 2) 0; padding: calc(var(--space) / 2) 0;
text-align: center; text-align: center;
&__meta {
font-size: .8em;
}
} }
.post { .post {
&__header { &__header {
@ -65,6 +67,7 @@ query Post ($path: String!) {
width: calc(100% + var(--space) * 2); width: calc(100% + var(--space) * 2);
margin-left: calc(var(--space) * -1); margin-left: calc(var(--space) * -1);
} }
pre { pre {
width: calc(100% + var(--space) * 2); width: calc(100% + var(--space) * 2);
margin-left: calc(var(--space) * -1); margin-left: calc(var(--space) * -1);
@ -74,7 +77,10 @@ query Post ($path: String!) {
color: var(--body-color); color: var(--body-color);
text-shadow: none; text-shadow: none;
margin-bottom: 2em; margin-bottom: 2em;
border-top: 1px solid rgba(0,0,0,.03);
border-bottom: 1px solid rgba(0,0,0,.03);
} }
code { code {
background-color: var(--bg-code)!important; background-color: var(--bg-code)!important;
color: var(--body-color); color: var(--body-color);