diff --git a/app/page.tsx b/app/page.tsx index 1a56d97..2b7c1bc 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -2,138 +2,268 @@ import React, { useState } from 'react'; import '@/app/ui/global.css'; import Link from 'next/link'; -// import VulnerabilityList from '@/components/CveList'; import { message } from 'antd'; import Image from 'next/image'; import SignIn from '@/components/sign-in'; import { SessionProvider } from "next-auth/react" - const HomePage: React.FC = () => { const [searchQuery, setSearchQuery] = useState(''); - const [messageApi, contextHolder] = message.useMessage();//antd-message的hooks调用 + const [messageApi, contextHolder] = message.useMessage(); + const [activeSlide, setActiveSlide] = useState(0); + + const features = [ + { + title: "AI-Powered Multi-Dimensional Analysis", + description: "CratesPro leverages advanced AI models to provide in-depth, multi-dimensional analysis of Rust crates. By analyzing a variety of data points—including code structure, dependencies, and historical vulnerability patterns—the platform offers intelligent recommendations to optimize crates, enhance security, and reduce the risk of bugs or inefficiencies in your code.", + icon: "/images/homepage/ai-powered.png" + }, + { + title: "Vulnerability Detection and Risk Assessment", + description: "CratesPro automatically detects potential vulnerabilities in the crates, including logic flaws, security risks, and performance bottlenecks. Using intelligent pattern recognition, it scans crate code and their dependencies to identify possible threats or weaknesses. These findings are presented with suggested fixes and recommendations.", + icon: "/images/homepage/vulnerability-detection.png" + }, + { + title: "CVE Tracking and Vulnerability Propagation", + description: "CratesPro tracks CVE (Common Vulnerabilities and Exposures) related to Rust crates and their dependencies. The platform monitors crate versions and their updates, correlating them with known CVE databases to provide real-time updates on newly discovered vulnerabilities. This helps developers stay informed about potential threats to their projects and take proactive measures.", + icon: "/images/homepage/cve-tracking.png" + } + ]; + const handleKeyPress = (e: { key: string; }) => { - // 检查是否按下了回车键 if (e.key === 'Enter') { - // 如果是回车键,执行搜索 performSearch(); } }; const performSearch = () => { if (!searchQuery || searchQuery.trim() === '') { - messageApi.warning('请输入搜索内容'); - //test for review - //alert("请输入搜索内容"); // 可选:提示用户输入内容 } if (searchQuery.trim()) { - // 使用 Link 跳转到搜索页面 window.location.href = `/search?crate_name=${searchQuery}`; } }; - console.log("test for build 1111111111111"); + const nextSlide = () => { + setActiveSlide((prev) => (prev === features.length - 1 ? 0 : prev + 1)); + }; + + const prevSlide = () => { + setActiveSlide((prev) => (prev === 0 ? features.length - 1 : prev - 1)); + }; return ( - //绿色渐变 <> {contextHolder} - < div className=" min-h-screen bg-gray-900 text-white" > -
- -
{/* items-center 确保垂直居中,space-x-4 添加间距 */} -
CratesPro
-
- Rust Logo - {/* Rust Logo */} -
-
- - - +
- {/* 搜索部分 */} -
-

CratesPro - Rust Crate Analysis and Recommendation Platform

-

CratesPro is a sophisticated platform designed to analyze and evaluate Rust crates.

-
+ + {/* 英雄区 */} +
+
+ CratesPro Logo +
+

+ CratesPro - Rust Crate Analysis and Recommendation Platform +

+

+ CratesPro is a sophisticated platform designed to analyze and evaluate Rust crates. +

+ + {/* 搜索框 */} +
setSearchQuery(e.target.value)} // 更新搜索内容 + onChange={(e) => setSearchQuery(e.target.value)} onKeyDown={handleKeyPress} /> - {/* */} - - {/* */} + Search +
+ {/* 彩色分隔线 */} +
+ + + +
- {/* 分割线部分 */} -
+ {/* 为什么选择我们 */} +
+

+ Why Choose Us +

- {/* */} +
+ {/* 左箭头 */} + + {/* 轮播内容 */} +
+
+ {features.map((feature, index) => ( +
+
+
+ {feature.title} +
+

+ {feature.title} +

+

+ {feature.description} +

+
+
+ ))} +
+
- {/* 一些介绍 */} -
-
- {/* Overview */} -
-
-

AI-Powered Multi-Dimensional Analysis

-

CratesPro leverages advanced AI models to provide in-depth, multi-dimensional analysis of Rust crates. By analyzing a variety of data points—including code structure, dependencies, and historical vulnerability patterns—the platform offers intelligent recommendations to optimize crates, enhance security, and reduce the risk of bugs or inefficiencies in your code.

- {/*

Learn more about the new features on our blog, or get started with the API documentation, and code examples.

*/} + {/* 右箭头 */} +
+
+ {/* 页脚 */} +
); } -export default HomePage; +export default HomePage; \ No newline at end of file diff --git a/app/ui/global.css b/app/ui/global.css index 8a291b5..22eaf6d 100644 --- a/app/ui/global.css +++ b/app/ui/global.css @@ -20,4 +20,11 @@ input[type='number']::-webkit-outer-spin-button { .custom-margin-left { margin-left: 500px; /* 自定义的左边距 */ +} + +@font-face { + font-family: 'HarmonyOS Sans SC'; + src: url('/fonts/HarmonyOS_Sans_SC_Regular.ttf') format('truetype'); + font-weight: 400; + font-style: normal; } \ No newline at end of file diff --git a/components/sign-in.tsx b/components/sign-in.tsx index 6160670..f248601 100644 --- a/components/sign-in.tsx +++ b/components/sign-in.tsx @@ -128,7 +128,7 @@ export default function SignInButton() { clipRule="evenodd" /> - 登录 + Login With GitHub ); } \ No newline at end of file diff --git a/images/demo.png b/images/demo.png deleted file mode 100644 index 5c5a2ca..0000000 Binary files a/images/demo.png and /dev/null differ diff --git a/images/main.png b/images/main.png deleted file mode 100644 index 5550bf8..0000000 Binary files a/images/main.png and /dev/null differ diff --git a/public/images/homepage/Frame.png b/public/images/homepage/Frame.png new file mode 100644 index 0000000..fb66e92 Binary files /dev/null and b/public/images/homepage/Frame.png differ diff --git a/public/images/homepage/ai-powered.png b/public/images/homepage/ai-powered.png new file mode 100644 index 0000000..57d819f Binary files /dev/null and b/public/images/homepage/ai-powered.png differ diff --git a/public/images/homepage/cve-tracking.png b/public/images/homepage/cve-tracking.png new file mode 100644 index 0000000..cad4725 Binary files /dev/null and b/public/images/homepage/cve-tracking.png differ diff --git a/public/images/homepage/left-normal.png b/public/images/homepage/left-normal.png new file mode 100644 index 0000000..8ae306a Binary files /dev/null and b/public/images/homepage/left-normal.png differ diff --git a/public/images/homepage/logo-footer.png b/public/images/homepage/logo-footer.png new file mode 100644 index 0000000..899d69f Binary files /dev/null and b/public/images/homepage/logo-footer.png differ diff --git a/public/images/homepage/logo-top.png b/public/images/homepage/logo-top.png new file mode 100644 index 0000000..893c677 Binary files /dev/null and b/public/images/homepage/logo-top.png differ diff --git a/public/images/homepage/right-hover.png b/public/images/homepage/right-hover.png new file mode 100644 index 0000000..f0d4944 Binary files /dev/null and b/public/images/homepage/right-hover.png differ diff --git a/public/images/homepage/vulnerability-detection.png b/public/images/homepage/vulnerability-detection.png new file mode 100644 index 0000000..a558453 Binary files /dev/null and b/public/images/homepage/vulnerability-detection.png differ diff --git "a/public/images/homepage/web-\351\246\226\351\241\265-\346\234\252\347\231\273\345\275\225.png" "b/public/images/homepage/web-\351\246\226\351\241\265-\346\234\252\347\231\273\345\275\225.png" new file mode 100644 index 0000000..4219d74 Binary files /dev/null and "b/public/images/homepage/web-\351\246\226\351\241\265-\346\234\252\347\231\273\345\275\225.png" differ