I see the issue! The hook is named useIsMobile, not useMobile. Let me fix the import:
✅ Import error fixed!
useMobileuseIsMobile// Before (incorrect):
import { useMobile } from "@/hooks/use-mobile"
// After (correct):
import { useIsMobile } from "@/hooks/use-mobile"The hook is correctly named useIsMobile in the /hooks/use-mobile.tsx file, so I updated the import to match the actual export name.
Now the mobile detection should work properly and display "我的博客" on mobile devices!
这个问题是因为 bg-clip-text 在某些移动端浏览器上兼容性不好。让我修复这个问题:
✅ 修复了移动端渐变文字显示问题!
gradient-text-mobile-safe 类/* 1. 正常情况:支持渐变文字 */
.gradient-text-mobile-safe {
background: linear-gradient(to right, #06b6d4, #8b5cf6);
-webkit-background-clip: text;
background-clip: text;
}
/* 2. 不支持时:显示纯色 */
@supports not (-webkit-background-clip: text) {
.gradient-text-mobile-safe {
color: #06b6d4;
}
}
/* 3. 移动端:强制使用纯色 */
@media (max-width: 768px) {
.gradient-text-mobile-safe {
color: #06b6d4;
}
}-webkit- 前缀现在在所有移动端浏览器上,姓名都会正确显示为文字,而不是渐变色长方形!
您说得对!我需要彻底修复这个问题。让我修改相关文件,移除所有有问题的渐变文字效果:
✅ 彻底修复了渐变文字显示问题!
bg-gradient-to-r bg-clip-text text-transparenttext-cyan-600 dark:text-cyan-400bg-gradient-to-r from-primary to-primary/70 bg-clip-text text-transparenttext-primary// 首页姓名 - 简单可靠的颜色
text-cyan-600 dark:text-cyan-400
// 对话框标题 - 使用主题色
text-primary现在无论在什么移动端浏览器上,姓名和对话框标题都会显示为清晰的文字,不会再出现渐变色长方形的问题!