diff --git a/public/video/enter.webm b/public/video/enter.webm index ac37293..9d2a494 100644 Binary files a/public/video/enter.webm and b/public/video/enter.webm differ diff --git a/public/video/floor1.webm b/public/video/floor1.webm new file mode 100644 index 0000000..463865a Binary files /dev/null and b/public/video/floor1.webm differ diff --git a/src/App.js b/src/App.js index b7649fa..84f5d1a 100644 --- a/src/App.js +++ b/src/App.js @@ -7,6 +7,7 @@ import { useEffect, useState } from "react"; import Home from "./pages/Home"; import EnergyAnalysis from "./pages/EnergyCostAnalysis"; import RulerContainer from "./components/Tools/Ruler"; +import { Switch } from "antd"; import { createPortal } from "react-dom"; const Menus = ["窑炉总览", "窑炉内部", "退火监测", "质检统计", "能耗分析"]; @@ -14,16 +15,23 @@ const Menus = ["窑炉总览", "窑炉内部", "退火监测", "质检统计", " function App() { const { styles, value, setValue } = useSlider(100); const [navActive, setNavActive] = useState("窑炉总览"); + const [lunbo, setlunbo] = useState(false); useEffect(() => { - const timer = setInterval(() => { - handleMenuChange(Menus[(Menus.indexOf(navActive) + 1) % Menus.length]); - }, 10000); - + let timer; + if (lunbo) { + timer = setInterval(() => { + handleMenuChange(Menus[(Menus.indexOf(navActive) + 1) % Menus.length]); + }, 5000); + } return () => { clearInterval(timer); }; - }, [navActive]); + }, [lunbo, navActive]); + + function handleSwitchChange(val) { + setlunbo(val); + } function handleMenuChange(value) { setNavActive(value); @@ -34,7 +42,25 @@ function App() {