diff --git a/client/src/App.vue b/client/src/App.vue index b6fe73f8..5c2867a8 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -10,7 +10,7 @@ :is="showModal" v-if="showModal"/> - + @@ -21,7 +21,6 @@ import FullScreenLayout from '@/layouts/FullScreenLayout'; import PublicLayout from '@/layouts/PublicLayout'; import Modal from '@/components/Modal'; - import MobileNavigation from '@/components/book-navigation/MobileNavigation'; import NewContentBlockWizard from '@/components/content-block-form/NewContentBlockWizard'; import EditContentBlockWizard from '@/components/content-block-form/EditContentBlockWizard'; import NewRoomEntryWizard from '@/components/rooms/room-entries/NewRoomEntryWizard'; @@ -49,7 +48,6 @@ FullScreenLayout, PublicLayout, Modal, - MobileNavigation, NewContentBlockWizard, EditContentBlockWizard, NewRoomEntryWizard, diff --git a/client/src/components/HeaderBar.vue b/client/src/components/HeaderBar.vue index 2075da30..dde98b7a 100644 --- a/client/src/components/HeaderBar.vue +++ b/client/src/components/HeaderBar.vue @@ -1,16 +1,15 @@ diff --git a/client/src/components/book-navigation/BookTopicNavigation.vue b/client/src/components/book-navigation/BookTopicNavigation.vue index 10bc5cb1..2ddb547e 100644 --- a/client/src/components/book-navigation/BookTopicNavigation.vue +++ b/client/src/components/book-navigation/BookTopicNavigation.vue @@ -7,7 +7,7 @@ tag="div" class="book-topics__topic book-subnavigation__item" v-for="topic in topics" - @click.native="hideMobileNavigation"> + @click.native="closeSidebar('navigation')"> {{ topic.order }}. {{ topic.title }} @@ -16,6 +16,7 @@ - - diff --git a/client/src/components/book-navigation/MobileNavigation.vue b/client/src/components/book-navigation/NavigationSidebar.vue similarity index 70% rename from client/src/components/book-navigation/MobileNavigation.vue rename to client/src/components/book-navigation/NavigationSidebar.vue index b5e20715..1914d3ef 100644 --- a/client/src/components/book-navigation/MobileNavigation.vue +++ b/client/src/components/book-navigation/NavigationSidebar.vue @@ -1,12 +1,14 @@ @@ -15,9 +17,13 @@ import Cross from '@/components/icons/Cross'; import ContentNavigation from '@/components/book-navigation/ContentNavigation'; + import sidebarMixin from '@/mixins/sidebar'; + import {meQuery} from '@/graphql/queries'; export default { + mixins: [sidebarMixin], + components: { ContentNavigation, Cross @@ -30,8 +36,8 @@ }, methods: { - hideMobileNavigation() { - this.$store.dispatch('showMobileNavigation', false); + close() { + this.closeSidebar('navigation'); } }, @@ -45,7 +51,7 @@ @import "@/styles/_variables.scss"; @import "@/styles/_mixins.scss"; - .mobile-navigation { + .navigation-sidebar { position: fixed; left: 0; right: 0; @@ -54,6 +60,10 @@ background-color: white; z-index: 20; + @include desktop { + box-shadow: 0px 2px 9px rgba(0, 0, 0, 0.12); + } + display: grid; grid-template-columns: 1fr 50px; @@ -69,11 +79,10 @@ overflow-y: auto; @include desktop { - display: none; + width: 285px; } &__main { - background-color: $color-brand; padding: $medium-spacing; grid-area: m; } @@ -86,13 +95,7 @@ grid-column: 2; align-self: center; justify-self: center; - } - - &__close-icon { - width: 30px; - height: 30px; - opacity: 0.5; - fill: $color-white; + cursor: pointer; } } diff --git a/client/src/components/icons/Cross.vue b/client/src/components/icons/Cross.vue index 43422926..5bdc1eec 100644 --- a/client/src/components/icons/Cross.vue +++ b/client/src/components/icons/Cross.vue @@ -2,8 +2,16 @@ + class="cross"> + + diff --git a/client/src/components/modules/Module.vue b/client/src/components/modules/Module.vue index 89549c76..ebead69c 100644 --- a/client/src/components/modules/Module.vue +++ b/client/src/components/modules/Module.vue @@ -216,6 +216,7 @@ .module { display: flex; justify-self: center; + max-width: 100vw; @include desktop { width: 800px; diff --git a/client/src/components/profile/Avatar.vue b/client/src/components/profile/Avatar.vue index b4e68998..5bc8cb0f 100644 --- a/client/src/components/profile/Avatar.vue +++ b/client/src/components/profile/Avatar.vue @@ -69,7 +69,7 @@ this.$apollo.mutate({ mutation: TOGGLE_SIDEBAR, variables: { - open: false + profile: false } }) } @@ -124,8 +124,8 @@ height: 34px; display: block; left: 50%; - bottom: -7px; - transform: translateX(50%); + bottom: -3px; + transform: translateX(80%); background-color: $color-white; border-radius: 50%; padding: 6px; diff --git a/client/src/components/profile/ProfileSidebar.vue b/client/src/components/profile/ProfileSidebar.vue index a31e2095..aa728585 100644 --- a/client/src/components/profile/ProfileSidebar.vue +++ b/client/src/components/profile/ProfileSidebar.vue @@ -2,46 +2,52 @@
+ v-if="sidebar.profile"> + @click="close"> - -
- Meine Aktivitäten -
-
-

Klasse

- -
+
+ +
Klassenliste anzeigen + to="/me/activity" + class="profile-sidebar__link">Meine Aktivitäten +
-
- Zugangscode - eingeben - -
-
- +
+
+ +
+ Klassenliste + +
+
+
+
+ Zugangscode + +
+
+ +
-

- Supportanfragen: rahel.wenger@hep-verlag.ch -

+

+ Supportanfragen: rahel.wenger@hep-verlag.ch +

+
@@ -57,12 +63,19 @@ export default { mixins: [sidebarMixin], + components: { LogoutWidget, ClassSelectionWidget, ProfileWidget, Cross }, + + methods: { + close() { + this.closeSidebar('profile') + } + }, } @@ -90,10 +103,18 @@ display: flex; flex-direction: column; + justify-content: flex-start; + + &__section { + margin-bottom: $large-spacing; + + &:last-of-type { + margin-top: auto; + } + } &__item { - border-bottom: 1px solid $color-silver-light; - padding: $large-spacing $medium-spacing; + padding: $small-spacing $medium-spacing; } &__subtitle { @@ -114,13 +135,8 @@ cursor: pointer; } - &__close-icon { - width: 40px; - height: 40px; - } - &__support { - padding: $small-spacing; + padding: $medium-spacing; @include regular-text; color: $color-silver-dark; } diff --git a/client/src/components/profile/ProfileWidget.vue b/client/src/components/profile/ProfileWidget.vue index 30edecc2..88fff0b9 100644 --- a/client/src/components/profile/ProfileWidget.vue +++ b/client/src/components/profile/ProfileWidget.vue @@ -35,10 +35,10 @@ .profile-widget { display: flex; flex-direction: column; - align-items: center; + align-items: start; &__name { - @include heading-3; + @include heading-4; text-align: center; margin-bottom: $small-spacing; } @@ -47,8 +47,8 @@ display: flex; justify-content: center; margin-bottom: $medium-spacing; - width: 80px; - height: 80px; + width: 120px; + height: 120px; position: relative; } diff --git a/client/src/components/school-class/ClassSelectionWidget.vue b/client/src/components/school-class/ClassSelectionWidget.vue index 841b6003..16723f90 100644 --- a/client/src/components/school-class/ClassSelectionWidget.vue +++ b/client/src/components/school-class/ClassSelectionWidget.vue @@ -105,7 +105,6 @@ position: relative; cursor: pointer; margin-bottom: $medium-spacing; - border: 1px solid $color-silver; border-radius: 4px; &__popover { @@ -120,22 +119,22 @@ .selected-class { width: 100%; box-sizing: border-box; - padding: $small-spacing $medium-spacing; + padding: $small-spacing 0; display: flex; align-items: center; - justify-content: space-between; + justify-content: start; &__text { line-height: $large-spacing; - @include regular-text; - color: $color-silver-dark; + @include heading-4; + margin-right: $small-spacing; } &__dropdown-icon { width: 20px; height: 20px; - fill: $color-brand; + fill: $color-charcoal-dark; } } diff --git a/client/src/components/school-class/CurrentClass.vue b/client/src/components/school-class/CurrentClass.vue index c1cc9d3b..81669111 100644 --- a/client/src/components/school-class/CurrentClass.vue +++ b/client/src/components/school-class/CurrentClass.vue @@ -28,6 +28,5 @@ .current-class { line-height: $large-spacing; @include regular-text; - color: $color-silver-dark; } diff --git a/client/src/graphql/client.js b/client/src/graphql/client.js index 45a6838d..af3c7316 100644 --- a/client/src/graphql/client.js +++ b/client/src/graphql/client.js @@ -17,7 +17,8 @@ const writeLocalCache = cache => { }, sidebar: { __typename: 'Sidebar', - open: false + profile: false, + navigation: false }, helloEmail: { __typename: 'HelloEmail', diff --git a/client/src/graphql/gql/local/mutations/toggleSidebar.gql b/client/src/graphql/gql/local/mutations/toggleSidebar.gql index fc32729e..c05a9221 100644 --- a/client/src/graphql/gql/local/mutations/toggleSidebar.gql +++ b/client/src/graphql/gql/local/mutations/toggleSidebar.gql @@ -1,3 +1,3 @@ -mutation($open: Boolean!) { - toggleSidebar(open: $open) @client +mutation($sidebar: SidebarInput!) { + toggleSidebar(sidebar: $sidebar) @client } diff --git a/client/src/graphql/gql/local/sidebar.gql b/client/src/graphql/gql/local/sidebar.gql index 4cdb1bc6..8526d5d1 100644 --- a/client/src/graphql/gql/local/sidebar.gql +++ b/client/src/graphql/gql/local/sidebar.gql @@ -1,5 +1,6 @@ query Sidebar { sidebar @client { - open + profile + navigation } } diff --git a/client/src/graphql/resolvers.js b/client/src/graphql/resolvers.js index 11cd35eb..2dd4abeb 100644 --- a/client/src/graphql/resolvers.js +++ b/client/src/graphql/resolvers.js @@ -16,9 +16,14 @@ export const resolvers = { cache.writeQuery({query: HELLO_EMAIL, data}); return data.helloEmail; }, - toggleSidebar: (_, {open}, {cache}) => { + toggleSidebar: (_, {sidebar: {profile, navigation}}, {cache}) => { const data = cache.readQuery({query: SIDEBAR}); - data.sidebar.open = open; + if (typeof profile !== 'undefined') { + data.sidebar.profile = profile; + } + if (typeof navigation !== 'undefined') { + data.sidebar.navigation = navigation; + } cache.writeQuery({query: SIDEBAR, data}); return data.sidebar; } diff --git a/client/src/graphql/typedefs.js b/client/src/graphql/typedefs.js index c17dd4a3..4f7c8552 100644 --- a/client/src/graphql/typedefs.js +++ b/client/src/graphql/typedefs.js @@ -1,6 +1,11 @@ import gql from 'graphql-tag'; export const typeDefs = gql` + type SidebarInput { + navigation: Boolean + profile: Boolean + } + type ScrollPosition { scrollTo: String! } @@ -9,16 +14,14 @@ export const typeDefs = gql` email: String! } - type Sidebar { - open: Boolean! + navigation: Boolean + profile: Boolean } type Mutation { scrollTo(scrollTo: String!): ScrollPosition - } - - type Mutation { helloEmail(email: String!): HelloEmail + toggleSidebar(sidebar: SidebarInput!): Sidebar } `; diff --git a/client/src/layouts/BlankLayout.vue b/client/src/layouts/BlankLayout.vue index a050d6f9..b819cf6a 100644 --- a/client/src/layouts/BlankLayout.vue +++ b/client/src/layouts/BlankLayout.vue @@ -1,6 +1,7 @@ @@ -16,8 +17,12 @@ diff --git a/client/src/layouts/DefaultFooter.vue b/client/src/layouts/DefaultFooter.vue index 0b2a693b..f8510b5e 100644 --- a/client/src/layouts/DefaultFooter.vue +++ b/client/src/layouts/DefaultFooter.vue @@ -68,6 +68,8 @@ .default-footer { background-color: $color-silver-light; + max-width: 100vw; + overflow: hidden; &__section { width: 100%; @@ -77,7 +79,8 @@ } &__info { - width: $footer-width; + width: 100%; + max-width: $footer-width; padding: 2*$large-spacing 0; display: flex; justify-content: space-between; @@ -98,7 +101,8 @@ } &__links { - width: $footer-width; + width: 100%; + max-width: $footer-width; padding: $large-spacing 0; } diff --git a/client/src/layouts/DefaultLayout.vue b/client/src/layouts/DefaultLayout.vue index 2400094a..fc3a7e9f 100644 --- a/client/src/layouts/DefaultLayout.vue +++ b/client/src/layouts/DefaultLayout.vue @@ -2,13 +2,10 @@
+ - -
@@ -19,12 +16,14 @@ import MobileHeader from '@/components/MobileHeader'; import ProfileSidebar from '@/components/profile/ProfileSidebar'; import DefaultFooter from '@/layouts/DefaultFooter'; + import NavigationSidebar from '@/components/book-navigation/NavigationSidebar'; export default { components: { HeaderBar, MobileHeader, ProfileSidebar, + NavigationSidebar, DefaultFooter }, diff --git a/client/src/layouts/FullScreenLayout.vue b/client/src/layouts/FullScreenLayout.vue index beff442f..284ff8fd 100644 --- a/client/src/layouts/FullScreenLayout.vue +++ b/client/src/layouts/FullScreenLayout.vue @@ -45,11 +45,6 @@ display:flex; justify-content:end; - - &__icon { - width: 40px; - height: 40px; - } } diff --git a/client/src/layouts/SimpleLayout.vue b/client/src/layouts/SimpleLayout.vue index 7cf00234..6c8e7744 100644 --- a/client/src/layouts/SimpleLayout.vue +++ b/client/src/layouts/SimpleLayout.vue @@ -71,10 +71,5 @@ margin-right: $medium-spacing; margin-top: $medium-spacing; } - - &__icon { - width: 40px; - height: 40px; - } } diff --git a/client/src/mixins/open-sidebar.js b/client/src/mixins/open-sidebar.js index ffaba465..dbe423d0 100644 --- a/client/src/mixins/open-sidebar.js +++ b/client/src/mixins/open-sidebar.js @@ -2,12 +2,14 @@ import TOGGLE_SIDEBAR from '@/graphql/gql/local/mutations/toggleSidebar.gql'; export default { methods: { - openSidebar() { + openSidebar(type) { this.$nextTick(() => { // we don't want this to happen instantly, only almost instantly. Otherwise the click-outside-directive won't work this.$apollo.mutate({ mutation: TOGGLE_SIDEBAR, variables: { - open: true + sidebar: { + [type]: true + } } }); }); diff --git a/client/src/mixins/sidebar.js b/client/src/mixins/sidebar.js index 17c66a8e..796a045d 100644 --- a/client/src/mixins/sidebar.js +++ b/client/src/mixins/sidebar.js @@ -3,12 +3,14 @@ import TOGGLE_SIDEBAR from '@/graphql/gql/local/mutations/toggleSidebar.gql'; export default { methods: { - closeSidebar() { - if (this.sidebar.open) { + closeSidebar(type) { + if (this.sidebar[type]) { this.$apollo.mutate({ mutation: TOGGLE_SIDEBAR, variables: { - open: false + sidebar: { + [type]: false + } } }); } @@ -23,7 +25,8 @@ export default { data: () => ({ sidebar: { - open: false + profile: false, + navigation: false } }) } diff --git a/client/src/pages/start.vue b/client/src/pages/start.vue index fc49244f..328d1ce7 100644 --- a/client/src/pages/start.vue +++ b/client/src/pages/start.vue @@ -2,8 +2,6 @@
- -