From dec87e2a665c5cd1c75686dda388c042a1b042f6 Mon Sep 17 00:00:00 2001
From: Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>
Date: Sat, 9 Nov 2019 08:28:09 +0100
Subject: Add stories for Header & JoinUs

---
 components/TheHeader.vue | 183 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 183 insertions(+)
 create mode 100644 components/TheHeader.vue

(limited to 'components/TheHeader.vue')

diff --git a/components/TheHeader.vue b/components/TheHeader.vue
new file mode 100644
index 0000000..431b945
--- /dev/null
+++ b/components/TheHeader.vue
@@ -0,0 +1,183 @@
+<template>
+  <nav class="navbar" :class="{'menu-open': isMenuCollapsed}">
+    <div class="title">
+      <img v-if="logo" class="logo" :src="logo" alt="ZHR" />
+      <nuxt-link class="title-name" :class="{margin: logo}" to="/">{{ title }}</nuxt-link>
+    </div>
+    <div class="space"></div>
+    <button @click="toggleMenu" class="menu-toggler">Menu</button>
+    <ul class="links" :class="{show: this.isMenuCollapsed}" @click="toggleMenu">
+      <!-- Loop for generating links -->
+      <nav-link v-for="route in routes" :key="route.path" :link="route.path" :name="route.name" />
+    </ul>
+  </nav>
+</template>
+
+<script>
+import NavLink from './NavLink'
+
+export default {
+  name: 'TheHeader',
+  components: {
+    NavLink
+  },
+  props: {
+    routes: {
+      type: Array,
+      required: true
+    },
+    title: {
+      type: String,
+      required: true
+    },
+    logo: {
+      type: String,
+      required: false,
+      default: () => ''
+    }
+  },
+  data: function() {
+    return {
+      isMenuCollapsed: true
+    }
+  },
+  methods: {
+    toggleMenu() {
+      this.isMenuCollapsed = !this.isMenuCollapsed
+    }
+  }
+}
+</script>
+
+<style scoped>
+.navbar {
+  font-family: 'Roboto Slab', serif;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+  color: #181818;
+
+  box-sizing: border-box;
+  width: 100%;
+  height: 80px;
+
+  background: #ffffff;
+  box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.1);
+
+  padding: 0 200px 0 200px;
+
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.space {
+  flex: 1;
+  max-width: 500px;
+}
+
+.title {
+  font-size: 30px;
+  flex-shrink: 0;
+
+  display: flex;
+}
+
+.title-name {
+  text-decoration: none;
+  color: #181818;
+  padding: 10px;
+}
+
+.title-name.margin {
+  margin-left: 100px;
+}
+
+.links {
+  display: flex;
+  flex-direction: row;
+  padding: 0;
+}
+
+.logo {
+  position: absolute;
+  top: 0;
+  z-index: 1;
+}
+
+.menu-toggler {
+  display: none;
+}
+
+@media (max-width: 1300px) {
+  .navbar {
+    padding: 0 50px 0 50px;
+  }
+}
+
+@media (max-width: 900px) {
+  .navbar.menu-open {
+    box-shadow: none;
+  }
+
+  .title {
+    font-size: 24px;
+  }
+
+  .links {
+    position: absolute;
+    /* width: 100vw; */
+
+    margin-top: 80px;
+
+    flex-direction: column;
+    display: none;
+  }
+
+  .menu-toggler {
+    display: block;
+  }
+
+  .links.show {
+    display: flex !important;
+    flex-direction: column;
+    justify-content: center;
+    align-items: flex-start;
+
+    margin-bottom: 0;
+    padding: 50px 10px;
+
+    width: 100%;
+    left: 0;
+    top: 0;
+
+    background: #fff;
+  }
+
+  .links.show li {
+    padding: 2vh;
+    font-size: 30px;
+  }
+}
+
+@media (max-width: 500px) {
+  .navbar {
+    padding: 0 10px 0 10px;
+  }
+
+  .logo {
+    width: 65px;
+  }
+
+  .title-name {
+    font-size: 20px;
+  }
+
+  .title-name.margin {
+    margin-left: 70px;
+  }
+
+  .links.show {
+    height: calc(100% - 80px);
+  }
+}
+</style>
\ No newline at end of file
-- 
cgit 1.4.1


From 65ff7d9f2daa59e44f0cdb1aae8d7cbcd9d4603f Mon Sep 17 00:00:00 2001
From: Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>
Date: Tue, 3 Dec 2019 12:41:39 +0100
Subject: Fix menu open

---
 components/PostLink.vue              |  2 +-
 components/PostList/PurePostList.vue |  4 ++--
 components/TheHeader.vue             | 21 ++++++++++++++-------
 3 files changed, 17 insertions(+), 10 deletions(-)

(limited to 'components/TheHeader.vue')

diff --git a/components/PostLink.vue b/components/PostLink.vue
index 2dc3dd9..54cd934 100644
--- a/components/PostLink.vue
+++ b/components/PostLink.vue
@@ -40,7 +40,7 @@ export default {
   margin: 20px;
   flex-basis: 410px;
   max-width: 410px;
-  height: 250px;
+  /* height: 250px; */
   box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.25);
   background: #ffffff;
   text-align: left;
diff --git a/components/PostList/PurePostList.vue b/components/PostList/PurePostList.vue
index 07883ad..ace069f 100644
--- a/components/PostList/PurePostList.vue
+++ b/components/PostList/PurePostList.vue
@@ -49,7 +49,7 @@ export default {
 .post-list-container {
   display: flex;
   flex-wrap: wrap;
-  justify-content: initial;
+  justify-content: center;
 }
 
 @keyframes loading {
@@ -88,4 +88,4 @@ export default {
 .fade-in-enter-active {
   animation: fade-in 0.3s reverse;
 }
-</style>
\ No newline at end of file
+</style>
diff --git a/components/TheHeader.vue b/components/TheHeader.vue
index 431b945..4d17616 100644
--- a/components/TheHeader.vue
+++ b/components/TheHeader.vue
@@ -1,14 +1,21 @@
 <template>
-  <nav class="navbar" :class="{'menu-open': isMenuCollapsed}">
+  <nav class="navbar" :class="{ 'menu-open': showMenu }">
     <div class="title">
       <img v-if="logo" class="logo" :src="logo" alt="ZHR" />
-      <nuxt-link class="title-name" :class="{margin: logo}" to="/">{{ title }}</nuxt-link>
+      <nuxt-link class="title-name" :class="{ margin: logo }" to="/">{{
+        title
+      }}</nuxt-link>
     </div>
     <div class="space"></div>
     <button @click="toggleMenu" class="menu-toggler">Menu</button>
-    <ul class="links" :class="{show: this.isMenuCollapsed}" @click="toggleMenu">
+    <ul class="links" :class="{ show: this.showMenu }" @click="toggleMenu">
       <!-- Loop for generating links -->
-      <nav-link v-for="route in routes" :key="route.path" :link="route.path" :name="route.name" />
+      <nav-link
+        v-for="route in routes"
+        :key="route.path"
+        :link="route.path"
+        :name="route.name"
+      />
     </ul>
   </nav>
 </template>
@@ -38,12 +45,12 @@ export default {
   },
   data: function() {
     return {
-      isMenuCollapsed: true
+      showMenu: false
     }
   },
   methods: {
     toggleMenu() {
-      this.isMenuCollapsed = !this.isMenuCollapsed
+      this.showMenu = !this.showMenu
     }
   }
 }
@@ -180,4 +187,4 @@ export default {
     height: calc(100% - 80px);
   }
 }
-</style>
\ No newline at end of file
+</style>
-- 
cgit 1.4.1

