Skip to content

Commit e3212a5

Browse files
committed
improve mobile user experience
Signed-off-by: zhangtianli2006 <zhangtianli2006@163.com>
1 parent c08c486 commit e3212a5

File tree

4 files changed

+55
-11
lines changed

4 files changed

+55
-11
lines changed

src/components/page/navbar.vue

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,17 @@
1111
text-color="#fff"
1212
active-text-color="rgb(233, 233, 235)"
1313
>
14-
<el-menu-item index=""><img src="./../../assets/icon/SOJ-thick-white.png" style="height: 40px;" /></el-menu-item>
15-
<el-menu-item index="/"><i class="el-icon-s-home" /> Home</el-menu-item>
16-
<el-menu-item index="/problem/list"><i class="el-icon-s-order" />Problem List</el-menu-item>
14+
<el-menu-item index="" @click="$router.push('/')">
15+
<img src="./../../assets/icon/SOJ-thick-white.png" style="height: 40px;" />
16+
</el-menu-item>
17+
<el-menu-item index="/" class="webkit-box">
18+
<i class="el-icon-s-home" />
19+
<div class="lable"> Home</div>
20+
</el-menu-item>
21+
<el-menu-item index="/problem/list" class="webkit-box">
22+
<i class="el-icon-s-order" />
23+
<div class="lable"> Problem List</div>
24+
</el-menu-item>
1725
<el-submenu index="2" id="user">
1826
<template slot="title">
1927
<el-avatar shape="square">
@@ -53,7 +61,13 @@ export default {
5361
};
5462
</script>
5563

56-
<style lang="css" scoped>
64+
<style scoped>
65+
@media only screen and (max-width: 500px) {
66+
.lable {
67+
display: none;
68+
}
69+
}
70+
5771
#nav {
5872
z-index: 1000;
5973
background-color: #545c64;
@@ -81,4 +95,8 @@ export default {
8195
#user_icon {
8296
height: 50%;
8397
}
98+
99+
.webkit-box {
100+
display: -webkit-box;
101+
}
84102
</style>

src/components/problem/content.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<el-menu-item index="2-2">Settings</el-menu-item>
4444
</el-submenu>
4545
</el-menu>
46-
<el-button @click="$router.push('/problem/list');" class="margin-top">Back</el-button>
46+
<el-button @click="$router.push('/problem/list');" class="margin-top-small">Back</el-button>
4747
</el-card>
4848
</div>
4949
<div id="info">
@@ -197,10 +197,14 @@ export default {
197197
right: 30px;
198198
}
199199
200-
#pannel:hover {
200+
#pannel:active {
201201
z-index: 1000;
202202
opacity: 1;
203203
}
204+
205+
#info {
206+
display: none;
207+
}
204208
}
205209
206210
.el-menu {
@@ -255,7 +259,7 @@ export default {
255259
color: #606266;
256260
}
257261
258-
.margin-top {
262+
.margin-top-small {
259263
margin-top: 10px;
260264
}
261265
</style>

src/components/user/content.vue

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<template>
22
<div id="user-content">
3-
<div>
3+
<div id="tool">
44
<el-card shadow="never">
5-
<el-avatar shape="square" :size="400"><img src="./../../assets/icon/SOJ-thick-white-background.png" /></el-avatar>
5+
<el-avatar shape="square" :size="this.avatarWidth">
6+
<img src="./../../assets/icon/SOJ-thick-white-background.png" />
7+
</el-avatar>
68
</el-card>
79
<el-card class="item">
810
<el-button v-if="ismine" type="primary" @click="$router.push('/account/' + $route.params.id + '/edit');">Edit</el-button>
@@ -101,7 +103,8 @@ export default {
101103
userLoading: true,
102104
isRoot: false,
103105
isStaff: false,
104-
isActive: true
106+
isActive: true,
107+
avatarWidth: 440 < screen.width ? 400 : screen.width - 40
105108
};
106109
},
107110
methods: {
@@ -173,4 +176,16 @@ export default {
173176
#user-content {
174177
display: flex;
175178
}
179+
180+
@media only screen and (max-width: 800px) {
181+
#user-content {
182+
display: inline;
183+
}
184+
185+
#info {
186+
margin-left: 0px;
187+
margin-top: 20px;
188+
max-width: 100vw;
189+
}
190+
}
176191
</style>

src/components/user/login.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
<template>
22
<div>
3-
<el-dialog title="Login" :visible.sync="$store.state.user.showlogin" :destroy-on-close="true" :close-on-click-modal="false" width="500px">
3+
<el-dialog
4+
title="Login"
5+
:visible.sync="$store.state.user.showlogin"
6+
:destroy-on-close="true"
7+
:close-on-click-modal="false"
8+
width="500px"
9+
class="max-screen"
10+
>
411
<el-form :model="ldata" ref="loginForm" :rules="rules">
512
<div class="icon-lable"><i class="el-icon-user" /> Username</div>
613
<el-form-item prop="username">

0 commit comments

Comments
 (0)