From 9507cbcc719592522866c262c6368ffa2ee279f2 Mon Sep 17 00:00:00 2001 From: ekko <152005280+EKKOLearnAI@users.noreply.github.com> Date: Sat, 9 May 2026 08:43:05 +0800 Subject: [PATCH] fix(website): improve mobile responsiveness (#554) --- .../src/components/docs/DocContent.vue | 20 +++++ .../src/components/landing/HeroSection.vue | 13 ++++ .../src/components/landing/InstallSection.vue | 7 ++ .../components/landing/PlatformsSection.vue | 23 ++++++ .../components/landing/ScreenshotsSection.vue | 6 ++ .../components/landing/StarHistorySection.vue | 4 + .../src/components/layout/SiteHeader.vue | 53 +++++++++++++- packages/website/src/views/DocsView.vue | 73 ++++++++++++++++++- 8 files changed, 196 insertions(+), 3 deletions(-) diff --git a/packages/website/src/components/docs/DocContent.vue b/packages/website/src/components/docs/DocContent.vue index 2be3b75..7a2e79a 100644 --- a/packages/website/src/components/docs/DocContent.vue +++ b/packages/website/src/components/docs/DocContent.vue @@ -119,6 +119,20 @@ const sections = computed(() => { color: var(--text-secondary); vertical-align: top; } + + @media (max-width: $breakpoint-mobile) { + display: block; + + tr { + display: block; + padding: 10px 0; + } + + td { + display: block; + padding: 2px 0; + } + } } .doc-table-key { @@ -132,5 +146,11 @@ const sections = computed(() => { border-radius: 4px; font-size: 13px; } + + @media (max-width: $breakpoint-mobile) { + white-space: normal; + width: auto; + margin-bottom: 4px; + } } diff --git a/packages/website/src/components/landing/HeroSection.vue b/packages/website/src/components/landing/HeroSection.vue index b404488..09ccf00 100644 --- a/packages/website/src/components/landing/HeroSection.vue +++ b/packages/website/src/components/landing/HeroSection.vue @@ -267,11 +267,24 @@ onMounted(() => { border: 1px solid var(--border-color); border-radius: $radius-md; padding: 12px 20px; + max-width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; code { font-size: 14px; background: transparent; padding: 0; + white-space: nowrap; + } + + @media (max-width: $breakpoint-mobile) { + padding: 10px 14px; + gap: 8px; + + code { + font-size: 12px; + } } } diff --git a/packages/website/src/components/landing/InstallSection.vue b/packages/website/src/components/landing/InstallSection.vue index 50ca432..d91dcc7 100644 --- a/packages/website/src/components/landing/InstallSection.vue +++ b/packages/website/src/components/landing/InstallSection.vue @@ -62,6 +62,10 @@ function copyText(text: string) { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: $radius-lg; + + @media (max-width: $breakpoint-mobile) { + padding: 24px 16px; + } } .panel-title { @@ -118,6 +122,8 @@ function copyText(text: string) { margin-bottom: 8px; cursor: pointer; transition: border-color $transition-fast; + overflow-x: auto; + -webkit-overflow-scrolling: touch; &:hover { border-color: var(--text-muted); @@ -127,6 +133,7 @@ function copyText(text: string) { font-size: 14px; background: transparent; padding: 0; + white-space: nowrap; } } diff --git a/packages/website/src/components/landing/PlatformsSection.vue b/packages/website/src/components/landing/PlatformsSection.vue index 9cffbeb..7352e97 100644 --- a/packages/website/src/components/landing/PlatformsSection.vue +++ b/packages/website/src/components/landing/PlatformsSection.vue @@ -56,6 +56,10 @@ const platforms = [ flex-wrap: wrap; justify-content: center; gap: 24px; + + @media (max-width: $breakpoint-mobile) { + gap: 16px; + } } .platform-item { @@ -64,6 +68,11 @@ const platforms = [ align-items: center; gap: 10px; width: 120px; + + @media (max-width: $breakpoint-mobile) { + width: 80px; + gap: 6px; + } } .platform-icon { @@ -86,11 +95,25 @@ const platforms = [ width: 24px; height: 24px; } + + @media (max-width: $breakpoint-mobile) { + width: 44px; + height: 44px; + + svg { + width: 20px; + height: 20px; + } + } } .platform-name { font-size: 13px; color: var(--text-secondary); text-align: center; + + @media (max-width: $breakpoint-mobile) { + font-size: 12px; + } } diff --git a/packages/website/src/components/landing/ScreenshotsSection.vue b/packages/website/src/components/landing/ScreenshotsSection.vue index 22ab6f3..772c2ea 100644 --- a/packages/website/src/components/landing/ScreenshotsSection.vue +++ b/packages/website/src/components/landing/ScreenshotsSection.vue @@ -98,6 +98,12 @@ onUnmounted(() => { padding: 0 24px; margin-top: 48px; margin-bottom: 24px; + + @media (max-width: $breakpoint-mobile) { + padding: 0 12px; + margin-top: 32px; + margin-bottom: 16px; + } } .screenshots-inner { diff --git a/packages/website/src/components/landing/StarHistorySection.vue b/packages/website/src/components/landing/StarHistorySection.vue index 79dcb52..5fe36cc 100644 --- a/packages/website/src/components/landing/StarHistorySection.vue +++ b/packages/website/src/components/landing/StarHistorySection.vue @@ -80,6 +80,10 @@ onMounted(async () => { border-radius: $radius-lg; display: flex; flex-direction: column; + + @media (max-width: $breakpoint-mobile) { + padding: 24px 16px; + } } .panel-title { diff --git a/packages/website/src/components/layout/SiteHeader.vue b/packages/website/src/components/layout/SiteHeader.vue index 19af49e..ad7451c 100644 --- a/packages/website/src/components/layout/SiteHeader.vue +++ b/packages/website/src/components/layout/SiteHeader.vue @@ -86,8 +86,31 @@ function goHome() { {{ t('nav.docs') }} {{ t('nav.github') }}
- - + +
@@ -245,6 +268,32 @@ function goHome() { padding-top: 12px; } +.mobile-action-btn { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 8px 14px; + border: 1px solid var(--border-color); + border-radius: $radius-sm; + background: transparent; + color: var(--text-secondary); + font-size: 14px; + font-weight: 500; + cursor: pointer; + transition: all $transition-fast; + + &:active { + background: var(--bg-secondary); + color: var(--text-primary); + } +} + +.action-icon { + width: 16px; + height: 16px; + flex-shrink: 0; +} + @media (max-width: $breakpoint-mobile) { .header-nav { display: none; diff --git a/packages/website/src/views/DocsView.vue b/packages/website/src/views/DocsView.vue index 77c68d5..dfbb263 100644 --- a/packages/website/src/views/DocsView.vue +++ b/packages/website/src/views/DocsView.vue @@ -1,15 +1,41 @@