diff --git a/console/client/src/sections/console/containers/index.js b/console/client/src/sections/console/containers/index.js index 2762726..2fff934 100644 --- a/console/client/src/sections/console/containers/index.js +++ b/console/client/src/sections/console/containers/index.js @@ -35,6 +35,13 @@ function calculateIntersection (cx, cy, d, angle) { function Index (props) { const xyCvs = useRef() const xzCvs = useRef() + const [darkModde] = useState(true) + const [darkColor] = useState({ + background: '#1E1E1E', + textColor: '#F5F5F5', + subTextColor: '#D3D3D3', + shadow: '#303030' + }) useEffect(() => { const canvasArea = document.getElementById('canvasArea') @@ -51,6 +58,10 @@ function Index (props) { // 画圆 xyCtx.beginPath(); xyCtx.arc(...center, diameter / 2, 0, 2 * Math.PI); + if (darkModde) { + xyCtx.strokeStyle = darkColor.subTextColor; + // xyCtx.fill(); + } xyCtx.stroke(); // 圆心圆 xyCtx.beginPath(); @@ -393,20 +404,29 @@ function Index (props) { } initCanvas() }, []) + console.log(darkColor, darkModde ? darkColor.textColor : 'auto'); + const cardStyle = { + boxShadow: `0 0 10px ${darkModde ? darkColor.shadow : 'rgba(0, 0, 0, 0.2)'}`, + color: darkModde ? darkColor.textColor : 'auto' + } return ( -
{s.v}
- {s.s} +{s.v}
+ {s.s} > : '' } diff --git a/console/client/src/sections/console/style.less b/console/client/src/sections/console/style.less index b781f52..2a9f98d 100644 --- a/console/client/src/sections/console/style.less +++ b/console/client/src/sections/console/style.less @@ -1,5 +1,4 @@ .card { - background-color: #ffffff; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); padding: 16px;