- useHomeResponsive: 标题尺寸 4xl→2xl,正文 xl→md - HomePage: VStack/SimpleGrid 间距缩小 - HeroHeader: spacing/padding 缩小,maxW 调整 - FeaturedFeatureCard: 图标、标题、按钮尺寸缩小 - FeatureCard: 卡片高度 180→120px,整体元素尺寸缩小 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
58 lines
1.0 KiB
TypeScript
58 lines
1.0 KiB
TypeScript
// src/hooks/useHomeResponsive.ts
|
|
// 首页响应式配置 Hook
|
|
|
|
import { useBreakpointValue } from '@chakra-ui/react';
|
|
import type { ResponsiveConfig } from '@/types/home';
|
|
|
|
/**
|
|
* 首页响应式配置 Hook
|
|
* 集中管理所有响应式断点值
|
|
*
|
|
* @returns 响应式配置对象
|
|
*/
|
|
export const useHomeResponsive = (): ResponsiveConfig => {
|
|
const heroHeight = useBreakpointValue({
|
|
base: '60vh',
|
|
md: '80vh',
|
|
lg: '100vh'
|
|
});
|
|
|
|
const headingSize = useBreakpointValue({
|
|
base: 'lg',
|
|
md: 'xl',
|
|
lg: '2xl'
|
|
});
|
|
|
|
const headingLetterSpacing = useBreakpointValue({
|
|
base: '-0.5px',
|
|
md: '-1px',
|
|
lg: '-1.5px'
|
|
});
|
|
|
|
const heroTextSize = useBreakpointValue({
|
|
base: 'xs',
|
|
md: 'sm',
|
|
lg: 'md'
|
|
});
|
|
|
|
const containerPx = useBreakpointValue({
|
|
base: 10,
|
|
md: 10,
|
|
lg: 10
|
|
});
|
|
|
|
const showDecorations = useBreakpointValue({
|
|
base: false,
|
|
md: true
|
|
});
|
|
|
|
return {
|
|
heroHeight,
|
|
headingSize,
|
|
headingLetterSpacing,
|
|
heroTextSize,
|
|
containerPx,
|
|
showDecorations
|
|
};
|
|
};
|