From 32262b936367582561ab3acd74fdf635e5039423 Mon Sep 17 00:00:00 2001 From: LYXOfficial Date: Sun, 6 Oct 2024 11:28:03 +0800 Subject: [PATCH 1/3] fix: style --- .gitignore | 3 ++ .vscode/settings.json | 21 +++++++++ package.json | 1 + .../[locale]/component/ColorSchemeToggle.tsx | 11 ++++- .../component/CopyRightAlert.module.css | 8 ++++ src/app/[locale]/component/CopyRightAlert.tsx | 26 +++++------ src/app/[locale]/component/Footer.module.css | 6 ++- src/app/[locale]/component/Footer.tsx | 6 +-- .../[locale]/component/HeaderMenu.module.css | 5 +++ src/app/[locale]/component/HeaderMenu.tsx | 27 ++++++------ .../[locale]/component/HeroText.module.css | 1 + src/app/[locale]/component/HeroText.tsx | 32 +++++++------- src/app/[locale]/component/LocaleToggle.tsx | 10 ++++- .../component/LatestBanner.module.css | 12 ++++++ .../downloads/component/LatestBanner.tsx | 10 ++--- src/app/[locale]/downloads/page.tsx | 1 + src/app/[locale]/global.css | 3 ++ src/app/[locale]/layout.tsx | 43 ++++++++++--------- src/app/[locale]/page.tsx | 1 + 19 files changed, 151 insertions(+), 76 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 src/app/[locale]/component/CopyRightAlert.module.css create mode 100644 src/app/[locale]/global.css diff --git a/.gitignore b/.gitignore index 0368a7b..5c9fa08 100644 --- a/.gitignore +++ b/.gitignore @@ -132,3 +132,6 @@ dist .DS_Store .idea/ + +yarn.lock +pnpm-lock.yaml \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6a0a445 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,21 @@ +{ + "MicroPython.executeButton": [ + { + "text": "▶", + "tooltip": "运行", + "alignment": "left", + "command": "extension.executeFile", + "priority": 3.5 + } + ], + "MicroPython.syncButton": [ + { + "text": "$(sync)", + "tooltip": "同步", + "alignment": "left", + "command": "extension.execute", + "priority": 4 + } + ], + "compile-hero.disable-compile-files-on-did-save-code": true +} \ No newline at end of file diff --git a/package.json b/package.json index 9ba8e0c..6564228 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@vercel/analytics": "^1.3.1", "next": "14.1.3", "next-intl": "^3.14.1", + "nextjs-toploader": "^3.6.15", "postcss-custom-properties": "^13.3.12", "react": "18.2.0", "react-dom": "18.2.0" diff --git a/src/app/[locale]/component/ColorSchemeToggle.tsx b/src/app/[locale]/component/ColorSchemeToggle.tsx index 1949549..fc1df6f 100644 --- a/src/app/[locale]/component/ColorSchemeToggle.tsx +++ b/src/app/[locale]/component/ColorSchemeToggle.tsx @@ -3,6 +3,7 @@ import { ActionIcon, MantineColorScheme, useMantineColorScheme } from '@mantine/core'; import { IconBrightness2, IconBrightnessAuto, IconMoonStars } from '@tabler/icons-react'; import { useEffect, useState } from 'react'; +import classes from "./HeaderMenu.module.css"; const schemes = [ { scheme: 'auto', icon: }, @@ -24,6 +25,14 @@ export function ColorSchemeToggle() { useEffect(() => { setColorScheme('auto'); }, []); return ( - {schemes[selected].icon} + + {schemes[selected].icon} + ); } diff --git a/src/app/[locale]/component/CopyRightAlert.module.css b/src/app/[locale]/component/CopyRightAlert.module.css new file mode 100644 index 0000000..a91a13a --- /dev/null +++ b/src/app/[locale]/component/CopyRightAlert.module.css @@ -0,0 +1,8 @@ +.container{ + max-width: fit-content; + margin: auto; + margin-top: 30px; + height: auto; + padding: 0 30px; + word-break: break-word; +} \ No newline at end of file diff --git a/src/app/[locale]/component/CopyRightAlert.tsx b/src/app/[locale]/component/CopyRightAlert.tsx index 2b32b3b..2e46b1f 100644 --- a/src/app/[locale]/component/CopyRightAlert.tsx +++ b/src/app/[locale]/component/CopyRightAlert.tsx @@ -1,31 +1,27 @@ -import {IconInfoCircle} from "@tabler/icons-react"; -import {Alert} from "@mantine/core"; +import { IconInfoCircle } from "@tabler/icons-react"; +import { Alert } from "@mantine/core"; import { useTranslations } from 'next-intl'; import React from "react"; +import classes from "./CopyRightAlert.module.css"; export default function CopyRightAlert() { const t = useTranslations('Copyright'); return ( -
- }> +
+ }> {t('part1')}  - + Lingmo OS   {t('part2')} -
+
{t('part3')}(QQ:  - + 2422586862  Email:  - + team@lingmo.org ) diff --git a/src/app/[locale]/component/Footer.module.css b/src/app/[locale]/component/Footer.module.css index 9726733..be6164b 100644 --- a/src/app/[locale]/component/Footer.module.css +++ b/src/app/[locale]/component/Footer.module.css @@ -23,11 +23,13 @@ } } - - .links { @media (max-width: $mantine-breakpoint-sm) { margin-top: var(--mantine-spacing-lg); margin-bottom: var(--mantine-spacing-sm); } } + +.social { + transition: .3s; +} \ No newline at end of file diff --git a/src/app/[locale]/component/Footer.tsx b/src/app/[locale]/component/Footer.tsx index caf64a3..0c7daaa 100644 --- a/src/app/[locale]/component/Footer.tsx +++ b/src/app/[locale]/component/Footer.tsx @@ -20,17 +20,17 @@ export function Footer() { - + - + - + diff --git a/src/app/[locale]/component/HeaderMenu.module.css b/src/app/[locale]/component/HeaderMenu.module.css index 3e0e645..55fd7aa 100644 --- a/src/app/[locale]/component/HeaderMenu.module.css +++ b/src/app/[locale]/component/HeaderMenu.module.css @@ -20,6 +20,7 @@ color: light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-0)); font-size: var(--mantine-font-size-sm); font-weight: 500; + transition: .3s; @mixin hover { background-color: light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-6)); @@ -29,3 +30,7 @@ .linkLabel { margin-right: rem(5px); } + +.action { + transition: .3s; +} \ No newline at end of file diff --git a/src/app/[locale]/component/HeaderMenu.tsx b/src/app/[locale]/component/HeaderMenu.tsx index 741da83..87525ae 100644 --- a/src/app/[locale]/component/HeaderMenu.tsx +++ b/src/app/[locale]/component/HeaderMenu.tsx @@ -8,26 +8,27 @@ import LingmoLogos from '@/components/LingmoLogos/LingmoLogos'; import { ColorSchemeToggle } from '@/src/app/[locale]/component/ColorSchemeToggle'; import { LocaleToggle } from '@/src/app/[locale]/component/LocaleToggle'; import { links } from '@/src/app/[locale]/component/Links' +import Link from 'next/link'; export function HeaderMenu(props: HeaderMenuProps) { const t = useTranslations('Headers'); const items = links.map((link) => ( - - {t(link.label)} - - )); + + {t(link.label)} + + )); return (
- + - + {items} @@ -35,17 +36,17 @@ export function HeaderMenu(props: HeaderMenuProps) { - + - + - + diff --git a/src/app/[locale]/component/HeroText.module.css b/src/app/[locale]/component/HeroText.module.css index d8563b2..700b8d3 100644 --- a/src/app/[locale]/component/HeroText.module.css +++ b/src/app/[locale]/component/HeroText.module.css @@ -58,6 +58,7 @@ height: rem(54px); padding-left: rem(38px); padding-right: rem(38px); + transition: .3s; @media (max-width: $mantine-breakpoint-sm) { height: rem(54px); diff --git a/src/app/[locale]/component/HeroText.tsx b/src/app/[locale]/component/HeroText.tsx index ebaa5e3..9bfbc6b 100644 --- a/src/app/[locale]/component/HeroText.tsx +++ b/src/app/[locale]/component/HeroText.tsx @@ -1,16 +1,16 @@ 'use client'; -import {Alert, Button, Container, Group, Text} from '@mantine/core'; -import {IconDownload, IconInfoCircle} from '@tabler/icons-react'; +import { Button, Container, Group, Text } from '@mantine/core'; +import { IconDownload } from '@tabler/icons-react'; import React from 'react'; -import { useRouter } from 'next/navigation'; import { useTranslations } from 'next-intl'; import classes from './HeroText.module.css'; import { Dots } from '@/src/app/[locale]/component/Dots'; +import { useRouter } from "nextjs-toploader/app"; export function HeroText() { - const router = useRouter(); const t = useTranslations('Index'); + const router=useRouter(); const description = t('description').split('%'); @@ -39,23 +39,23 @@ export function HeroText() { diff --git a/src/app/[locale]/component/LocaleToggle.tsx b/src/app/[locale]/component/LocaleToggle.tsx index 42650d7..cf6fe08 100644 --- a/src/app/[locale]/component/LocaleToggle.tsx +++ b/src/app/[locale]/component/LocaleToggle.tsx @@ -6,6 +6,7 @@ import { IconLanguage } from '@tabler/icons-react'; import { useParams } from 'next/navigation'; import { createSharedPathnamesNavigation } from 'next-intl/navigation'; import { LocalesList } from '@/src/locales'; +import classes from "./HeaderMenu.module.css"; export function LocaleToggle() { const { setColorScheme } = useMantineColorScheme(); @@ -23,7 +24,14 @@ export function LocaleToggle() { return ( - + + + diff --git a/src/app/[locale]/downloads/component/LatestBanner.module.css b/src/app/[locale]/downloads/component/LatestBanner.module.css index 85eeaa4..98b357b 100644 --- a/src/app/[locale]/downloads/component/LatestBanner.module.css +++ b/src/app/[locale]/downloads/component/LatestBanner.module.css @@ -24,3 +24,15 @@ line-height: 1; margin-bottom: var(--mantine-spacing-md); } + +.download_button, .download_item { + transition: .3s; +} + +.grid{ + flex-wrap: wrap; +} + +.download_container { + min-width: fit-content; +} \ No newline at end of file diff --git a/src/app/[locale]/downloads/component/LatestBanner.tsx b/src/app/[locale]/downloads/component/LatestBanner.tsx index d9ccc6e..6680125 100644 --- a/src/app/[locale]/downloads/component/LatestBanner.tsx +++ b/src/app/[locale]/downloads/component/LatestBanner.tsx @@ -15,7 +15,7 @@ export function LatestBanner() { - + {t('requirements')} @@ -37,7 +37,7 @@ export function LatestBanner() { - + {t('version')}2.0
@@ -46,13 +46,13 @@ export function LatestBanner() {
- + - + {t('downloadOfficial')} - + SourceForge diff --git a/src/app/[locale]/downloads/page.tsx b/src/app/[locale]/downloads/page.tsx index d4bf58a..4f276a8 100644 --- a/src/app/[locale]/downloads/page.tsx +++ b/src/app/[locale]/downloads/page.tsx @@ -3,6 +3,7 @@ import { Container, Group, Space, Stack, Text, Title } from '@mantine/core'; import { useTranslations } from 'next-intl'; import { LatestBanner } from '@/src/app/[locale]/downloads/component/LatestBanner'; +import React from 'react'; export default function DownloadsPage() { const t = useTranslations('Downloads'); diff --git a/src/app/[locale]/global.css b/src/app/[locale]/global.css new file mode 100644 index 0000000..1b0adf9 --- /dev/null +++ b/src/app/[locale]/global.css @@ -0,0 +1,3 @@ +::selection{ + background-color: var(--mantine-color-gray-light-hover); +} \ No newline at end of file diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx index ee21400..e945d7b 100644 --- a/src/app/[locale]/layout.tsx +++ b/src/app/[locale]/layout.tsx @@ -1,4 +1,5 @@ import '@mantine/core/styles.css'; +import "./global.css"; import React from 'react'; import { ColorSchemeScript, MantineProvider } from '@mantine/core'; import { NextIntlClientProvider } from 'next-intl'; @@ -6,32 +7,34 @@ import { getMessages } from 'next-intl/server'; import { Analytics } from '@vercel/analytics/next'; import { theme } from '@/theme'; import RootLayoutInner from '@/src/app/[locale]/component/RootLayoutInner'; +import NextTopLoader from 'nextjs-toploader'; export default async function RootLayout({ children, params: { locale } }: - { children: any, params: { locale: string } }) { + { children: any, params: { locale: string } }) { const messages = await getMessages(); return ( - - - - - Lingmo OS - - - - - - - {children} - - - - + + + + + Lingmo OS + + + + + + + + {children} + + + + ); } diff --git a/src/app/[locale]/page.tsx b/src/app/[locale]/page.tsx index 2293b0a..dd2956a 100644 --- a/src/app/[locale]/page.tsx +++ b/src/app/[locale]/page.tsx @@ -2,6 +2,7 @@ import { Divider } from '@mantine/core'; import { HeroText } from '@/src/app/[locale]/component/HeroText'; import { FeaturesCards } from '@/src/app/[locale]/component/FeatureCards'; import CopyRightAlert from "@/src/app/[locale]/component/CopyRightAlert"; +import React from 'react'; export default function HomePage() { return ( From f3a72a5829ff5d1b807c48cd0da1aa290b0fa557 Mon Sep 17 00:00:00 2001 From: chun-awa <110163919+chun-awa@users.noreply.github.com> Date: Sat, 18 Jan 2025 16:15:41 +0800 Subject: [PATCH 2/3] chore: lock --- yarn.lock | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/yarn.lock b/yarn.lock index e85874f..6483bb6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6689,6 +6689,14 @@ next@14.2.21: "@next/swc-win32-ia32-msvc" "14.2.21" "@next/swc-win32-x64-msvc" "14.2.21" +nextjs-toploader@^3.6.15: + version "3.7.15" + resolved "https://registry.yarnpkg.com/nextjs-toploader/-/nextjs-toploader-3.7.15.tgz#2baba98b3d11c2001ab0639004ae5214d0e65f30" + integrity sha512-DvvXEJVRPfE2j1HVXgFhmPl8pRcLb/4mvyVBDuYdMdkbEY7KJghp0fG5iOZ002cV6awbBw9j/Di7vQL8LRazxQ== + dependencies: + nprogress "^0.2.0" + prop-types "^15.8.1" + no-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" @@ -6755,6 +6763,11 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" +nprogress@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/nprogress/-/nprogress-0.2.0.tgz#cb8f34c53213d895723fcbab907e9422adbcafb1" + integrity sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA== + nth-check@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" From 73c80b2121ae9b55a9771d4f75c8e451c58c9b00 Mon Sep 17 00:00:00 2001 From: chun-awa <110163919+chun-awa@users.noreply.github.com> Date: Sat, 18 Jan 2025 16:24:02 +0800 Subject: [PATCH 3/3] fix: remove React --- next-env.d.ts | 2 +- src/app/[locale]/downloads/page.tsx | 1 - src/app/[locale]/page.tsx | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/next-env.d.ts b/next-env.d.ts index 4f11a03..40c3d68 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. diff --git a/src/app/[locale]/downloads/page.tsx b/src/app/[locale]/downloads/page.tsx index b04b1d0..4dd9c4d 100644 --- a/src/app/[locale]/downloads/page.tsx +++ b/src/app/[locale]/downloads/page.tsx @@ -2,7 +2,6 @@ import { Container, Group, Space, Stack, Text, Title } from '@mantine/core'; import { useTranslations } from 'next-intl'; -import React from 'react'; import { LatestBanner } from '@/src/app/[locale]/downloads/component/LatestBanner'; import React from 'react'; diff --git a/src/app/[locale]/page.tsx b/src/app/[locale]/page.tsx index c9c4e3f..dd2956a 100644 --- a/src/app/[locale]/page.tsx +++ b/src/app/[locale]/page.tsx @@ -1,5 +1,4 @@ import { Divider } from '@mantine/core'; -import React from 'react'; import { HeroText } from '@/src/app/[locale]/component/HeroText'; import { FeaturesCards } from '@/src/app/[locale]/component/FeatureCards'; import CopyRightAlert from "@/src/app/[locale]/component/CopyRightAlert";