mirror of
https://github.com/emuplace/sudachi.emuplace.app.git
synced 2025-05-10 10:46:26 +02:00
Init template
This commit is contained in:
commit
c7020592dc
18 changed files with 2574 additions and 0 deletions
14
src/App.tsx
Normal file
14
src/App.tsx
Normal file
|
@ -0,0 +1,14 @@
|
|||
import "@mantine/core/styles.css";
|
||||
import { MantineProvider } from "@mantine/core";
|
||||
import { theme } from "./theme";
|
||||
import { Welcome } from "./Welcome/Welcome";
|
||||
import { ColorSchemeToggle } from "./ColorSchemeToggle/ColorSchemeToggle";
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<MantineProvider theme={theme}>
|
||||
<Welcome />
|
||||
<ColorSchemeToggle />
|
||||
</MantineProvider>
|
||||
);
|
||||
}
|
13
src/ColorSchemeToggle/ColorSchemeToggle.tsx
Normal file
13
src/ColorSchemeToggle/ColorSchemeToggle.tsx
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { Button, Group, useMantineColorScheme } from '@mantine/core';
|
||||
|
||||
export function ColorSchemeToggle() {
|
||||
const { setColorScheme } = useMantineColorScheme();
|
||||
|
||||
return (
|
||||
<Group justify="center" mt="xl">
|
||||
<Button onClick={() => setColorScheme('light')}>Light</Button>
|
||||
<Button onClick={() => setColorScheme('dark')}>Dark</Button>
|
||||
<Button onClick={() => setColorScheme('auto')}>Auto</Button>
|
||||
</Group>
|
||||
);
|
||||
}
|
22
src/Welcome/Welcome.css.ts
Normal file
22
src/Welcome/Welcome.css.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
import { style } from "@vanilla-extract/css";
|
||||
import { vars } from "../theme";
|
||||
import { rem } from "@mantine/core";
|
||||
|
||||
export const title = style({
|
||||
color: vars.colors.black,
|
||||
fontSize: rem(100),
|
||||
fontWeight: 900,
|
||||
letterSpacing: rem(-2),
|
||||
|
||||
selectors: {
|
||||
[vars.darkSelector]: {
|
||||
color: vars.colors.white,
|
||||
},
|
||||
},
|
||||
|
||||
"@media": {
|
||||
[vars.smallerThan("md")]: {
|
||||
fontSize: rem(50),
|
||||
},
|
||||
},
|
||||
});
|
28
src/Welcome/Welcome.tsx
Normal file
28
src/Welcome/Welcome.tsx
Normal file
|
@ -0,0 +1,28 @@
|
|||
import { Title, Text, Anchor } from "@mantine/core";
|
||||
import * as classes from "./Welcome.css";
|
||||
|
||||
export function Welcome() {
|
||||
return (
|
||||
<>
|
||||
<Title className={classes.title} ta="center" mt={100}>
|
||||
Welcome to{" "}
|
||||
<Text
|
||||
inherit
|
||||
variant="gradient"
|
||||
component="span"
|
||||
gradient={{ from: "pink", to: "yellow" }}
|
||||
>
|
||||
Mantine
|
||||
</Text>
|
||||
</Title>
|
||||
<Text color="dimmed" ta="center" size="lg" maw={580} mx="auto" mt="xl">
|
||||
This starter Vite project includes a minimal setup, if you want to learn
|
||||
more on Mantine + Vite integration follow{" "}
|
||||
<Anchor href="https://mantine.dev/guides/vite/" size="lg">
|
||||
this guide
|
||||
</Anchor>
|
||||
. To get started edit pages/Home.page.tsx file.
|
||||
</Text>
|
||||
</>
|
||||
);
|
||||
}
|
9
src/main.tsx
Normal file
9
src/main.tsx
Normal file
|
@ -0,0 +1,9 @@
|
|||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import App from "./App.tsx";
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
);
|
5
src/theme.ts
Normal file
5
src/theme.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { createTheme } from "@mantine/core";
|
||||
import { themeToVars } from "@mantine/vanilla-extract";
|
||||
|
||||
export const theme = createTheme({});
|
||||
export const vars = themeToVars(theme);
|
1
src/vite-env.d.ts
vendored
Normal file
1
src/vite-env.d.ts
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/// <reference types="vite/client" />
|
Loading…
Add table
Add a link
Reference in a new issue