new project

main
yezhen 2026-01-31 21:26:26 +08:00
commit b178a4fefc
18 changed files with 18233 additions and 0 deletions

3
.babelrc Normal file
View File

@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
}

3
.eslintignore Normal file
View File

@ -0,0 +1,3 @@
node_modules/
build/
dist/

21
.eslintrc.json Normal file
View File

@ -0,0 +1,21 @@
{
"root": true,
"env": {
"browser": true,
"es2021": true,
"node": true
},
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"react": {
"version": "detect"
}
},
"extends": ["ali", "ali/react"]
}

26
.gitignore vendored Normal file
View File

@ -0,0 +1,26 @@
# Dependencies
/node_modules
/.pnp
.pnp.js
# Testing
/coverage
# Production
/build
# Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Environment
.env.local
.env.development.local
.env.test.local
.env.production.local
# Misc
.DS_Store

17564
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

34
package.json Normal file
View File

@ -0,0 +1,34 @@
{
"name": "rhdata-customer-web",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "webpack serve --mode development",
"build": "webpack --mode production",
"lint": "eslint src --ext .js,.jsx"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.7",
"@babel/preset-react": "^7.23.3",
"babel-loader": "^9.1.3",
"css-loader": "^6.10.0",
"eslint": "^8.56.0",
"eslint-config-ali": "^15.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"html-webpack-plugin": "^5.6.0",
"style-loader": "^3.3.4",
"webpack": "^5.90.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
}
}

12
public/index.html Normal file
View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>

18
src/App.css Normal file
View File

@ -0,0 +1,18 @@
.app {
min-height: 100vh;
display: grid;
place-items: center;
text-align: center;
padding: 2rem;
}
.app h1 {
margin: 0 0 0.5rem;
font-size: 2rem;
}
.app code {
background: #fff;
padding: 0.1rem 0.3rem;
border-radius: 4px;
}

6
src/App.jsx Normal file
View File

@ -0,0 +1,6 @@
import React from "react";
import Home from "./components/home";
export default function App() {
return <Home />;
}

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

156
src/components/home.jsx Normal file
View File

@ -0,0 +1,156 @@
import React from "react";
import "../css/home.css";
const navItems = ["探索", "类目", "店铺", "达人", "商品", "视频与广告", "直播"];
const stats = [
{ value: "2亿+", label: "商品数据" },
{ value: "2.5亿+", label: "电商达人数据" },
{ value: "4亿+", label: "直播与短视频数据" },
{ value: "1000天", label: "历史数据" }
];
const logos = [
"Jet Commerce",
"eCommerce Ninja",
"desty",
"BUZZOHERO",
"KOLAN",
"SCI GROUP",
"周大福",
"PONGO",
"MADAME GIE"
];
export default function Home() {
return (
<div className="home">
<header className="home-header">
<div className="home-brand">
<div className="home-logo">Kalodata</div>
</div>
<nav className="home-nav">
{navItems.map((item) => (
<button key={item} className="home-nav-item" type="button">
{item}
</button>
))}
</nav>
<div className="home-actions">
<div className="home-lang">中文(简体)</div>
<div className="home-divider" />
<div className="home-user">Spark</div>
</div>
</header>
<main>
<section className="home-hero">
<div className="home-hero-content">
<h1>
全球用户 <span>首选</span>
<br />
TikTok电商
<br />
数据洞察平台
</h1>
<p>
爆品挖掘达人建联视频创意直播设计广告优化竞对分析
<br />
我们助您抓住TikTok的每一次机会
</p>
<div className="home-hero-stats">
{stats.map((stat) => (
<div key={stat.label} className="home-hero-stat">
<strong>{stat.value}</strong>
<span>{stat.label}</span>
</div>
))}
</div>
<button className="home-cta" type="button">
7天免费试用
</button>
</div>
<div className="home-hero-art">
<div className="home-hero-pattern" />
</div>
</section>
<section className="home-logos">
{logos.map((logo) => (
<div key={logo} className="home-logo-item">
{logo}
</div>
))}
</section>
<section className="home-section">
<div className="home-section-header">
<span className="home-section-number">01</span>
<h2>爆品追踪</h2>
</div>
<div className="home-section-body">
<div className="home-section-card">
<div className="home-section-sidebar">
<div className="home-section-filter-title">筛选</div>
<div className="home-section-filter-item">日期</div>
<div className="home-section-filter-item">类目</div>
<div className="home-section-filter-item">价格</div>
</div>
<div className="home-section-content">
<div className="home-section-table">
<div className="home-section-row is-header">
<span>排名</span>
<span>商品</span>
<span>价格</span>
<span>销量</span>
<span>趋势</span>
</div>
{[1, 2, 3].map((item) => (
<div key={item} className="home-section-row">
<span>Top{item}</span>
<span className="home-section-product" />
<span>¥99.20</span>
<span>9276</span>
<span className="home-section-chart" />
</div>
))}
</div>
<div className="home-section-preview">
<div className="home-section-preview-card">
<div className="home-section-preview-image" />
<div className="home-section-preview-data">
<div>
<strong>¥920.18k</strong>
<span>成交金额</span>
</div>
<div>
<strong>9276</strong>
<span>销量</span>
</div>
<div>
<strong>¥99.20</strong>
<span>成交均价</span>
</div>
</div>
<div className="home-section-preview-metrics">
<div>
<strong>¥64.47k</strong>
<span>直播</span>
</div>
<div>
<strong>¥0.00</strong>
<span>短视频</span>
</div>
<div>
<strong>¥225.71k</strong>
<span>商城</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
</div>
);
}

320
src/css/home.css Normal file
View File

@ -0,0 +1,320 @@
body {
background: #f5f7fb;
color: #1f2a37;
}
.home {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
"Helvetica Neue", Arial, sans-serif;
color: inherit;
}
.home-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 48px;
}
.home-brand {
display: flex;
align-items: center;
gap: 10px;
font-weight: 700;
font-size: 18px;
}
.home-logo {
color: #1f6feb;
letter-spacing: 0.5px;
}
.home-nav {
display: flex;
gap: 20px;
font-size: 14px;
}
.home-nav-item {
background: transparent;
border: 0;
color: #1f2a37;
cursor: pointer;
padding: 6px 8px;
}
.home-actions {
display: flex;
align-items: center;
gap: 12px;
font-size: 14px;
}
.home-divider {
width: 1px;
height: 14px;
background: #d0d7e2;
}
.home-hero {
display: grid;
grid-template-columns: minmax(0, 1fr) 360px;
gap: 24px;
padding: 40px 48px 20px;
align-items: center;
}
.home-hero-content h1 {
margin: 0 0 16px;
font-size: 42px;
line-height: 1.2;
}
.home-hero-content h1 span {
color: #1f6feb;
}
.home-hero-content p {
color: #60708a;
margin: 0 0 24px;
}
.home-hero-stats {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 16px;
margin-bottom: 24px;
}
.home-hero-stat {
display: grid;
gap: 4px;
}
.home-hero-stat strong {
font-size: 20px;
}
.home-hero-stat span {
font-size: 12px;
color: #5f6b7c;
}
.home-cta {
background: #1f6feb;
color: #fff;
border: 0;
border-radius: 24px;
padding: 10px 28px;
cursor: pointer;
font-weight: 600;
}
.home-hero-art {
display: flex;
justify-content: center;
}
.home-hero-pattern {
width: 280px;
height: 280px;
border-radius: 32px;
background: radial-gradient(circle at 30% 30%, #dbe9ff, transparent 70%),
linear-gradient(135deg, #e8f1ff, #f8fbff);
position: relative;
overflow: hidden;
}
.home-hero-pattern::after {
content: "";
position: absolute;
inset: 30px;
border: 2px dashed #c3d7f5;
border-radius: 28px;
}
.home-logos {
display: grid;
grid-template-columns: repeat(9, minmax(0, 1fr));
gap: 8px;
background: #fff;
padding: 16px 48px;
border-top: 1px solid #e6edf7;
border-bottom: 1px solid #e6edf7;
}
.home-logo-item {
text-align: center;
color: #94a3b8;
font-size: 12px;
}
.home-section {
padding: 32px 48px 64px;
}
.home-section-header {
display: flex;
align-items: baseline;
gap: 16px;
margin-bottom: 20px;
}
.home-section-number {
font-size: 48px;
color: #e4edf8;
font-weight: 700;
}
.home-section h2 {
margin: 0;
font-size: 24px;
}
.home-section-card {
background: #fff;
border-radius: 20px;
padding: 24px;
box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}
.home-section-body {
display: grid;
gap: 20px;
}
.home-section-sidebar {
width: 200px;
border-right: 1px solid #eef2f7;
padding-right: 16px;
color: #64748b;
}
.home-section-filter-title {
font-weight: 600;
margin-bottom: 12px;
color: #1f2a37;
}
.home-section-filter-item {
padding: 6px 0;
}
.home-section-content {
display: grid;
grid-template-columns: 1fr 280px;
gap: 20px;
}
.home-section-card {
display: grid;
grid-template-columns: 200px 1fr;
gap: 20px;
}
.home-section-table {
display: grid;
gap: 8px;
}
.home-section-row {
display: grid;
grid-template-columns: 80px 1fr 80px 80px 100px;
gap: 12px;
align-items: center;
padding: 8px 0;
border-bottom: 1px solid #eef2f7;
font-size: 13px;
color: #5f6b7c;
}
.home-section-row.is-header {
font-weight: 600;
color: #1f2a37;
border-bottom: 1px solid #dde6f2;
}
.home-section-product {
height: 20px;
background: #e9f1ff;
border-radius: 10px;
}
.home-section-chart {
height: 12px;
background: linear-gradient(90deg, #cfe0ff, #8bb4ff);
border-radius: 6px;
}
.home-section-preview-card {
background: #f8fbff;
border-radius: 16px;
padding: 16px;
display: grid;
gap: 12px;
}
.home-section-preview-image {
height: 140px;
border-radius: 12px;
background: linear-gradient(135deg, #f2f6ff, #dfe9ff);
}
.home-section-preview-data,
.home-section-preview-metrics {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 8px;
font-size: 12px;
color: #64748b;
}
.home-section-preview-data strong,
.home-section-preview-metrics strong {
display: block;
color: #1f2a37;
font-size: 14px;
}
@media (max-width: 1080px) {
.home-hero {
grid-template-columns: 1fr;
}
.home-hero-stats {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.home-logos {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.home-section-card {
grid-template-columns: 1fr;
}
.home-section-content {
grid-template-columns: 1fr;
}
}
@media (max-width: 720px) {
.home-header {
flex-direction: column;
gap: 16px;
align-items: flex-start;
}
.home-nav {
flex-wrap: wrap;
}
.home-hero {
padding: 24px;
}
.home-logos,
.home-section {
padding: 16px 24px 32px;
}
}

12
src/index.css Normal file
View File

@ -0,0 +1,12 @@
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
"Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", sans-serif;
background: #f5f5f5;
color: #222;
}

11
src/index.jsx Normal file
View File

@ -0,0 +1,11 @@
import React from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
import "./index.css";
const root = createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);

44
webpack.config.js Normal file
View File

@ -0,0 +1,44 @@
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
mode: "development",
entry: path.resolve(__dirname, "src", "index.jsx"),
output: {
path: path.resolve(__dirname, "dist"),
filename: "bundle.js",
clean: true
},
devtool: "source-map",
resolve: {
extensions: [".js", ".jsx"]
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, "public", "index.html")
})
],
devServer: {
static: {
directory: path.resolve(__dirname, "public")
},
port: 3000,
hot: true,
historyApiFallback: true
}
};