Răsfoiți Sursa

Intermediate

AXCWG 1 lună în urmă
părinte
comite
0ef6437e0f
4 a modificat fișierele cu 58 adăugiri și 66 ștergeri
  1. 2 54
      README.md
  2. 42 10
      src/App.tsx
  3. 12 0
      src/main.css
  4. 2 2
      src/main.tsx

+ 2 - 54
README.md

@@ -1,54 +1,2 @@
-# React + TypeScript + Vite
-
-This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
-
-Currently, two official plugins are available:
-
-- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
-- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
-
-## Expanding the ESLint configuration
-
-If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
-
-```js
-export default tseslint.config({
-  extends: [
-    // Remove ...tseslint.configs.recommended and replace with this
-    ...tseslint.configs.recommendedTypeChecked,
-    // Alternatively, use this for stricter rules
-    ...tseslint.configs.strictTypeChecked,
-    // Optionally, add this for stylistic rules
-    ...tseslint.configs.stylisticTypeChecked,
-  ],
-  languageOptions: {
-    // other options...
-    parserOptions: {
-      project: ['./tsconfig.node.json', './tsconfig.app.json'],
-      tsconfigRootDir: import.meta.dirname,
-    },
-  },
-})
-```
-
-You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
-
-```js
-// eslint.config.js
-import reactX from 'eslint-plugin-react-x'
-import reactDom from 'eslint-plugin-react-dom'
-
-export default tseslint.config({
-  plugins: {
-    // Add the react-x and react-dom plugins
-    'react-x': reactX,
-    'react-dom': reactDom,
-  },
-  rules: {
-    // other rules...
-    // Enable its recommended typescript rules
-    ...reactX.configs['recommended-typescript'].rules,
-    ...reactDom.configs.recommended.rules,
-  },
-})
-```
+# AirPlayer 在线播放器
+在线播放器,暂时没有README。

+ 42 - 10
src/App.tsx

@@ -1,16 +1,18 @@
-import Split from "react-split";
-import {Grid, NavLink} from "@mantine/core";
+import {Container, Grid, NavLink, Table} from "@mantine/core";
 import {useMediaQuery} from "@mantine/hooks";
 import {NavLink as RNavLink} from 'react-router-dom'
+import Split from "react-split";
+
 
 function App() {
-    const isTabletOrMobile = useMediaQuery( '(max-width: 768px)' );
+    const isTabletOrMobile = useMediaQuery('(max-width: 768px)');
 
     return (
         <>
             {
-                !isTabletOrMobile && <Grid>
-                    <Grid.Col span={2} >
+                !isTabletOrMobile &&
+                <div style={{ height: "100vh", display: "flex", flexDirection: "row"}}>
+                    <div style={{minWidth: "10rem"}}>
                         <div style={{display: "flex", flexDirection: "column", height: "100vh"}}>
                             <NavLink component={RNavLink} to={"/user"} label={"用户"}></NavLink>
                             <NavLink component={RNavLink} to={"/"} label={"播放器"}></NavLink>
@@ -18,11 +20,41 @@ function App() {
                                 <NavLink label={"登出"}></NavLink>
                             </div>
                         </div>
-                    </Grid.Col>
-                    <Grid.Col span={10} style={{backgroundColor: "gray"}}>
-
-                    </Grid.Col>
-                </Grid>
+                    </div>
+                    <div style={{flexGrow: 1}}>
+                        <Split style={{height: "100%"}}
+                            className="split" gutterSize={5}
+                               sizes={[30, 70]}
+                        >
+                            <div>
+                                <Table  highlightOnHover={true} striped withTableBorder={true}>
+                                    <Table.Tbody>
+                                        <Table.Tr>
+                                            2
+                                        </Table.Tr><Table.Tr>
+                                        2
+                                    </Table.Tr><Table.Tr>
+                                        2
+                                    </Table.Tr><Table.Tr>
+                                        2
+                                    </Table.Tr>
+                                    </Table.Tbody>
+                                </Table>
+                            </div>
+                            <div id={"l-1"}>
+                                <Split
+                                    direction={"vertical"}
+                                    style={{height: "100%"}}
+                                    gutterSize={5}
+                                    sizes={[80,20]}
+                                >
+                                    <div>aa</div>
+                                    <div>bb</div>
+                                </Split>
+                            </div>
+                        </Split>
+                    </div>
+                </div>
             }
 
 

+ 12 - 0
src/main.css

@@ -12,5 +12,17 @@
 .gutter.gutter-horizontal {
     background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
     cursor: col-resize;
+}
+#l-1{
+
+    .gutter {
+        background-color: #eee;
+        background-repeat: no-repeat;
+        background-position: 50%;
+    }
 
+    .gutter.gutter-vertical {
+        background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII=');
+        cursor: row-resize;
+    }
 }

+ 2 - 2
src/main.tsx

@@ -1,7 +1,7 @@
-import React, {ReactNode, StrictMode} from 'react'
+import {ReactNode, StrictMode} from 'react'
 import {createRoot} from 'react-dom/client'
 import App from './App.tsx'
-import {AppShell, Burger, MantineProvider} from "@mantine/core";
+import {AppShell, MantineProvider} from "@mantine/core";
 import './main.css'
 import '@mantine/core/styles.css';
 import {BrowserRouter, Route, Routes} from "react-router-dom";