Skip to content

Commit a8a2cb2

Browse files
CopilotFenjuFu
andauthored
Improve mobile responsive adaptation (#7)
* Initial plan * initial plan Co-authored-by: FenjuFu <92919259+FenjuFu@users.noreply.github.com> * improve mobile responsive adaptation for hero, carousel, and chat assistant Co-authored-by: FenjuFu <92919259+FenjuFu@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: FenjuFu <92919259+FenjuFu@users.noreply.github.com>
1 parent 12793ba commit a8a2cb2

File tree

4 files changed

+296
-264
lines changed

4 files changed

+296
-264
lines changed

docs/.vitepress/theme/components/HeroCarousel.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,16 @@ onUnmounted(() => {
160160
.carousel-fade-leave-to {
161161
opacity: 0;
162162
}
163+
164+
@media (max-width: 768px) {
165+
.carousel-link {
166+
right: 0;
167+
font-size: 12px;
168+
top: -2px;
169+
}
170+
171+
.carousel-stage {
172+
padding-top: 8px;
173+
}
174+
}
163175
</style>

docs/.vitepress/theme/components/LearningAssistant.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,22 @@ const sendMessage = async () => {
173173
right: 16px;
174174
z-index: 1000;
175175
}
176-
176+
177+
.chat-toggle {
178+
width: 48px;
179+
height: 48px;
180+
font-size: 24px;
181+
}
182+
177183
.chat-window {
178-
width: calc(100vw - 32px);
184+
position: fixed;
185+
bottom: 0;
186+
right: 0;
187+
width: 100vw;
179188
max-width: none;
180-
height: 450px;
181-
max-height: calc(100vh - 100px);
189+
height: 70vh;
190+
max-height: calc(100vh - 60px);
191+
border-radius: 16px 16px 0 0;
182192
}
183193
}
184194

docs/.vitepress/theme/index.css

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,45 +82,60 @@
8282
/* 首页 hero 区域适配 */
8383
.VPHero {
8484
padding-top: 48px !important;
85-
padding-bottom: 48px !important;
85+
padding-bottom: 32px !important;
8686
}
87-
87+
88+
/* 缩小移动端 hero 图片区域,避免图片占据过多屏幕空间 */
89+
.VPHero .image {
90+
margin: -40px -24px -36px !important;
91+
}
92+
93+
.VPHero .image-container {
94+
width: 200px !important;
95+
height: 200px !important;
96+
}
97+
98+
.VPHero .image-bg {
99+
width: 140px !important;
100+
height: 140px !important;
101+
}
102+
88103
.VPHero .name {
89-
font-size: 36px !important;
104+
font-size: 32px !important;
90105
line-height: 1.2 !important;
91106
}
92107

93108
.VPHero .text {
94-
font-size: 24px !important;
109+
font-size: 22px !important;
95110
line-height: 1.3 !important;
96111
}
97112

98113
.VPHero .tagline {
99-
font-size: 15px !important;
114+
font-size: 14px !important;
100115
line-height: 1.5 !important;
101-
margin-top: 16px !important;
116+
margin-top: 12px !important;
102117
padding: 0 12px !important;
103118
}
104-
119+
105120
.VPHero .actions {
106121
display: flex !important;
107122
flex-direction: column !important;
108-
gap: 16px !important;
123+
gap: 12px !important;
109124
padding: 0 24px !important;
110-
margin-top: 24px !important;
125+
margin-top: 20px !important;
111126
}
112-
127+
113128
.VPHero .action {
114129
margin: 0 !important;
115130
width: 100% !important;
116131
}
117-
132+
118133
.VPHero .VPButton {
119134
width: 100% !important;
120135
display: flex !important;
121136
justify-content: center !important;
122-
padding: 12px 24px !important;
123-
font-size: 16px !important;
137+
padding: 10px 20px !important;
138+
font-size: 15px !important;
124139
height: auto !important;
125140
line-height: 1.5 !important;
126141
}

0 commit comments

Comments
 (0)