Add topics to mobile navigation
This commit is contained in:
parent
d39636f574
commit
9e3a7d1607
|
|
@ -64,7 +64,7 @@
|
|||
display: grid;
|
||||
|
||||
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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
<nav class="top-navigation" :class="{'top-navigation--mobile': mobile}">
|
||||
<router-link to="/book/topic/berufliche-grundbildung" active-class="top-navigation__link--active"
|
||||
:class="{'top-navigation__link--active': isActive('book')}"
|
||||
class="top-navigation__link">Inhalte
|
||||
</router-link>
|
||||
<router-link to="/rooms" active-class="top-navigation__link--active" class="top-navigation__link">Räume
|
||||
</router-link>
|
||||
<router-link to="/portfolio" active-class="top-navigation__link--active" class="top-navigation__link">Portfolio
|
||||
</router-link>
|
||||
<div class="top-navigation__item">
|
||||
<router-link to="/book/topic/berufliche-grundbildung" active-class="top-navigation__link--active"
|
||||
:class="{'top-navigation__link--active': isActive('book')}"
|
||||
class="top-navigation__link">Inhalte
|
||||
</router-link>
|
||||
|
||||
<mobile-subnavigation v-if="mobile"></mobile-subnavigation>
|
||||
|
||||
</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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MobileSubnavigation from '@/components/MobileSubnavigation';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
mobile: {
|
||||
|
|
@ -19,6 +33,10 @@
|
|||
}
|
||||
},
|
||||
|
||||
components: {
|
||||
MobileSubnavigation
|
||||
},
|
||||
|
||||
methods: {
|
||||
isActive(linkName) {
|
||||
return linkName === 'book' && this.$route.path.indexOf('module') > -1;
|
||||
|
|
@ -52,13 +70,31 @@
|
|||
flex-direction: column;
|
||||
|
||||
#{$parent}__link {
|
||||
color: rgba($color-white, 0.6);
|
||||
color: $color-white;
|
||||
@include heading-4;
|
||||
line-height: 2em;
|
||||
padding: 0;
|
||||
display: block;
|
||||
margin-bottom: $medium-spacing;
|
||||
|
||||
&--active {
|
||||
color: $color-white;
|
||||
&:only-child {
|
||||
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}}"
|
||||
tag="div"
|
||||
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"
|
||||
:key="topic.id">
|
||||
{{topic.order}}.
|
||||
|
|
@ -16,6 +16,12 @@
|
|||
import ALL_TOPICS_QUERY from '@/graphql/gql/allTopicsQuery.gql';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
mobile: {
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
topics: [
|
||||
|
|
|
|||
|
|
@ -49,12 +49,16 @@
|
|||
|
||||
.book-subnavigation {
|
||||
&__item {
|
||||
font-family: $sans-serif-font-family;
|
||||
font-size: toRem(14px);
|
||||
margin-bottom: $medium-spacing;
|
||||
color: $color-silver-dark;
|
||||
@include small-text;
|
||||
margin-bottom: $small-spacing;
|
||||
cursor: pointer;
|
||||
|
||||
color: $color-silver-dark;
|
||||
|
||||
&--mobile {
|
||||
color: $color-white;
|
||||
}
|
||||
|
||||
&:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue