diff --git a/package.json b/package.json index 24300049d..784efffe0 100644 --- a/package.json +++ b/package.json @@ -43,8 +43,10 @@ "next": "^13.4.19", "react": "^18.2.0", "react-dom": "^18.2.0", + "react-fuzzysort": "^1.0.1", "satori": "^0.10.4", "vite-node": "^0.34.4", + "vitepress": "^1.0.0-rc.12", "vitepress-plugin-auto-sidebar": "^1.1.0" }, "devDependencies": { @@ -58,7 +60,6 @@ "compare-versions": "^6.1.0", "knip": "^2.22.0", "prettier": "^3.0.3", - "typescript": "^5.2.2", - "vitepress": "^1.0.0-rc.10" + "typescript": "^5.2.2" } } diff --git a/public/assets/banners/inactive.png b/public/assets/banners/inactive.png new file mode 100644 index 000000000..0eef8d526 Binary files /dev/null and b/public/assets/banners/inactive.png differ diff --git a/public/assets/banners/more.png b/public/assets/banners/more.png new file mode 100644 index 000000000..80969fc5f Binary files /dev/null and b/public/assets/banners/more.png differ diff --git a/public/assets/banners/player.png b/public/assets/banners/player.png new file mode 100644 index 000000000..218853946 Binary files /dev/null and b/public/assets/banners/player.png differ diff --git a/public/assets/banners/ratings.png b/public/assets/banners/ratings.png new file mode 100644 index 000000000..11867c046 Binary files /dev/null and b/public/assets/banners/ratings.png differ diff --git a/public/assets/banners/tank.png b/public/assets/banners/tank.png new file mode 100644 index 000000000..4bb22331c Binary files /dev/null and b/public/assets/banners/tank.png differ diff --git a/src/app/layout.tsx b/src/app/layout.tsx index a89ebffd7..14b9ba56e 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,3 +1,4 @@ +import { Roboto_Flex } from 'next/font/google'; import { ReactNode } from 'react'; import Navbar from '../components/Navbar'; @@ -5,9 +6,14 @@ interface RootLayoutProps { children: ReactNode; } +const robotoFlex = Roboto_Flex({ + subsets: ['latin'], + display: 'swap', +}); + export default function RootLayout({ children }: RootLayoutProps) { return ( - + - {children} +
+ {children} +
diff --git a/src/app/page.tsx b/src/app/page.tsx index e85d5092c..f63a18399 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,3 +1,131 @@ +'use client'; + +import { CaretRightIcon } from '@radix-ui/react-icons'; +import Link from 'next/link'; +import { useRef } from 'react'; +import { Search, SearchItem } from 'react-fuzzysort'; +import { SearchBar } from '../components/SearchBar'; +import { theme } from '../stitches.config'; + +const TOOLS = [ + { + title: 'Ratings', + description: 'Current and old season leader boards', + banner: '/assets/banners/ratings.png', + href: '/tools/ratings', + }, + { + title: 'Tankopedia', + description: 'Full Blitz tank encyclopedia', + banner: '/assets/banners/tank.png', + href: '/tools/tankopedia', + }, + { + title: 'Inactivity tracker', + description: 'Find inactive members of a clan', + banner: '/assets/banners/inactive.png', + href: '/tools/inactive', + }, + { + title: 'Player profile', + description: "A player's basic non-statistical info", + banner: '/assets/banners/player.png', + href: '/tools/profile', + }, + { + title: 'More coming soon', + description: 'New tools are added often', + banner: '/assets/banners/more.png', + href: 'https://discord.gg/nDt7AjGJQH', + }, +]; + export default function Page() { - return

Hello, Next.js!

; + const input = useRef(null); + + return ( +
+ + +
+ + ({ + node: ( + +
+ + {tool.title} + + + + {tool.description} + +
+ + ), + query: `${tool.title} ${tool.description}`, + }) satisfies SearchItem, + )} + /> +
+
+ ); } diff --git a/src/components/Navbar/components/Button.tsx b/src/components/Navbar/components/Button.tsx index 8be3c2f18..123a464c5 100644 --- a/src/components/Navbar/components/Button.tsx +++ b/src/components/Navbar/components/Button.tsx @@ -1,5 +1,4 @@ import { ReactNode } from 'react'; -import { theme } from '../../../stitches.config'; interface ButtonProps { children: ReactNode; @@ -9,7 +8,7 @@ export function Button({ children }: ButtonProps) { return ( - + + + diff --git a/src/components/SearchBar.tsx b/src/components/SearchBar.tsx new file mode 100644 index 000000000..ce89f298f --- /dev/null +++ b/src/components/SearchBar.tsx @@ -0,0 +1,45 @@ +import { MagnifyingGlassIcon } from '@radix-ui/react-icons'; +import { ComponentProps, forwardRef, useImperativeHandle, useRef } from 'react'; +import { theme } from '../stitches.config'; + +export const SearchBar = forwardRef>( + (props, ref) => { + const input = useRef(null); + + useImperativeHandle(ref, () => input.current!); + + return ( +
input.current?.focus()} + > + + +
+ ); + }, +); diff --git a/yarn.lock b/yarn.lock index 90a477f3c..0bc5e8623 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1917,6 +1917,11 @@ lodash.curry@^4.1.1: resolved "https://registry.yarnpkg.com/lodash.curry/-/lodash.curry-4.1.1.tgz#248e36072ede906501d75966200a86dab8b23170" integrity sha512-/u14pXGviLaweY5JI0IUzgzF2J6Ne8INyzAZjImcryjgkZ+ebruBxy2/JaOOkTqScddcYtakjhSaeemV8lR0tA== +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== + lodash.snakecase@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" @@ -2293,6 +2298,14 @@ react-dom@^18.2.0: loose-envify "^1.1.0" scheduler "^0.23.0" +react-fuzzysort@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/react-fuzzysort/-/react-fuzzysort-1.0.1.tgz#2878c891394f8af21bd79e3d57052f3fa90d41dd" + integrity sha512-RYhOsnX38KmJ0OywZrCiuMCsodL3zES69w6QlYbXxboPBO67REO7YWt98Lc8F+HZRQGArzpNemsufSW065UmFw== + dependencies: + fuzzysort "^2.0.4" + lodash.debounce "^4.0.8" + react@^18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" @@ -2416,7 +2429,7 @@ shell-quote-word@^1.0.1: resolved "https://registry.yarnpkg.com/shell-quote-word/-/shell-quote-word-1.0.1.tgz#e2bdfd22d599fd68886491677e38f560f9d469c9" integrity sha512-lT297f1WLAdq0A4O+AknIFRP6kkiI3s8C913eJ0XqBxJbZPGWUNkRQk2u8zk4bEAjUJ5i+fSLwB6z1HzeT+DEg== -shiki@^0.14.3: +shiki@^0.14.4: version "0.14.4" resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.14.4.tgz#2454969b466a5f75067d0f2fa0d7426d32881b20" integrity sha512-IXCRip2IQzKwxArNNq1S+On4KPML3Yyn8Zzs/xRgcgOWIr8ntIK3IKzjFPfjy/7kt9ZMjc+FItfqHRBg8b6tNQ== @@ -2660,10 +2673,10 @@ vitepress-plugin-auto-sidebar@^1.1.0: resolved "https://registry.yarnpkg.com/vitepress-plugin-auto-sidebar/-/vitepress-plugin-auto-sidebar-1.1.0.tgz#d8131e31143e99b6e142cb7d23b9323a578a862b" integrity sha512-LgkpjKVlNlQS54PFv5R/Y4+CHtHoXsJ3xgyVTKNi0sG1fXUmViKCg3Hnl9eo/SfNn894qsNRXoNneQmRBP2Lmw== -vitepress@^1.0.0-rc.10: - version "1.0.0-rc.10" - resolved "https://registry.yarnpkg.com/vitepress/-/vitepress-1.0.0-rc.10.tgz#c33361e84a1ad64d3eb3039dc302dc4f00054585" - integrity sha512-+MsahIWqq5WUEmj6MR4obcKYbT7im07jZPCQPdNJExkeOSbOAJ4xypSLx88x7rvtzWHhHc5aXbOhCRvGEGjFrw== +vitepress@^1.0.0-rc.12: + version "1.0.0-rc.12" + resolved "https://registry.yarnpkg.com/vitepress/-/vitepress-1.0.0-rc.12.tgz#474fbbc248aad02cf27246badc266dd0ebadc3e2" + integrity sha512-mZknN5l9lgbBjXwumwdOQQDM+gPivswFEykEQeenY0tv7eocS+bb801IpFZT3mFV6YRhSddmbutHlFgPPADjEg== dependencies: "@docsearch/css" "^3.5.2" "@docsearch/js" "^3.5.2" @@ -2673,7 +2686,7 @@ vitepress@^1.0.0-rc.10: focus-trap "^7.5.2" mark.js "8.11.1" minisearch "^6.1.0" - shiki "^0.14.3" + shiki "^0.14.4" vite "^4.4.9" vue "^3.3.4"