diff --git a/app/components/TopMenu.vue b/app/components/TopMenu.vue index 2e7a445..589aab3 100644 --- a/app/components/TopMenu.vue +++ b/app/components/TopMenu.vue @@ -47,17 +47,16 @@ > @@ -147,6 +201,20 @@ topmenus.forEach((topmenu) => { }); const leftmenu = $filter(topmenus, { category: "topmenu", classify: "left" }); + +const splitMenu = computed(() => { + let cutoffIdx = 0; + if ($store.viewport < 1 || $store.viewport > 3) return [leftmenu]; + if ($store.viewport === 3) cutoffIdx = 8; + if ($store.viewport === 2) cutoffIdx = 5; + if ($store.viewport === 1) cutoffIdx = 3; + + return [leftmenu.slice(0, cutoffIdx), leftmenu.slice(cutoffIdx)]; +}); + +const leftmenuVisible = computed(() => splitMenu.value[0]); +const leftmenuHidden = computed(() => splitMenu.value[1]); + const currentTab = ref(leftmenu[0]); const subTab = ref(); const tabConfig = $find(topmenus, { code: "configuration" }); @@ -187,8 +255,8 @@ function changeTab(tab, subtab) { function openProfile() { $store.commit("showmodal", { component: "user/Profile", - width: "1100px", - height: "360px", + width: "1000px", + height: "auto", title: $store.lang === "vi" ? "Thông tin cá nhân" : "User profile", }); } @@ -241,7 +309,8 @@ a[class^="navbar"] { } } -@media screen and (max-width: 1023px) { +/* follow $navbar-breakpoint */ +@media screen and (max-width: 500px) { .navbar-brand { margin-right: 0 !important; } diff --git a/app/layouts/default.vue b/app/layouts/default.vue index 6cbf659..9f04db9 100644 --- a/app/layouts/default.vue +++ b/app/layouts/default.vue @@ -35,7 +35,9 @@ function getViewport() { const width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; // Follow Bulma's breakpoints: https://bulma.io/documentation/start/responsiveness/#breakpoints - if (width <= 768) + if (width <= 500) + viewport = 0; // custom + else if (width <= 768) viewport = 1; // mobile else if (width <= 1023) viewport = 2; // tablet diff --git a/app/stores/index.js b/app/stores/index.js index 74d03ca..089e8c8 100644 --- a/app/stores/index.js +++ b/app/stores/index.js @@ -10,6 +10,7 @@ export const useStore = defineStore("erp-dev", { snackbar: null, settings: [], lang: "vi", + tabinfo: {}, // set by api-loader common: null, tablesetting: null, diff --git a/my-bulma-project.css b/my-bulma-project.css index cf6d44f..856471a 100644 --- a/my-bulma-project.css +++ b/my-bulma-project.css @@ -11635,7 +11635,7 @@ a.navbar-item.is-active, a.navbar-item.is-selected, margin: 0.5rem 0; } -@media screen and (max-width: 1199px) { +@media screen and (max-width: 499px) { .navbar > .container { display: block; } @@ -11684,7 +11684,7 @@ a.navbar-item.is-active, a.navbar-item.is-selected, padding-bottom: var(--bulma-navbar-height); } } -@media screen and (min-width: 1200px) { +@media screen and (min-width: 500px) { .navbar, .navbar-menu, .navbar-start, diff --git a/my-bulma-project.scss b/my-bulma-project.scss index dcdb7e4..acec7d6 100644 --- a/my-bulma-project.scss +++ b/my-bulma-project.scss @@ -13,7 +13,7 @@ $grey: #69748c; @use "bulma/sass" with ( $family-primary: string.unquote("'Inter', 'SF Pro', 'Helvetica', 'Arial', sans-serif"), $family-monospace: string.unquote("'Roboto Mono', monospace"), - $navbar-breakpoint: 1200px, + $navbar-breakpoint: 500px, $primary: $blue, $link: $blue, $info: $cyan,