build: 更新Next.js配置以支持静态导出并添加新依赖

更新next.config.ts文件以支持静态导出功能,并添加了多个新的依赖项到package.json中,包括UI组件库和动画库。同时生成了构建相关的文件和配置。
This commit is contained in:
张翔
2026-02-02 17:59:29 +08:00
parent f9df7b4d8f
commit 150024b6ac
443 changed files with 9531 additions and 120 deletions
+116
View File
@@ -0,0 +1,116 @@
import Link from 'next/link';
import Image from 'next/image';
import { Mail, Phone, MapPin } from 'lucide-react';
import { COMPANY_INFO, NAVIGATION, SOCIAL_LINKS } from '@/lib/constants';
export function Footer() {
return (
<footer className="bg-black text-white">
<div className="container-custom py-16">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-12">
{/* Company Info */}
<div className="lg:col-span-1">
<div className="flex items-center mb-6">
<img src="/logo-white.svg" alt="四川睿新致远科技有限公司" className="h-12 w-auto" />
</div>
<p className="text-gray-400 text-sm leading-relaxed mb-6">
{COMPANY_INFO.description}
</p>
<div className="flex gap-4">
{SOCIAL_LINKS.map((social) => (
<a
key={social.name}
href={social.href}
className="w-10 h-10 rounded-full bg-white/10 flex items-center justify-center hover:bg-white/20 transition-colors"
aria-label={social.name}
>
<span className="text-sm">{social.name[0]}</span>
</a>
))}
</div>
</div>
{/* Quick Links */}
<div>
<h3 className="font-semibold text-lg mb-6"></h3>
<ul className="space-y-3">
{NAVIGATION.map((item) => (
<li key={item.id}>
<Link
href={item.href}
className="text-gray-400 hover:text-white transition-colors"
>
{item.label}
</Link>
</li>
))}
</ul>
</div>
{/* Services */}
<div>
<h3 className="font-semibold text-lg mb-6"></h3>
<ul className="space-y-3">
<li>
<Link href="/services" className="text-gray-400 hover:text-white transition-colors">
</Link>
</li>
<li>
<Link href="/services" className="text-gray-400 hover:text-white transition-colors">
</Link>
</li>
<li>
<Link href="/services" className="text-gray-400 hover:text-white transition-colors">
</Link>
</li>
<li>
<Link href="/services" className="text-gray-400 hover:text-white transition-colors">
</Link>
</li>
</ul>
</div>
{/* Contact Info */}
<div>
<h3 className="font-semibold text-lg mb-6"></h3>
<ul className="space-y-4">
<li className="flex items-start gap-3">
<MapPin className="w-5 h-5 text-gray-400 mt-0.5" />
<span className="text-gray-400">{COMPANY_INFO.address}</span>
</li>
<li className="flex items-center gap-3">
<Phone className="w-5 h-5 text-gray-400" />
<span className="text-gray-400">{COMPANY_INFO.phone}</span>
</li>
<li className="flex items-center gap-3">
<Mail className="w-5 h-5 text-gray-400" />
<span className="text-gray-400">{COMPANY_INFO.email}</span>
</li>
</ul>
</div>
</div>
{/* Bottom */}
<div className="border-t border-white/10 mt-12 pt-8">
<div className="flex flex-col md:flex-row justify-between items-center gap-4">
<p className="text-gray-400 text-sm">
© {new Date().getFullYear()} {COMPANY_INFO.name}. All rights reserved.
</p>
<div className="flex gap-6">
<Link href="#" className="text-gray-400 hover:text-white text-sm transition-colors">
</Link>
<Link href="#" className="text-gray-400 hover:text-white text-sm transition-colors">
</Link>
</div>
</div>
</div>
</div>
</footer>
);
}
+138
View File
@@ -0,0 +1,138 @@
'use client';
import Link from 'next/link';
import { useState, useEffect, useCallback } from 'react';
import { Menu, X } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet';
import { COMPANY_INFO, NAVIGATION } from '@/lib/constants';
import { cn } from '@/lib/utils';
export function Header() {
const [isOpen, setIsOpen] = useState(false);
const [activeSection, setActiveSection] = useState('home');
const [isScrolled, setIsScrolled] = useState(false);
// 处理平滑滚动
const handleNavClick = useCallback((e: React.MouseEvent<HTMLAnchorElement>, href: string) => {
e.preventDefault();
const targetId = href.replace('#', '');
const element = document.getElementById(targetId);
if (element) {
const headerOffset = 80; // header高度
const elementPosition = element.getBoundingClientRect().top;
const offsetPosition = elementPosition + window.pageYOffset - headerOffset;
window.scrollTo({
top: offsetPosition,
behavior: 'smooth'
});
setActiveSection(targetId);
setIsOpen(false);
}
}, []);
// 监听滚动,更新激活状态和header样式
useEffect(() => {
const handleScroll = () => {
// 更新header背景
setIsScrolled(window.scrollY > 10);
// 计算当前激活的section
const sections = NAVIGATION.map(item => item.href.replace('#', ''));
const scrollPosition = window.scrollY + 100; // 添加偏移量
for (let i = sections.length - 1; i >= 0; i--) {
const section = document.getElementById(sections[i]);
if (section) {
const sectionTop = section.offsetTop;
if (scrollPosition >= sectionTop) {
setActiveSection(sections[i]);
break;
}
}
}
};
window.addEventListener('scroll', handleScroll, { passive: true });
handleScroll(); // 初始化
return () => window.removeEventListener('scroll', handleScroll);
}, []);
return (
<header
className={cn(
"fixed top-0 left-0 right-0 z-50 transition-all duration-300",
isScrolled
? "bg-white/95 backdrop-blur-md shadow-sm border-b border-slate-200/50"
: "bg-slate-50/85 backdrop-blur-md border-b border-slate-200"
)}
>
<div className="container-custom">
<div className="flex items-center justify-between h-20">
{/* Logo */}
<Link
href="#home"
onClick={(e) => handleNavClick(e, '#home')}
className="flex items-center"
>
<img src="/logo.svg" alt={COMPANY_INFO.name} className="h-12 w-auto" />
</Link>
{/* Desktop Navigation */}
<nav className="hidden lg:flex items-center gap-1">
{NAVIGATION.map((item) => (
<a
key={item.id}
href={item.href}
onClick={(e) => handleNavClick(e, item.href)}
className={cn(
"px-4 py-2 text-sm font-medium rounded-full transition-all duration-200",
activeSection === item.id.replace('#', '')
? "text-black bg-black/5"
: "text-gray-600 hover:text-black hover:bg-black/5"
)}
>
{item.label}
</a>
))}
</nav>
{/* Mobile Menu */}
<Sheet open={isOpen} onOpenChange={setIsOpen}>
<SheetTrigger asChild className="lg:hidden">
<Button variant="ghost" size="icon">
<Menu className="h-6 w-6" />
</Button>
</SheetTrigger>
<SheetContent side="right" className="w-[300px]">
<div className="flex flex-col gap-2 mt-8">
{NAVIGATION.map((item) => (
<a
key={item.id}
href={item.href}
onClick={(e) => handleNavClick(e, item.href)}
className={cn(
"px-4 py-3 text-lg font-medium rounded-lg transition-all duration-200",
activeSection === item.id.replace('#', '')
? "text-black bg-black/5"
: "text-gray-600 hover:text-black hover:bg-black/5"
)}
>
{item.label}
</a>
))}
</div>
</SheetContent>
</Sheet>
</div>
</div>
</header>
);
}