diff --git a/app/globals.css b/app/globals.css
index 8293035..39bf52b 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -38,16 +38,18 @@ body {
color: #000;
}
-/* 核心:点阵网格背景 */
-.bg-dot-grid {
- background-size: 24px 24px;
- background-image: radial-gradient(circle, var(--grid-dot) 1px, transparent 1px);
-}
-
.no-scrollbar {
scrollbar-width: none;
-ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar {
display: none;
+}
+
+html, body {
+ scrollbar-width: none; /* Firefox */
+ -ms-overflow-style: none; /* IE and Edge */
+}
+html::-webkit-scrollbar, body::-webkit-scrollbar {
+ display: none; /* Chrome, Safari and Opera */
}
\ No newline at end of file
diff --git a/app/layout.tsx b/app/layout.tsx
index c0c450f..ed0fe13 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -3,6 +3,7 @@ import localFont from "next/font/local";
import "./globals.css";
import SmoothScroller from "@/components/dom/SmoothScroller";
import Header from "@/components/dom/Header";
+import BackgroundGrid from "@/components/dom/BackgroundGrid";
const tiktokSans = localFont({
src: "./fonts/TikTokSans.ttf",
@@ -34,7 +35,8 @@ export default function RootLayout({
}>) {
return (
-
+
+
{children}
diff --git a/components/dom/BackgroundGrid.tsx b/components/dom/BackgroundGrid.tsx
new file mode 100644
index 0000000..15abe64
--- /dev/null
+++ b/components/dom/BackgroundGrid.tsx
@@ -0,0 +1,75 @@
+'use client';
+
+import { useEffect, useState } from 'react';
+
+export default function BackgroundGrid() {
+ const [size, setSize] = useState({ w: 375, h: 812 });
+
+ useEffect(() => {
+ const updateSize = () => {
+ setSize({ w: window.innerWidth, h: window.innerHeight });
+ };
+ updateSize();
+ window.addEventListener('resize', updateSize);
+ return () => window.removeEventListener('resize', updateSize);
+ }, []);
+
+ const { w, h } = size;
+
+ // Calculate grid lines
+ // Responsive padding: lg is px-14 (56px), mobile is px-4 (16px)
+ const isDesktop = w >= 1024;
+ const paddingX = isDesktop ? 56 : 16;
+ const edgeOffset = paddingX + 0.5; // +0.5 for crisp SVG rendering
+
+ const cols = 3; // Left, Center, Right
+ const rows = Math.ceil(h / 450) + 1;
+
+ const vLines = Array.from({ length: cols }).map((_, i) => {
+ if (i === 0) return edgeOffset;
+ if (i === cols - 1) return w - edgeOffset;
+ return w / 2;
+ });
+
+ const hLines = Array.from({ length: rows }).map((_, i) => (i + 1) * 442);
+
+ // Generate paths
+ let vPath = '';
+ let hPath = '';
+ let crossPath = '';
+
+ const crossSize = 6; // 12px total width/height for the cross
+
+ vLines.forEach(x => {
+ hLines.forEach((y, i) => {
+ const startY = i === 0 ? 0 : hLines[i - 1] + 12;
+ const endY = y - 12;
+ vPath += `M${x} ${startY}V${endY} `;
+
+ crossPath += `M${x} ${y - crossSize}V${y + crossSize} `;
+ crossPath += `M${x - crossSize} ${y}H${x + crossSize} `;
+ });
+ const lastY = hLines[hLines.length - 1] + 12;
+ vPath += `M${x} ${lastY}V${h} `;
+ });
+
+ hLines.forEach(y => {
+ vLines.forEach((x, i) => {
+ const startX = i === 0 ? 0 : vLines[i - 1] + 12;
+ const endX = x - 12;
+ hPath += `M${startX} ${y}H${endX} `;
+ });
+ const lastX = vLines[vLines.length - 1] + 12;
+ hPath += `M${lastX} ${y}H${w} `;
+ });
+
+ return (
+
+ );
+}