diff --git a/AGENTS.md b/AGENTS.md index 57c0dc4..6dcb247 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -129,6 +129,29 @@ refactor(plot): extract QuadraturePlot into shared integration component ♻️ +### Pull request descriptions + +- **Title:** the same Conventional Commits form as the commit subject, e.g. `feat(galerkin): Legendre basis option`. Keep it under 70 characters. +- **Body:** use these sections in order. Leave out a section only if it truly does not apply. + + ```md + ## Summary + One or two sentences: what changes for the user or the codebase, and why. + + ## Changes + - Bullet per user-visible change, or per notable code change. + + ## Testing + - Commands run and their result (`bun run lint`, `bun run build`, `bunx tsc --noEmit`). + - Manual checks done in the browser, and any that are still open. + + ## Notes + Base branch, follow-ups, screenshots, or anything a reviewer must know. + ``` + +- Write for a reviewer who has not seen the conversation. Say what was not verified. +- Keep it short. A PR with more than about ten bullets should be split. + ## This is NOT the Next.js you know This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices. diff --git a/app/(workspace)/methods/galerkin/page.tsx b/app/(workspace)/methods/galerkin/page.tsx new file mode 100644 index 0000000..8a91973 --- /dev/null +++ b/app/(workspace)/methods/galerkin/page.tsx @@ -0,0 +1,50 @@ +import type { Metadata } from 'next'; +import { GalerkinMethod } from '@/components/galerkin-method'; +import { MethodJsonLd } from '@/components/seo/json-ld'; +import { siteConfig } from '@/lib/config'; + +export const metadata: Metadata = { + title: 'Galerkin Method | Метод Галеркина | Galyorkin usuli', + description: + 'Solve second-order linear boundary value problems step by step with the Galerkin method. Метод Галеркина для краевой задачи. Galyorkin usuli bilan chegaraviy masalani bosqichma-bosqich yeching.', + keywords: [ + 'galerkin method', + 'galerkin boundary value problem', + 'boundary value problem solver', + 'second order ODE solver', + 'numerical methods', + 'метод галеркина', + 'краевая задача метод галеркина', + 'galyorkin usuli', + 'chegaraviy masala galyorkin', + ], + alternates: { canonical: '/methods/galerkin' }, + openGraph: { + title: 'Galerkin Method Solver | Метод Галеркина', + description: + 'Build basis functions, Galerkin integrals, and a linear system for a second-order boundary value problem.', + url: `${siteConfig.url}/methods/galerkin`, + images: [{ url: '/images/og/collocation.png', width: 1200, height: 630, alt: 'Galyorkin usuli' }], + }, + twitter: { + card: 'summary_large_image', + title: 'Galerkin Method | Метод Галеркина', + description: 'Step-by-step Galerkin solution of a second-order boundary value problem.', + images: ['/images/og/collocation.png'], + }, +}; + +export default function GalerkinPage() { + return ( + <> + + + + ); +} diff --git a/app/globals.css b/app/globals.css index 13312fd..ffc32b7 100644 --- a/app/globals.css +++ b/app/globals.css @@ -83,10 +83,8 @@ body { margin: 0; min-width: 320px; background: var(--page-glow), var(--bg); - background-attachment: fixed; color: var(--ink); font-family: var(--font-sans); - transition: background .2s ease, color .2s ease; } button, input { font: inherit; } button { cursor: pointer; } @@ -151,7 +149,6 @@ ::view-transition-new(root) { z-index: 9999; } -/* When transitioning to dark, we can either expand the new dark theme, or shrink the old light theme */ /* Print Stream Navigation Top Loader */ #nprogress { @@ -217,3 +214,50 @@ } } + +/* Splash screen — logo mark animation */ +.splash-draw { + stroke-dasharray: 1; + stroke-dashoffset: 1; + animation: splash-draw 0.9s cubic-bezier(0.65, 0, 0.35, 1) var(--d, 0s) forwards; +} + +.splash-fill { + opacity: 0; + animation: splash-fade 0.6s ease var(--d, 0s) forwards; +} + +.splash-pop { + opacity: 0; + transform-box: fill-box; + transform-origin: center; + animation: splash-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) var(--d, 0s) forwards; +} + +@keyframes splash-draw { + to { stroke-dashoffset: 0; } +} + +@keyframes splash-fade { + to { opacity: 1; } +} + +@keyframes splash-pop { + from { opacity: 0; transform: scale(0); } + to { opacity: 1; transform: scale(1); } +} + +@media (prefers-reduced-motion: reduce) { + .splash-draw, + .splash-fill, + .splash-pop { + animation: none; + stroke-dashoffset: 0; + opacity: 1; + } +} + +/* Hide the page scrollbar while the splash screen is mounted */ +html:has(#app-splash) { + overflow: hidden; +} diff --git a/app/layout.tsx b/app/layout.tsx index 47d2ba7..868706a 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -2,6 +2,7 @@ import type { Metadata, Viewport } from "next"; import "./globals.css"; import { I18nProvider } from "@/components/i18n-provider"; import { TopLoader } from "@/components/top-loader"; +import { SplashScreen } from "@/components/splash-screen"; import { siteConfig } from "@/lib/config"; import { RootJsonLd } from "@/components/seo/json-ld"; @@ -136,6 +137,7 @@ try { /> + {children} diff --git a/components/about-page.tsx b/components/about-page.tsx index fb81226..adc1fd4 100644 --- a/components/about-page.tsx +++ b/components/about-page.tsx @@ -11,7 +11,6 @@ import { ExternalLink, FileCode2, Globe, - GraduationCap, Layers, LineChart, Mail, @@ -202,9 +201,17 @@ export function AboutPage() {
-
- -
+ {/* Static export serves the photo from public/, so a plain img is used */} + {/* eslint-disable-next-line @next/next/no-img-element */} + {t('about.author_name')}
@@ -247,11 +254,13 @@ export function AboutPage() { - {t('about.contact_email')} + {t('about.contact_message')} { @@ -201,6 +208,8 @@ export function AppShell({ ? t('nav.bvp') : pathname.startsWith('/methods/collocation') ? t('nav.collocation') + : pathname.startsWith('/methods/galerkin') + ? t('nav.galerkin') : pathname.startsWith('/methods/sweep') ? t('nav.sweep') : pathname.startsWith('/methods/lagrange') diff --git a/components/collocation-method.tsx b/components/collocation-method.tsx index cc9e39c..a76a913 100644 --- a/components/collocation-method.tsx +++ b/components/collocation-method.tsx @@ -19,6 +19,11 @@ import { type CollocationResult, } from '@/lib/collocation'; import { useI18n } from '@/components/i18n-provider'; +import { + exprTex, + operatorLhsTex, + type TexTerm, +} from '@/lib/galerkin'; const INITIAL: CollocationInput = { a2: '1', @@ -41,6 +46,31 @@ function tex(value: string): string { return value.replaceAll('*', '\\,').replaceAll('~', '').replaceAll('u', 'u'); } +// Live LaTeX of the typed problem; empty fields fall back to the defaults used by the solver +function fieldTerm(source: string, fallback: string): TexTerm { + if (!source.trim()) return { tex: fallback, atomic: true }; + try { + return exprTex(source); + } catch { + return { tex: '\\text{?}', atomic: true }; + } +} + +function problemTex(input: CollocationInput): string { + const lhs = operatorLhsTex( + fieldTerm(String(input.a2), '1'), + fieldTerm(String(input.a1), '0'), + fieldTerm(String(input.a0), '0'), + ); + return `${lhs}=${fieldTerm(String(input.f), '0').tex}`; +} + +function boundaryTex(input: CollocationInput): string[] { + const left = `${fieldTerm(String(input.alpha0), '1').tex}u(a)+${fieldTerm(String(input.alpha1), '0').tex}u'(a)=${fieldTerm(String(input.alphaValue), '0').tex}`; + const right = `${fieldTerm(String(input.beta0), '1').tex}u(b)+${fieldTerm(String(input.beta1), '0').tex}u'(b)=${fieldTerm(String(input.betaValue), '0').tex}`; + return [left, right]; +} + function formatApproximation(value: number): string { return Number(value.toFixed(8)).toString(); } @@ -263,14 +293,23 @@ export function CollocationMethod() { }, ]} /> -
-