Add topics to mobile navigation
This commit is contained in:
parent
d39636f574
commit
9e3a7d1607
|
|
@ -64,7 +64,7 @@
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|
||||||
grid-template-columns: 1fr 50px;
|
grid-template-columns: 1fr 50px;
|
||||||
grid-template-rows: 50px 100px auto 100px;
|
grid-template-rows: 50px 200px auto 100px;
|
||||||
|
|
||||||
grid-template-areas: "m m" "m m" "s s";
|
grid-template-areas: "m m" "m m" "s s";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
<template>
|
||||||
|
<div class="mobile-subnavigation">
|
||||||
|
<h3 class="mobile-subnavigation__title">Themen</h3>
|
||||||
|
<book-topic-navigation :mobile="true"></book-topic-navigation>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import BookTopicNavigation from '@/components/book-navigation/BookTopicNavigation';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
BookTopicNavigation
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
@import "@/styles/_variables.scss";
|
||||||
|
@import "@/styles/_mixins.scss";
|
||||||
|
|
||||||
|
.mobile-subnavigation {
|
||||||
|
&__title {
|
||||||
|
@include small-text;
|
||||||
|
color: rgba($color-white, 0.6);
|
||||||
|
|
||||||
|
margin-bottom: $small-spacing;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,17 +1,31 @@
|
||||||
<template>
|
<template>
|
||||||
<nav class="top-navigation" :class="{'top-navigation--mobile': mobile}">
|
<nav class="top-navigation" :class="{'top-navigation--mobile': mobile}">
|
||||||
<router-link to="/book/topic/berufliche-grundbildung" active-class="top-navigation__link--active"
|
<div class="top-navigation__item">
|
||||||
:class="{'top-navigation__link--active': isActive('book')}"
|
<router-link to="/book/topic/berufliche-grundbildung" active-class="top-navigation__link--active"
|
||||||
class="top-navigation__link">Inhalte
|
:class="{'top-navigation__link--active': isActive('book')}"
|
||||||
</router-link>
|
class="top-navigation__link">Inhalte
|
||||||
<router-link to="/rooms" active-class="top-navigation__link--active" class="top-navigation__link">Räume
|
</router-link>
|
||||||
</router-link>
|
|
||||||
<router-link to="/portfolio" active-class="top-navigation__link--active" class="top-navigation__link">Portfolio
|
<mobile-subnavigation v-if="mobile"></mobile-subnavigation>
|
||||||
</router-link>
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="top-navigation__item">
|
||||||
|
<router-link to="/rooms" active-class="top-navigation__link--active" class="top-navigation__link">Räume
|
||||||
|
</router-link>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="top-navigation__item">
|
||||||
|
<router-link to="/portfolio" active-class="top-navigation__link--active" class="top-navigation__link">Portfolio
|
||||||
|
</router-link>
|
||||||
|
</div>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import MobileSubnavigation from '@/components/MobileSubnavigation';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
mobile: {
|
mobile: {
|
||||||
|
|
@ -19,6 +33,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
components: {
|
||||||
|
MobileSubnavigation
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
isActive(linkName) {
|
isActive(linkName) {
|
||||||
return linkName === 'book' && this.$route.path.indexOf('module') > -1;
|
return linkName === 'book' && this.$route.path.indexOf('module') > -1;
|
||||||
|
|
@ -52,13 +70,31 @@
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
#{$parent}__link {
|
#{$parent}__link {
|
||||||
color: rgba($color-white, 0.6);
|
color: $color-white;
|
||||||
@include heading-4;
|
@include heading-4;
|
||||||
line-height: 2em;
|
line-height: 2em;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: $medium-spacing;
|
||||||
|
|
||||||
&--active {
|
&:only-child {
|
||||||
color: $color-white;
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#{$parent}__item {
|
||||||
|
border-bottom: 1px solid $color-white;
|
||||||
|
|
||||||
|
&:nth-child(1) {
|
||||||
|
order: 3;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
&:nth-child(2) {
|
||||||
|
order: 1;
|
||||||
|
}
|
||||||
|
&:nth-child(3) {
|
||||||
|
order: 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<router-link :to="{name: 'topic', params: {topicSlug: topic.slug}}"
|
<router-link :to="{name: 'topic', params: {topicSlug: topic.slug}}"
|
||||||
tag="div"
|
tag="div"
|
||||||
class="book-topics__topic book-subnavigation__item"
|
class="book-topics__topic book-subnavigation__item"
|
||||||
:class="{'book-topics__topic--active': topic.active}"
|
:class="{'book-topics__topic--active': topic.active, 'book-subnavigation__item--mobile': mobile}"
|
||||||
v-for="topic in topics"
|
v-for="topic in topics"
|
||||||
:key="topic.id">
|
:key="topic.id">
|
||||||
{{topic.order}}.
|
{{topic.order}}.
|
||||||
|
|
@ -16,6 +16,12 @@
|
||||||
import ALL_TOPICS_QUERY from '@/graphql/gql/allTopicsQuery.gql';
|
import ALL_TOPICS_QUERY from '@/graphql/gql/allTopicsQuery.gql';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
props: {
|
||||||
|
mobile: {
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
topics: [
|
topics: [
|
||||||
|
|
|
||||||
|
|
@ -49,12 +49,16 @@
|
||||||
|
|
||||||
.book-subnavigation {
|
.book-subnavigation {
|
||||||
&__item {
|
&__item {
|
||||||
font-family: $sans-serif-font-family;
|
@include small-text;
|
||||||
font-size: toRem(14px);
|
margin-bottom: $small-spacing;
|
||||||
margin-bottom: $medium-spacing;
|
|
||||||
color: $color-silver-dark;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
color: $color-silver-dark;
|
||||||
|
|
||||||
|
&--mobile {
|
||||||
|
color: $color-white;
|
||||||
|
}
|
||||||
|
|
||||||
&:last-of-type {
|
&:last-of-type {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue