-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
149 changed files
with
6,096 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["@nx/js/babel"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"extends": ["plugin:@nx/react", "../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"parserOptions": { | ||
"project": "tsconfig.eslint.json" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": { | ||
"@typescript-eslint/consistent-type-imports": "error" | ||
} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# zzz-frontend | ||
|
||
Frontend code for static Star Rail Optimizer. | ||
|
||
## Dev Server | ||
|
||
Run `nx serve zzz-frontend` | ||
|
||
## Preview | ||
|
||
To preview the production build locally, run `nx build zzz-frontend` and then `nx preview zzz-frontend` | ||
|
||
## Adding new assets | ||
|
||
Either add assets to `apps/zzz-frontend/assets` or configure the call to `viteStaticCopy` in `vite.config.mts` to copy library assets to the `assets` folder. | ||
|
||
You can then reference them without any leading path, e.g. `notification.mp3`. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Zenless Optimizer</title> | ||
<base href="" /> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" /> | ||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" /> | ||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" /> | ||
<link rel="manifest" href="/site.webmanifest" /> | ||
<link rel="stylesheet" href="src/styles.scss" /> | ||
</head> | ||
<body> | ||
<script type="module" src="src/main.tsx"></script> | ||
<div id="root"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "zzz-frontend", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"projectType": "application", | ||
"sourceRoot": "apps/zzz-frontend/src", | ||
"tags": [], | ||
"// targets": "to see all targets run: nx show project zzz-frontend --web", | ||
"targets": { | ||
"typecheck": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"cwd": "apps/zzz-frontend", | ||
"commands": ["tsc -p tsconfig.app.json --noEmit"] | ||
}, | ||
"dependsOn": ["eslint:lint"] | ||
}, | ||
"build": { | ||
"cache": false | ||
} | ||
}, | ||
"implicitDependencies": [ | ||
"common-localization", | ||
"sr-localization", | ||
"sr-dm-localization" | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "Star Rail Optimizer", | ||
"short_name": "SRO", | ||
"icons": [ | ||
{ | ||
"src": "/android-chrome-192x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/android-chrome-512x512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
], | ||
"theme_color": "#1b263b", | ||
"background_color": "#0C1020", | ||
"display": "standalone" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { ScrollTop } from '@genshin-optimizer/common/ui' | ||
import '@genshin-optimizer/sr/i18n' // import to load translations | ||
import { theme } from '@genshin-optimizer/sr/theme' | ||
import { DatabaseProvider } from '@genshin-optimizer/zzz/db-ui' | ||
import { | ||
Box, | ||
Container, | ||
CssBaseline, | ||
Skeleton, | ||
StyledEngineProvider, | ||
ThemeProvider, | ||
} from '@mui/material' | ||
import { Suspense, lazy } from 'react' | ||
import { HashRouter, Route, Routes } from 'react-router-dom' | ||
import Header from './Header' | ||
import PageHome from './PageHome' | ||
|
||
const PageDiscs = lazy(() => import('@genshin-optimizer/zzz/page-discs')) | ||
const PageOptimize = lazy(() => import('@genshin-optimizer/zzz/page-optimize')) | ||
|
||
const PageSettings = lazy(() => import('@genshin-optimizer/zzz/page-settings')) | ||
|
||
export default function App() { | ||
return ( | ||
<StyledEngineProvider injectFirst> | ||
{/* https://mui.com/guides/interoperability/#css-injection-order-2 */} | ||
<ThemeProvider theme={theme}> | ||
<CssBaseline enableColorScheme /> | ||
<DatabaseProvider> | ||
<HashRouter basename="/"> | ||
<Content /> | ||
<ScrollTop /> | ||
</HashRouter> | ||
</DatabaseProvider> | ||
</ThemeProvider> | ||
</StyledEngineProvider> | ||
) | ||
} | ||
|
||
function Content() { | ||
return ( | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
minHeight="100vh" | ||
position="relative" | ||
> | ||
<Header anchor="back-to-top-anchor" /> | ||
|
||
<Container maxWidth="xl" sx={{ px: { xs: 0.5, sm: 1 } }}> | ||
<Suspense | ||
fallback={ | ||
<Skeleton | ||
variant="rectangular" | ||
sx={{ width: '100%', height: '100%' }} | ||
/> | ||
} | ||
> | ||
<Routes> | ||
<Route index element={<PageHome />} /> | ||
<Route path="/discs" element={<PageDiscs />} /> | ||
<Route path="/optimize" element={<PageOptimize />} /> | ||
<Route path="/settings" element={<PageSettings />} /> | ||
</Routes> | ||
</Suspense> | ||
</Container> | ||
</Box> | ||
) | ||
} |
Oops, something went wrong.