@@ -3,6 +3,21 @@ import AppFooter from "@/components/AppFooter.vue";
33import GlobalTaskProgressBar from " @/components/GlobalTaskProgressBar.vue" ;
44import Logout from " @/components/Logout.vue" ;
55import NavBar from " @/components/NavBar.vue" ;
6+ import { useMediaQuery } from " @vueuse/core" ;
7+ import { ref , watch } from " vue" ;
8+
9+ const isMenuOpen = ref (false );
10+ const isMobile = useMediaQuery (" (max-width: 768px)" );
11+
12+ watch (isMobile , value => {
13+ if (! value ) {
14+ isMenuOpen .value = false ;
15+ }
16+ });
17+
18+ const toggleMenu = () => {
19+ isMenuOpen .value = ! isMenuOpen .value ;
20+ };
621 </script >
722
823<template >
@@ -13,17 +28,33 @@ import NavBar from "@/components/NavBar.vue";
1328 <div class =" brand-icon" >
1429 <img src =" @/assets/logo.png" alt =" " />
1530 </div >
16- <h1 class =" brand-title" >GPT Load</h1 >
31+ <h1 v-if = " !isMobile " class =" brand-title" >GPT Load</h1 >
1732 </div >
1833
19- <nav-bar class =" header-nav" />
34+ <nav v-if =" !isMobile" class =" header-nav" >
35+ <nav-bar />
36+ </nav >
2037
2138 <div class =" header-actions" >
22- <logout />
39+ <logout v-if =" !isMobile" />
40+ <n-button v-else text @click =" toggleMenu" >
41+ <svg viewBox =" 0 0 24 24" width =" 24" height =" 24" >
42+ <path fill =" currentColor" d =" M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z" />
43+ </svg >
44+ </n-button >
2345 </div >
2446 </div >
2547 </n-layout-header >
2648
49+ <n-drawer v-model:show =" isMenuOpen" :width =" 240" placement =" right" >
50+ <n-drawer-content title =" GPT Load" body-content-style =" padding: 0;" >
51+ <nav-bar mode =" vertical" @close =" isMenuOpen = false" />
52+ <div class =" mobile-actions" >
53+ <logout />
54+ </div >
55+ </n-drawer-content >
56+ </n-drawer >
57+
2758 <n-layout-content class =" layout-content" >
2859 <div class =" content-wrapper" >
2960 <router-view v-slot =" { Component }" >
@@ -56,14 +87,14 @@ import NavBar from "@/components/NavBar.vue";
5687 position : sticky ;
5788 top : 0 ;
5889 z-index : 100 ;
59- padding : 0 24 px ;
90+ padding : 0 12 px ;
6091}
6192
6293.header-content {
6394 display : flex ;
6495 align-items : center ;
6596 justify-content : space-between ;
66- padding : 8px ;
97+ padding : 8px 0 ;
6798 overflow-x : auto ;
6899 max-width : 1200px ;
69100 margin : 0 auto ;
@@ -101,6 +132,13 @@ import NavBar from "@/components/NavBar.vue";
101132
102133.header-actions {
103134 flex-shrink : 0 ;
135+ display : flex ;
136+ align-items : center ;
137+ }
138+
139+ .mobile-actions {
140+ padding : 12px ;
141+ border-top : 1px solid rgba (0 , 0 , 0 , 0.08 );
104142}
105143
106144.layout-content {
@@ -113,7 +151,7 @@ import NavBar from "@/components/NavBar.vue";
113151}
114152
115153.content-wrapper {
116- padding : 24 px 12 px ;
154+ padding : 16 px ;
117155 min-height : calc (100vh - 111px );
118156}
119157
0 commit comments