Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(site): 彻底解决移动端横向溢出与右侧裁剪问题

tianma-ifaea8e4824c1a
diff --git a/apps/site/src/components/hero.astro b/apps/site/src/components/hero.astro
index 904afe22..706860e0 100644
--- a/apps/site/src/components/hero.astro
+++ b/apps/site/src/components/hero.astro
@@ -12,35 +12,35 @@ const copy = siteCopy[locale].hero;
const agentPromptText = copy.agentPromptText;
---
-<main class="relative grid gap-8 lg:gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(440px,1.1fr)] place-items-center pt-4 pb-10 md:pt-10 md:pb-16 overflow-hidden px-4 md:px-0">
- <!-- Animated Background Orbs -->
- <div class="absolute top-0 left-1/4 w-[320px] md:w-[450px] h-[320px] md:h-[450px] bg-brand/10 rounded-full blur-3xl animate-slow-spin pointer-events-none"></div>
- <div class="absolute bottom-0 right-1/4 w-[280px] md:w-[380px] h-[280px] md:h-[380px] bg-emerald-400/10 rounded-full blur-3xl animate-float pointer-events-none"></div>
-
- <!-- Magic UI Meteors -->
- <Meteors number={16} client:load />
+<main class="relative grid gap-8 lg:gap-10 lg:grid-cols-2 place-items-center pt-4 pb-10 md:pt-10 md:pb-16 overflow-hidden max-w-full">
+ <!-- Background Glow Orbs & Meteors Container (strictly overflow-hidden) -->
+ <div class="absolute inset-0 overflow-hidden pointer-events-none z-0">
+ <div class="absolute top-0 left-1/4 w-[280px] sm:w-[450px] h-[280px] sm:h-[450px] bg-brand/10 rounded-full blur-3xl animate-slow-spin"></div>
+ <div class="absolute bottom-0 right-1/4 w-[240px] sm:w-[380px] h-[240px] sm:h-[380px] bg-emerald-400/10 rounded-full blur-3xl animate-float"></div>
+ <Meteors number={16} client:load />
+ </div>
- <div class="relative z-20 w-full flex flex-col items-start">
+ <div class="relative z-20 w-full max-w-full flex flex-col items-start min-w-0">
{copy.badgeText && (
<a
href={`${getLocalizedPath(locale, "/")}blog?tag=migration`}
- class="animate-rise inline-flex items-center gap-2 px-3 py-1.5 mb-5 md:mb-6 text-xs text-brand bg-brand/5 border border-brand-border/30 hover:border-brand/40 hover:bg-brand/10 rounded-full backdrop-blur-sm select-none hover:-translate-y-0.5 transition-all duration-300 group/badge cursor-pointer max-w-full"
+ class="animate-rise flex items-center gap-2 max-w-full min-w-0 px-3 py-1.5 mb-5 md:mb-6 text-xs text-brand bg-brand/5 border border-brand-border/30 hover:border-brand/40 hover:bg-brand/10 rounded-full backdrop-blur-sm select-none hover:-translate-y-0.5 transition-all duration-300 group/badge cursor-pointer"
style="animation-delay: 0ms;"
>
<span class="relative flex h-2 w-2 shrink-0">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-brand opacity-75"></span>
<span class="relative inline-flex rounded-full h-2 w-2 bg-brand"></span>
</span>
- <span class="text-slate-600 font-medium group-hover/badge:text-brand transition-colors text-[11px] sm:text-xs truncate">{copy.badgeText}</span>
+ <span class="text-slate-600 font-medium group-hover/badge:text-brand transition-colors text-[11px] sm:text-xs truncate min-w-0 flex-1">{copy.badgeText}</span>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2.5" stroke="currentColor" class="w-3 h-3 text-slate-400 group-hover/badge:text-brand transition-all duration-300 transform group-hover/badge:translate-x-0.5 shrink-0">
<path stroke-linecap="round" stroke-linejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5" />
</svg>
</a>
)}
- <h1 class="animate-rise text-3xl sm:text-4xl md:text-5xl xl:text-6xl font-extrabold text-slate-900 leading-[1.18] tracking-tight" style="animation-delay: 80ms;">
+ <h1 class="animate-rise text-3xl sm:text-4xl md:text-5xl xl:text-6xl font-extrabold text-slate-900 leading-[1.18] tracking-tight max-w-full" style="animation-delay: 80ms;">
<span class="text-gradient">EdgeEver</span>
- <div class="mt-2.5 sm:mt-3 flex flex-wrap items-center gap-2">
+ <div class="mt-2.5 sm:mt-3 flex flex-wrap items-center gap-2 max-w-full">
<span class="inline-block px-2.5 py-1 bg-emerald-600 text-white rounded-lg text-base sm:text-lg md:text-xl font-bold -rotate-1 shadow-md animate-pop">
{copy.popHighlight}
</span>
@@ -49,50 +49,50 @@ const agentPromptText = copy.agentPromptText;
</h1>
<!-- Primary Action Buttons -->
- <div class="animate-rise mt-6 sm:mt-8 flex flex-col sm:flex-row items-stretch sm:items-center gap-3 w-full sm:w-auto z-20" style="animation-delay: 160ms;">
+ <div class="animate-rise mt-6 sm:mt-8 flex flex-col sm:flex-row items-stretch sm:items-center gap-3 w-full sm:w-auto max-w-full z-20" style="animation-delay: 160ms;">
<Link
href="https://demo.edgeever.org"
target="_blank"
- class="group flex gap-2 items-center justify-center px-6 py-3 text-white bg-brand border-transparent shadow-[0_12px_30px_-14px_rgb(var(--edgeever-brand-rgb)/0.8)] hover:bg-brand-hover hover:shadow-brand/40 transition-all duration-300 hover:-translate-y-0.5 rounded-full font-semibold text-sm w-full sm:w-auto"
+ class="group flex gap-2 items-center justify-center px-6 py-3 text-white bg-brand border-transparent shadow-[0_12px_30px_-14px_rgb(var(--edgeever-brand-rgb)/0.8)] hover:bg-brand-hover hover:shadow-brand/40 transition-all duration-300 hover:-translate-y-0.5 rounded-full font-semibold text-sm w-full sm:w-auto text-center"
rel="noopener">
<Icon class="w-4 h-4" name="bx:bx-show" />
- {copy.demo}
+ <span>{copy.demo}</span>
</Link>
<Link
size="lg"
style="outline"
rel="noopener"
href="https://github.com/tianma-if/edgeever"
- class="flex gap-2 items-center justify-center px-6 py-3 border border-slate-200 hover:border-slate-400 bg-white/80 backdrop-blur-sm text-slate-800 transition-all rounded-full font-semibold text-sm hover:-translate-y-0.5 w-full sm:w-auto"
+ class="flex gap-2 items-center justify-center px-6 py-3 border border-slate-200 hover:border-slate-400 bg-white/80 backdrop-blur-sm text-slate-800 transition-all rounded-full font-semibold text-sm hover:-translate-y-0.5 w-full sm:w-auto text-center"
target="_blank">
<Icon class="text-slate-800 w-4 h-4" name="bx:bxl-github" />
- GitHub Star
+ <span>GitHub Star</span>
</Link>
<a
rel="noopener"
href={getLocalizedPath(locale, "/blog/ai-agent-deploy-cloudflare")}
- class="flex gap-2 items-center justify-center px-5 py-3 bg-brand/5 border border-brand/20 hover:border-brand/40 text-brand-text hover:bg-brand/10 transition-all rounded-full font-semibold text-sm hover:-translate-y-0.5 w-full sm:w-auto"
+ class="flex gap-2 items-center justify-center px-5 py-3 bg-brand/5 border border-brand/20 hover:border-brand/40 text-brand-text hover:bg-brand/10 transition-all rounded-full font-semibold text-sm hover:-translate-y-0.5 w-full sm:w-auto text-center"
>
<Icon class="w-4 h-4" name="simple-icons:cloudflare" />
- {copy.agentInstall}
+ <span>{copy.agentInstall}</span>
</a>
</div>
<!-- Agent Terminal Prompt Pill (Pireel style) -->
- <div class="animate-rise mt-6 w-full max-w-lg z-30 relative" style="animation-delay: 240ms;">
+ <div class="animate-rise mt-6 w-full max-w-full sm:max-w-lg z-30 relative" style="animation-delay: 240ms;">
<!-- Hidden Textarea for clean text copying -->
<textarea id="agent-prompt-textarea" class="sr-only" aria-hidden="true" readonly>{agentPromptText}</textarea>
- <div class="flex flex-col gap-1.5">
+ <div class="flex flex-col gap-1.5 w-full max-w-full">
<button
type="button"
id="copy-agent-prompt"
title="点击复制 AI 部署 Prompt 指令"
- class="group relative inline-flex items-center justify-between gap-2.5 w-full rounded-2xl sm:rounded-full border border-slate-200/90 bg-white/90 backdrop-blur hover:border-emerald-500/60 p-2 sm:p-1.5 sm:pl-4 transition-all hover:shadow-md cursor-pointer text-left select-none z-30"
+ class="group relative flex items-center justify-between gap-2 w-full max-w-full rounded-2xl sm:rounded-full border border-slate-200/90 bg-white/90 backdrop-blur hover:border-emerald-500/60 p-2 sm:p-1.5 sm:pl-4 transition-all hover:shadow-md cursor-pointer text-left select-none z-30 min-w-0"
>
- <div class="flex items-center gap-2 overflow-hidden pointer-events-none min-w-0">
+ <div class="flex items-center gap-2 overflow-hidden pointer-events-none min-w-0 flex-1">
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-emerald-600 shrink-0"><path d="M12 19h8"></path><path d="m4 17 6-6-6-6"></path></svg>
- <span class="font-mono text-[11px] sm:text-xs text-slate-700 font-medium truncate">
+ <span class="font-mono text-[10.5px] sm:text-xs text-slate-700 font-medium truncate min-w-0 flex-1">
{copy.terminalCmd}
</span>
</div>
@@ -104,19 +104,19 @@ const agentPromptText = copy.agentPromptText;
<span>{copy.copySuccess}</span>
</span>
</button>
- <span class="text-[11px] sm:text-[11.5px] text-slate-600 pl-2 sm:pl-4 font-medium select-none">{copy.terminalSub}</span>
+ <span class="text-[10.5px] sm:text-[11.5px] text-slate-600 pl-2 sm:pl-4 font-medium select-none truncate max-w-full">{copy.terminalSub}</span>
</div>
</div>
</div>
<!-- macOS Browser Window Mockup (Pireel style) -->
- <div class="animate-rise w-full relative z-10 flex justify-center lg:justify-end mt-4 lg:mt-0" style="animation-delay: 320ms;">
- <div class="relative w-full max-w-xl animate-float pointer-events-none select-none">
+ <div class="animate-rise w-full max-w-full relative z-10 flex justify-center lg:justify-end mt-4 lg:mt-0" style="animation-delay: 320ms;">
+ <div class="relative w-full max-w-full sm:max-w-xl animate-float pointer-events-none select-none">
<!-- Glow Underlay -->
<div class="absolute -inset-1 bg-gradient-to-r from-emerald-500/20 via-brand/10 to-teal-500/20 rounded-2xl blur-xl opacity-70"></div>
<!-- macOS Window Container -->
- <div class="relative rounded-2xl border border-slate-200/80 bg-white shadow-xl sm:shadow-2xl overflow-hidden">
+ <div class="relative rounded-2xl border border-slate-200/80 bg-white shadow-xl sm:shadow-2xl overflow-hidden max-w-full">
<!-- macOS Top Header Bar -->
<div class="flex items-center justify-between border-b border-slate-100 bg-slate-50/90 px-3.5 py-2 backdrop-blur-sm">
<div class="flex items-center gap-1.5">
diff --git a/apps/site/src/styles/global.css b/apps/site/src/styles/global.css
index d9bd71f2..0588190c 100644
--- a/apps/site/src/styles/global.css
+++ b/apps/site/src/styles/global.css
@@ -139,14 +139,6 @@
to { transform: translateY(calc(-100% - var(--gap))); }
}
-/*
- The default border color has changed to `currentColor` in Tailwind CSS v4,
- so we've added these compatibility styles to make sure everything still
- looks the same as it did with Tailwind CSS v3.
-
- If we ever want to remove these styles, we need to add an explicit border
- color utility to any element that depends on these defaults.
-*/
@layer base {
*,
::after,
@@ -158,9 +150,14 @@
html {
scroll-behavior: smooth;
+ overflow-x: hidden;
+ width: 100%;
+ max-width: 100vw;
}
body {
overflow-x: hidden;
+ width: 100%;
+ max-width: 100vw;
}
}