Initial screen starter scaffold
This commit is contained in:
commit
d136b9dddc
49 files changed
+2966
No files matched your search
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>__PROJECT_TITLE__</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "__PROJECT_NAME__",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --host 0.0.0.0",
|
||||
"build": "tsc --noEmit && vite build",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dev-screen-starter/charts": "workspace:*",
|
||||
"@dev-screen-starter/data": "workspace:*",
|
||||
"@dev-screen-starter/debug": "workspace:*",
|
||||
"@dev-screen-starter/screen-core": "workspace:*",
|
||||
"@vitejs/plugin-react": "^5.0.4",
|
||||
"echarts": "^6.0.0",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"vite": "^7.1.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^19.1.16",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"typescript": "^5.9.2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { MetricCard, ScreenStage } from '@dev-screen-starter/screen-core'
|
||||
|
||||
export function ProjectScreen() {
|
||||
return (
|
||||
<ScreenStage background="#061826">
|
||||
<header className="screen-title">
|
||||
<span>__PROJECT_TITLE__</span>
|
||||
<strong>大屏总览</strong>
|
||||
</header>
|
||||
|
||||
<section className="metric-row">
|
||||
<MetricCard label="指标一" value="--" />
|
||||
<MetricCard label="指标二" value="--" />
|
||||
<MetricCard label="指标三" value="--" />
|
||||
</section>
|
||||
</ScreenStage>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { ProjectScreen } from './ProjectScreen'
|
||||
import './screen.css'
|
||||
|
||||
createRoot(document.getElementById('root')!).render(<ProjectScreen />)
|
||||
@@ -0,0 +1,82 @@
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: #05090d;
|
||||
color: #dce8f5;
|
||||
font-family:
|
||||
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
}
|
||||
|
||||
.screen-viewport {
|
||||
background: #05090d;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
.screen-stage {
|
||||
left: 50%;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform-origin: center center;
|
||||
}
|
||||
|
||||
.screen-title {
|
||||
left: 56px;
|
||||
position: absolute;
|
||||
top: 42px;
|
||||
}
|
||||
|
||||
.screen-title span {
|
||||
color: #88a1bd;
|
||||
display: block;
|
||||
font-size: 16px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.screen-title strong {
|
||||
color: #f1f7ff;
|
||||
font-size: 42px;
|
||||
}
|
||||
|
||||
.metric-row {
|
||||
display: grid;
|
||||
gap: 24px;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
left: 56px;
|
||||
position: absolute;
|
||||
right: 56px;
|
||||
top: 150px;
|
||||
}
|
||||
|
||||
.metric-card {
|
||||
background: rgb(9 26 42 / 88%);
|
||||
border: 1px solid rgb(88 130 171 / 42%);
|
||||
border-radius: 8px;
|
||||
min-height: 148px;
|
||||
padding: 22px 24px;
|
||||
}
|
||||
|
||||
.metric-card span {
|
||||
color: #9fb4cc;
|
||||
display: block;
|
||||
font-size: 16px;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.metric-card strong {
|
||||
color: #f0f7ff;
|
||||
font-size: 48px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.metric-card small {
|
||||
color: #9fb4cc;
|
||||
font-size: 18px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
"types": ["vite/client"]
|
||||
},
|
||||
"include": ["src", "vite.config.ts"]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { defineConfig } from 'vite'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()]
|
||||
})
|
||||
Reference in new issue
Block a user