From 16eed5ff469046973b68bb79d8e66e629787c751 Mon Sep 17 00:00:00 2001
From: hu xiaotong <416314413@163.com>
Date: Thu, 17 Apr 2025 07:47:17 +0800
Subject: [PATCH] init
---
package-lock.json | 1 +
src/components/Footer.tsx | 8 +-
src/components/LoginModal.tsx | 264 +++++++++++++++++++---------------
src/index.css | 4 +-
src/index.tsx | 22 +--
src/pages/Home.tsx | 55 ++++---
6 files changed, 204 insertions(+), 150 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 1ff953b..e6c6c43 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -42,6 +42,7 @@
"integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==",
"dev": true,
"hasInstallScript": true,
+ "license": "MIT OR Apache-2.0",
"bin": {
"biome": "bin/biome"
},
diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx
index ef9d89d..6882216 100644
--- a/src/components/Footer.tsx
+++ b/src/components/Footer.tsx
@@ -38,7 +38,9 @@ const Footer: React.FC = () => {
-
联系我们
+
+ 联系我们
+
-
diff --git a/src/components/LoginModal.tsx b/src/components/LoginModal.tsx
index 0e8cf85..cef7041 100644
--- a/src/components/LoginModal.tsx
+++ b/src/components/LoginModal.tsx
@@ -1,125 +1,157 @@
import React from "react";
interface LoginModalProps {
- isOpen: boolean;
- onClose: () => void;
+ isOpen: boolean;
+ onClose: () => void;
}
const LoginModal: React.FC = ({ isOpen, onClose }) => {
- if (!isOpen) return null;
+ if (!isOpen) return null;
- return (
-
-
-
-
-
-
-
-
-
-
-
-
- 登录账号
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 登录账号
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
};
-export default LoginModal;
\ No newline at end of file
+export default LoginModal;
diff --git a/src/index.css b/src/index.css
index bbf35bb..66c0122 100644
--- a/src/index.css
+++ b/src/index.css
@@ -1,2 +1,2 @@
-@import 'tailwindcss';
-@import '@fortawesome/fontawesome-free/css/all.min.css';
\ No newline at end of file
+@import "tailwindcss";
+@import "@fortawesome/fontawesome-free/css/all.min.css";
diff --git a/src/index.tsx b/src/index.tsx
index c7034ab..8d0dfca 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,14 +1,14 @@
-import React from 'react';
-import ReactDOM from 'react-dom/client';
-import App from './App';
-import './index.css';
+import React from "react";
+import ReactDOM from "react-dom/client";
+import App from "./App";
+import "./index.css";
-const rootEl = document.getElementById('root');
+const rootEl = document.getElementById("root");
if (rootEl) {
- const root = ReactDOM.createRoot(rootEl);
- root.render(
-
-
- ,
- );
+ const root = ReactDOM.createRoot(rootEl);
+ root.render(
+
+
+ ,
+ );
}
diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx
index c76c4bd..703b407 100644
--- a/src/pages/Home.tsx
+++ b/src/pages/Home.tsx
@@ -149,14 +149,16 @@ const Home: React.FC = () => {
if (isDragging && Math.abs(normalizedDragX) > 0) {
if (dragX > 0) {
// 向右拖动,显示上一张
- const prevIndex = currentSlide === 0 ? slides.length - 1 : currentSlide - 1;
+ const prevIndex =
+ currentSlide === 0 ? slides.length - 1 : currentSlide - 1;
return [
{ index: prevIndex, opacity: Math.min(normalizedDragX, 1) },
{ index: currentSlide, opacity: Math.max(1 - normalizedDragX, 0) },
];
} else {
// 向左拖动,显示下一张
- const nextIndex = currentSlide === slides.length - 1 ? 0 : currentSlide + 1;
+ const nextIndex =
+ currentSlide === slides.length - 1 ? 0 : currentSlide + 1;
return [
{ index: currentSlide, opacity: Math.max(1 + normalizedDragX, 0) },
{ index: nextIndex, opacity: Math.min(-normalizedDragX, 1) },
@@ -357,8 +359,8 @@ const Home: React.FC = () => {
onTouchMove={handleTouchMove}
onTouchEnd={handleTouchEnd}
style={{
- cursor: isDragging ? 'grabbing' : 'grab',
- touchAction: 'none'
+ cursor: isDragging ? "grabbing" : "grab",
+ touchAction: "none",
}}
>
@@ -368,7 +370,9 @@ const Home: React.FC = () => {
className="absolute inset-0"
style={{
opacity,
- transition: slideTransition ? 'opacity 0.3s ease-out' : 'none'
+ transition: slideTransition
+ ? "opacity 0.3s ease-out"
+ : "none",
}}
>
@@ -442,7 +446,9 @@ const Home: React.FC = () => {
新英雄预告
- 即将登场
+
+ 即将登场
+
{
{character.name}
-
- 即将登场
-
+ 即将登场
{character.description}
@@ -509,7 +513,9 @@ const Home: React.FC = () => {
平衡性调整
-
最新更新
+
+ 最新更新
+
{
{character.name}
-
- 最新更新
-
+ 最新更新
{character.description}
@@ -691,7 +695,10 @@ const Home: React.FC = () => {
{battleData.map((data) => (
-
+
|
{
开始时间
- 2025-03-15
+
+ 2025-03-15
+
结束时间
- 2025-06-15
+
+ 2025-06-15
+
剩余时间
@@ -769,7 +780,9 @@ const Home: React.FC = () => {
VS
- 1
+
+ 1
+
风暴战队
@@ -792,7 +805,9 @@ const Home: React.FC = () => {
VS
- 2
+
+ 2
+
雷霆战队
@@ -809,7 +824,9 @@ const Home: React.FC = () => {
幽灵战队
- 0
+
+ 0
+
VS
|