-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(surrounding-posts): created surrounding posts component
- Loading branch information
1 parent
98781c2
commit 67d26d3
Showing
7 changed files
with
143 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<template> | ||
<nav class="surrounding-posts container"> | ||
<NuxtLink | ||
v-if="prev" | ||
:to="{ name: 'posts-slug', params: { slug: prev.slug } }" | ||
class="surrounding-posts__link surrounding-posts__link--prev" | ||
> | ||
<brand-icon | ||
class="surrounding-posts__icon surrounding-posts__icon--prev" | ||
:name="arrow" | ||
title="Arrow icon pointing back" | ||
/> | ||
{{ prev.title }} | ||
</NuxtLink> | ||
<div v-else /> | ||
<!-- Added empty div to mantain the "Next Post" link on the end --> | ||
<NuxtLink | ||
v-if="next" | ||
:to="{ name: 'posts-slug', params: { slug: next.slug } }" | ||
class="surrounding-posts__link surrounding-posts__link--next" | ||
> | ||
{{ next.title }} | ||
<brand-icon | ||
class="surrounding-posts__icon surrounding-posts__icon--next" | ||
:name="arrow" | ||
title="Arrow icon pointing forward" | ||
/> | ||
</NuxtLink> | ||
</nav> | ||
</template> | ||
|
||
<script> | ||
import dictionary from '@/utils/dictionary' | ||
export default { | ||
name: 'SurroundingPosts', | ||
props: { | ||
next: { | ||
type: Object, | ||
default: null, | ||
}, | ||
prev: { | ||
type: Object, | ||
default: null, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
arrow: dictionary?.icons?.utilities?.arrow, | ||
} | ||
}, | ||
} | ||
</script> | ||
<style lang="scss"> | ||
.surrounding-posts { | ||
display: grid; | ||
grid-template-columns: 1fr; | ||
grid-gap: 1rem; | ||
width: 100%; | ||
@media screen and (min-width: $breakpoint-small) { | ||
grid-template-columns: 1fr 1fr; | ||
} | ||
} | ||
.surrounding-posts__link { | ||
@include elevation(1); | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
height: 100%; | ||
padding: 1rem; | ||
border: 0; | ||
border-radius: 6px; | ||
transition: 0.3s ease-in-out box-shadow; | ||
&:hover { | ||
@include elevation(4); | ||
border: 0; | ||
} | ||
} | ||
.surrounding-posts__link--prev { | ||
@media screen and (min-width: $breakpoint-small) { | ||
justify-content: flex-start; | ||
} | ||
} | ||
.surrounding-posts__link--next { | ||
@media screen and (min-width: $breakpoint-small) { | ||
justify-content: flex-end; | ||
text-align: right; | ||
} | ||
} | ||
.surrounding-posts__icon { | ||
width: 1.5rem; | ||
min-width: 1.5rem; | ||
} | ||
.surrounding-posts__icon--prev { | ||
transform: rotate(180deg); | ||
} | ||
// .surrounding-posts__icon--next { | ||
// } | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: Top 5 football games 🏈 I saw with my dad | ||
summary: My dad instilled in me a great love for football. These are the games I enjoyed most by his side. | ||
featuredImage: static/images/posts/top-5-football-games-i-saw-with-my-dad/helmet_catch.jpg | ||
--- | ||
|
||
Wait for it | ||
|
||
<post-image src="/images/posts/top-5-football-games-i-saw-with-my-dad/helmet_catch" alt="Derek Tyree is catching the football with help of his helmet in tight coverage" title="The helmet catch ny Derek Tyree" width="792" height="512"></post-image> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+297 KB
static/images/posts/top-5-football-games-i-saw-with-my-dad/helmet_catch.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters