about summary refs log tree commit diff
path: root/components/Posts/PostLink.vue
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-12-03 13:05:15 +0100
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-12-03 13:05:15 +0100
commit34da06762e81f85c5df29fdec66e2055b8b930a9 (patch)
tree490af00a9973732ebe7c3455f638d3faaf54bc9e /components/Posts/PostLink.vue
parent65ff7d9f2daa59e44f0cdb1aae8d7cbcd9d4603f (diff)
downloadpuszcza-34da06762e81f85c5df29fdec66e2055b8b930a9.tar.gz
puszcza-34da06762e81f85c5df29fdec66e2055b8b930a9.zip
Add missing stories
Diffstat (limited to 'components/Posts/PostLink.vue')
-rw-r--r--components/Posts/PostLink.vue74
1 files changed, 74 insertions, 0 deletions
diff --git a/components/Posts/PostLink.vue b/components/Posts/PostLink.vue
new file mode 100644
index 0000000..54cd934
--- /dev/null
+++ b/components/Posts/PostLink.vue
@@ -0,0 +1,74 @@
+<template>
+  <div class="post-link">
+    <a :href="route">
+      <div class="post-container">
+        <h4 class="post-title">{{ title }}</h4>
+        <p class="post-description">{{ shortenedDescription }}...</p>
+      </div>
+    </a>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'PostLink',
+  props: {
+    title: {
+      type: String,
+      required: true
+    },
+    description: {
+      type: String,
+      default: ''
+    },
+    route: {
+      type: String,
+      required: true
+    }
+  },
+  computed: {
+    shortenedDescription() {
+      const first30Words = this.description.split(' ').slice(0, 30)
+      return first30Words.join(' ')
+    }
+  }
+}
+</script>
+
+<style scoped>
+.post-link {
+  margin: 20px;
+  flex-basis: 410px;
+  max-width: 410px;
+  /* height: 250px; */
+  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.25);
+  background: #ffffff;
+  text-align: left;
+  transition: transform 300ms ease-in-out;
+}
+
+.post-link:hover {
+  box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
+  transform: scale(1.02);
+}
+
+.post-link > a {
+  text-decoration: none;
+  height: 100%;
+}
+
+.post-link .post-container {
+  padding: 20px;
+  height: 100%;
+}
+
+.post-link .post-title {
+  color: #181818;
+  font-size: 1.3em;
+}
+
+.post-link .post-description {
+  color: #484848;
+  font-size: 0.9em;
+}
+</style>