diff --git a/.eslintrc.json b/.eslintrc.json index 3722418..ca4b8e9 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,6 @@ { - "extends": ["next/core-web-vitals", "next/typescript"] + "extends": ["next/core-web-vitals", "next/typescript"], + "rules": { + "@next/next/no-img-element": "off" // 或者 "error",取决于你希望是警告还是错误 + } } diff --git a/package.json b/package.json index 95f0532..37205af 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@emotion/styled": "^11.13.0", "@formatjs/intl-localematcher": "^0.5.5", "@mui/material": "^6.1.3", + "lib-flexible": "^0.3.2", "negotiator": "^0.6.3", "next": "14.2.15", "next-intl": "^3.21.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2bb35d9..b9e24d8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: '@mui/material': specifier: ^6.1.3 version: 6.1.3(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + lib-flexible: + specifier: ^0.3.2 + version: 0.3.2 negotiator: specifier: ^0.6.3 version: 0.6.3 @@ -29,6 +32,9 @@ importers: next-intl: specifier: ^3.21.1 version: 3.21.1(next@14.2.15(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) + postcss-pxtorem: + specifier: ^6.1.0 + version: 6.1.0(postcss@8.4.47) react: specifier: ^18 version: 18.3.1 @@ -1279,6 +1285,9 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} + lib-flexible@0.3.2: + resolution: {integrity: sha512-9yowMWA70tKhKdCJDaltY0mNQG4OWo7pWKScnTp9aiSxS7s20ZYlwBRE3335nweOf5qKXVC7sDxJwMPM8/MFZg==} + lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} @@ -1510,6 +1519,11 @@ packages: peerDependencies: postcss: ^8.2.14 + postcss-pxtorem@6.1.0: + resolution: {integrity: sha512-ROODSNci9ADal3zUcPHOF/K83TiCgNSPXQFSbwyPHNV8ioHIE4SaC+FPOufd8jsr5jV2uIz29v1Uqy1c4ov42g==} + peerDependencies: + postcss: ^8.0.0 + postcss-selector-parser@6.1.2: resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} engines: {node: '>=4'} @@ -3354,6 +3368,8 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 + lib-flexible@0.3.2: {} + lilconfig@2.1.0: {} lilconfig@3.1.2: {} @@ -3568,6 +3584,10 @@ snapshots: postcss: 8.4.47 postcss-selector-parser: 6.1.2 + postcss-pxtorem@6.1.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-selector-parser@6.1.2: dependencies: cssesc: 3.0.0 diff --git a/postcss.config.mjs b/postcss.config.mjs index 9b7148b..482f85b 100644 --- a/postcss.config.mjs +++ b/postcss.config.mjs @@ -5,13 +5,13 @@ const config = { plugins: { tailwindcss: {}, 'postcss-pxtorem': { - rootValue: 20, - unitPrecision: 5, - propList: ['*'], - selectorBlackList: [], - minPixelValue: 0, - mediaQuery: false, - }, + rootValue: 14.4, // 默认的根元素字体大小 + unitPrecision: 5, // 单位转换后保留的精度 + propList: ['*'], // 转换哪些属性,'*' 表示全部 + selectorBlackList: [], // 不转换的类名 + minPixelValue: 0, // 小于或等于`1px`的不转换为`rem` + mediaQuery: false, // 允许在媒体查询中转换`px` + } }, }; diff --git a/public/home/img_3.png b/public/home/img_3.png index 006fc3c..9910682 100644 Binary files a/public/home/img_3.png and b/public/home/img_3.png differ diff --git a/public/home/img_AB.png b/public/home/img_AB.png index f70d8ea..324d861 100644 Binary files a/public/home/img_AB.png and b/public/home/img_AB.png differ diff --git a/public/home/img_Omnichannel.png b/public/home/img_Omnichannel.png index c469d39..379c3b9 100644 Binary files a/public/home/img_Omnichannel.png and b/public/home/img_Omnichannel.png differ diff --git a/public/home/img_bg2.png b/public/home/img_bg2.png index df26da2..c48ead4 100644 Binary files a/public/home/img_bg2.png and b/public/home/img_bg2.png differ diff --git a/public/home/img_mutilan.png b/public/home/img_mutilan.png index c133e93..8d5e78e 100644 Binary files a/public/home/img_mutilan.png and b/public/home/img_mutilan.png differ diff --git a/src/app/[[...lang]]/components/form.tsx b/src/app/[[...lang]]/components/form.tsx index b292f84..bdaa395 100644 --- a/src/app/[[...lang]]/components/form.tsx +++ b/src/app/[[...lang]]/components/form.tsx @@ -26,9 +26,8 @@ export default function Form() { >
提交
diff --git a/src/app/[[...lang]]/components/more.tsx b/src/app/[[...lang]]/components/more.tsx index db421ce..c1f415a 100644 --- a/src/app/[[...lang]]/components/more.tsx +++ b/src/app/[[...lang]]/components/more.tsx @@ -1,16 +1,17 @@ import Link from "next/link" -export default function More(props: {dict: Record, lang: string[]}) { +export default function More(props: {dict: Record, lang: string[]}) { + const { dict } = props + return <> + - const { dict, lang } = props - console.log('dict', dict) - return
{ dict.seeMore }
{ dict.contactUs1 }
+ } \ No newline at end of file diff --git a/src/app/[[...lang]]/page.tsx b/src/app/[[...lang]]/page.tsx index 1d2134c..4c9ba8b 100644 --- a/src/app/[[...lang]]/page.tsx +++ b/src/app/[[...lang]]/page.tsx @@ -41,16 +41,20 @@ export default async function Home (props: PropsType) { { img: '/home/case_3.png' }, ] return <> -
-
-
- +
+
+
- -
-
+
+
-
-
-
+
-
+
{ dict.customized }
-
+
-
+
{ dict.ABTesting}
-
+
{ dict.iterateGameplay }
-
+
{ dict.multiLanguage }
-
+
{ dict.breakingGeographical }
-
+
{ dict.allChannel }
-
+
{ dict.expandInfluence }
-
+
-
+
{ dict.lightweightDeployment }
-
+ +
{ dict.simplifyProcess }
-
+
+
+ +
{ dict.caseGallery }
+ {/*
{ dict.clickNow }
*/} + +
-
-
{ dict.caseGallery }
- {/*
{ dict.clickNow }
*/} -
-
-
{ caseList.map((item: CaseType, index: number) => { - return
-
+ return
+
+ text-[30px] text-[#3d3d3d] cursor-pointer rounded-[60px] mb-[50px] w-[280px] h-[280px]" + style={{background: 'radial-gradient(61% 61% at 50% 50%, #FFFFFF 46%, #E1E1E1 100%)' }}>
- -
-
+ + +
{ dict.businessCooperation }info@soyootech.com
-
diff --git a/src/app/components/header.tsx b/src/app/components/header.tsx index 3abded3..8a3d83b 100644 --- a/src/app/components/header.tsx +++ b/src/app/components/header.tsx @@ -1,111 +1,146 @@ 'use client' import Link from "next/link"; -import { useState } from "react"; +import { useEffect, useState } from "react"; type NavType = { - name: string; - href: string; + name: string; + href: string; } -function SplitButton(props: {dict: Record, lang: string[]}) { - const { dict, lang } = props - const [show, setShow] = useState(false) - - return <> -
-
setShow(!show)}> - logo -
{ dict?.lang }
- logo -
- { - -
setShow(false)}> - -
-
{dict?.lang1}
-
- -
- } -
setShow(false)}> -
-
- -} -export default function Header(props: {dict: Record, lang: string[]}) { +export default function Header(props: { dict: Record, lang: string[] }) { const { dict, lang } = props const [activeTab, setActiveTab] = useState(dict.home) - const navList: NavType[] = [ + const [show, setShow] = useState(false) + const [hash, setHash] = useState('#home') + useEffect(() => { + const designWidth = 1440; + const deviceWidth = document.documentElement.clientWidth + let scale = 1 + console.log('designWidth', deviceWidth) + if (deviceWidth <= 1440) { + scale = deviceWidth / designWidth; + } + console.log('scale', scale) + document.documentElement.style.fontSize = `${scale * 14.4}px`; + switch (hash) { + case '#home': + const home = document.getElementById('home') + document.documentElement.scrollTo({ + top: home!.offsetTop - 80, + behavior: 'smooth' + }); + break; + case '#service': + const service = document.getElementById('service') + document.documentElement.scrollTo({ + top: service!.offsetTop - 80, + behavior: 'smooth' + }); + break; + case '#case': + const caseDom = document.getElementById('case') + document.documentElement.scrollTo({ + top: caseDom!.offsetTop - 110, + behavior: 'smooth' + }); + break; + case '#contact': + const contact = document.getElementById('contact') + document.documentElement.scrollTo({ + top: contact!.offsetTop - 80, + behavior: 'smooth' + }); + break; + } + + + + }, [hash]) + + const navList: NavType[] = [ + { + name: dict.home, + href: "#home" + }, + { + name: dict.services, + href: "#service" + }, + { + name: dict.caseGallery, + href: "#case" + }, + { + name: dict.contactUs, + href: "#contact" + }, + ] + return (<> +
+
+ logo setHash('#home')} + /> +
+
{ - name: dict.home, - href: "#home" - }, - { - name: dict.services, - href: "#service" - }, - { - name: dict.caseGallery, - href: "#case" - }, - { - name: dict.contactUs, - href: "#contact " - }, - ] - return (<> -
- + navList.map((item: NavType) => ( +
setHash(item.href)} key={item.name}> +
setActiveTab(item.name)}> +
{item.name}
+ { + activeTab === item.name ? + : +
+ } +
+
+ )) + } +
+
+
setShow(!show)}> logo +
{dict?.lang}
+ logo - -
- { - navList.map((item: NavType) => ( - -
setActiveTab(item.name)}> -
{ item.name }
- { - activeTab === item.name ? - : -
- } -
- - )) - }
-
- -
-
- - ) + { + +
setShow(false)}> + +
+
{dict?.lang1}
+
+ +
+ + } +
+
+
setShow(false)}>
+ {/*
*/} + + ) } \ No newline at end of file diff --git a/src/app/globals.css b/src/app/globals.css index 87321cc..56290e2 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,16 +1,12 @@ @tailwind base; @tailwind components; @tailwind utilities; -html,body { - height: 100%; -} - .main::-webkit-scrollbar { - display: none; - } - - .main { - -ms-overflow-style: none; - scrollbar-width: none; - } - \ No newline at end of file +::-webkit-scrollbar { + display: none; +} + +.main { + -ms-overflow-style: none; + scrollbar-width: none; +} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 49f8461..7e0ffce 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,18 +1,7 @@ import type { Metadata } from "next"; -import localFont from "next/font/local"; import "./globals.css"; import { ReactElement, ReactNode } from "react"; -const geistSans = localFont({ - src: "./fonts/GeistVF.woff", - variable: "--font-geist-sans", - weight: "100 900", -}); -const geistMono = localFont({ - src: "./fonts/GeistMonoVF.woff", - variable: "--font-geist-mono", - weight: "100 900", -}); export const metadata: Metadata = { title: "北京索游科技", @@ -23,7 +12,6 @@ function RootLayout({ children }:{ children: ReactNode } ): ReactElement { return ( {children}