zjl #1

Merged
juzi merged 4 commits from zjl into features/warning 2024-07-12 15:11:35 +08:00
21 changed files with 1510 additions and 628 deletions
Showing only changes of commit 4d7af62305 - Show all commits

Binary file not shown.

Binary file not shown.

BIN
src/assets/kilnSpeed.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,20 +1,30 @@
import BlueRect from "../BlueRect"; import BlueRect from "../BlueRect";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import { motion, AnimatePresence } from "framer-motion"; import { motion, AnimatePresence } from "framer-motion";
import { useEffect, useState } from "react";
const blueTe = [ const blueTe = ["TE401", "TE402", "TE403", "PE401", "PE402", "PE403"];
"TE401",
"TE402",
"TE403",
"PE401",
"PE402",
"PE403",
];
function TemperatureBottom(props) { function TemperatureBottom(props) {
const tempBottom = useSelector((state) => state.temperature.bottom); const tempBottom = useSelector((state) => state.temperature.bottom);
console.log(tempBottom) const speed = props.speed;
console.log('==================+++++++++++++') const floor = props.floor;
const [speedAn, setSpeedAn] = useState({});
useEffect(() => {
// 23
if (speed === "f") {
setSpeedAn({});
} else {
if (floor === 2) {
setSpeedAn({
opacity: [0, 0, 0, 0.6, 1],
transition: { duration: 0.3, delay: 1.8 },
});
} else {
setSpeedAn({});
}
}
}, [floor]);
return ( return (
<motion.div <motion.div
@ -26,15 +36,17 @@ function TemperatureBottom(props) {
width: "100%", width: "100%",
height: "80vh", height: "80vh",
zIndex: "-1", zIndex: "-1",
...props.style ...props.style,
}}
animate={{
opacity: [0, 0, 0, 0.6, 1],
transition: { duration: 0.3, delay: 2 },
}} }}
animate={speedAn}
> >
{Object.keys(tempBottom).map((d) => ( {Object.keys(tempBottom).map((d) => (
<BlueRect title={d} key={d + Math.random()} value={tempBottom[d]} blue={blueTe.includes(d)} /> <BlueRect
title={d}
key={d + Math.random()}
value={tempBottom[d]}
blue={blueTe.includes(d)}
/>
))} ))}
</motion.div> </motion.div>
); );

View File

@ -28,15 +28,20 @@ function TemperatureTop(props) {
width: "100%", width: "100%",
height: "80vh", height: "80vh",
zIndex: "-1", zIndex: "-1",
...props.style ...props.style,
}} }}
animate={{ animate={{
opacity: [0, 0, 0, 0.6, 1], opacity: [0, 0, 0, 0.6, 1],
transition: { duration: 0.3, delay: 2 }, transition: { duration: 0.3, delay: 1.5 },
}} }}
> >
{Object.keys(tempTop).map((d) => ( {Object.keys(tempTop).map((d) => (
<BlueRect title={d} key={d + Math.random()} value={tempTop[d]} blue={blueTe.includes(d)} /> <BlueRect
title={d}
key={d + Math.random()}
value={tempTop[d]}
blue={blueTe.includes(d)}
/>
))} ))}
</motion.div> </motion.div>
); );

View File

@ -1,10 +1,10 @@
import EnterVideo from './videoComponents/EnterVideo'; import EnterVideo from "./videoComponents/EnterVideo";
import EnterToFloorOne from './videoComponents/EnterToFloor1'; import EnterToFloorOne from "./videoComponents/EnterToFloor1";
import EnterToFloorTwo from './videoComponents/EnterToFloor2'; import EnterToFloorTwo from "./videoComponents/EnterToFloor2";
import FloorOneToTwo from './videoComponents/Floor1To2'; import FloorOneToTwo from "./videoComponents/Floor1To2";
import FloorTwoToOne from './videoComponents/Floor2To1'; import FloorTwoToOne from "./videoComponents/Floor2To1";
import { useRef, useEffect, useReducer } from 'react'; import { useRef, useEffect, useReducer } from "react";
import { AnimatePresence } from 'framer-motion'; import { AnimatePresence } from "framer-motion";
const initOpacity = { const initOpacity = {
enterVideo: 1, enterVideo: 1,
@ -15,21 +15,21 @@ const initOpacity = {
}; };
const opacityReducer = (state, action) => { const opacityReducer = (state, action) => {
switch (action.type) { switch (action.type) {
case 'enter-to-1': { case "enter-to-1": {
return { return {
...initOpacity, ...initOpacity,
enterToFloorOne: 1, enterToFloorOne: 1,
enterVideo: 0, enterVideo: 0,
}; };
} }
case 'enter-to-2': { case "enter-to-2": {
return { return {
...initOpacity, ...initOpacity,
enterToFloorTwo: 1, enterToFloorTwo: 1,
enterVideo: 0, enterVideo: 0,
}; };
} }
case 'floor-1-to-2': { case "floor-1-to-2": {
return { return {
...initOpacity, ...initOpacity,
floorOneToTwo: 1, floorOneToTwo: 1,
@ -38,7 +38,7 @@ const opacityReducer = (state, action) => {
floorTwoToOne: 0, floorTwoToOne: 0,
}; };
} }
case 'floor-2-to-1': { case "floor-2-to-1": {
return { return {
...initOpacity, ...initOpacity,
floorTwoToOne: 1, floorTwoToOne: 1,
@ -59,15 +59,15 @@ function VideoContainer(props) {
if (floor) { if (floor) {
if (floor == 1) { if (floor == 1) {
if (lastFloor.current == 2) { if (lastFloor.current == 2) {
dispatch({ type: 'floor-2-to-1' }); dispatch({ type: "floor-2-to-1" });
} else { } else {
dispatch({ type: 'enter-to-1' }); dispatch({ type: "enter-to-1" });
} }
} else if (floor == 2) { } else if (floor == 2) {
if (lastFloor.current == 1) { if (lastFloor.current == 1) {
dispatch({ type: 'floor-1-to-2' }); dispatch({ type: "floor-1-to-2" });
} else { } else {
dispatch({ type: 'enter-to-2' }); dispatch({ type: "enter-to-2" });
} }
} }
lastFloor.current = floor; lastFloor.current = floor;
@ -78,7 +78,7 @@ function VideoContainer(props) {
// //
props.onFloorUpdate(1); props.onFloorUpdate(1);
// floor1 one enter // floor1 one enter
dispatch({ type: 'enter-to-1' }); dispatch({ type: "enter-to-1" });
}; };
function handleEnterVideoEnd() { function handleEnterVideoEnd() {
@ -95,7 +95,11 @@ function VideoContainer(props) {
/> />
<EnterToFloorOne key="enter-to-1" opacity={opacity.enterToFloorOne} /> <EnterToFloorOne key="enter-to-1" opacity={opacity.enterToFloorOne} />
<EnterToFloorTwo key="enter-to-2" opacity={opacity.enterToFloorTwo} /> <EnterToFloorTwo key="enter-to-2" opacity={opacity.enterToFloorTwo} />
<FloorOneToTwo key="1-to-2" opacity={opacity.floorOneToTwo} /> <FloorOneToTwo
key="1-to-2"
opacity={opacity.floorOneToTwo}
floor={floor}
/>
<FloorTwoToOne key="2-to-1" opacity={opacity.floorTwoToOne} /> <FloorTwoToOne key="2-to-1" opacity={opacity.floorTwoToOne} />
</AnimatePresence> </AnimatePresence>
); );

View File

@ -19,7 +19,7 @@ function EnterToFloorOne(props) {
setTimeout(() => { setTimeout(() => {
// console.log("enter"); // console.log("enter");
setFireCanPlay(true); setFireCanPlay(true);
}, 5000); }, 1800);
} }
return () => { return () => {
// console.log("enter"); // console.log("enter");
@ -49,7 +49,7 @@ function EnterToFloorOne(props) {
<source src="/video/floor1.webm" type="video/mp4" /> <source src="/video/floor1.webm" type="video/mp4" />
</video> </video>
{/* {fireCanPlay && fireDir == "" && ( {fireCanPlay && fireDir == "东火" && (
<video <video
src="/video/fire_top.webm" src="/video/fire_top.webm"
muted muted
@ -68,7 +68,7 @@ function EnterToFloorOne(props) {
width={3900} width={3900}
style={{ position: "absolute", top: "-20px", left: "-20px" }} style={{ position: "absolute", top: "-20px", left: "-20px" }}
></video> ></video>
)} */} )}
<TemperatureTop <TemperatureTop
style={{ style={{

View File

@ -1,9 +1,8 @@
import { motion, AnimatePresence } from "framer-motion"; import { motion, AnimatePresence } from "framer-motion";
import { useRef, useEffect, useMemo, useState } from "react"; import { useRef, useEffect, useState } from "react";
import FeederStatus from "../../../../Common/Feeder"; import FeederStatus from "../../../../Common/Feeder";
import TemperatureTop from "../../../../../components/Common/TemperatureTop";
import TemperatureBottom from "../../../../Common/TemperatureBottom"; import TemperatureBottom from "../../../../Common/TemperatureBottom";
import { useSelector, useDispatch } from "react-redux"; import { useSelector } from "react-redux";
function FloorOneToTwo(props) { function FloorOneToTwo(props) {
const fireInfo = useSelector((state) => state.fireInfo); const fireInfo = useSelector((state) => state.fireInfo);
@ -13,6 +12,7 @@ function FloorOneToTwo(props) {
const vd = useRef(null); const vd = useRef(null);
const show = props.opacity || 0; const show = props.opacity || 0;
const speed = "s";
useEffect(() => { useEffect(() => {
if (show) { if (show) {
@ -20,7 +20,7 @@ function FloorOneToTwo(props) {
setTimeout(() => { setTimeout(() => {
// console.log("1-2"); // console.log("1-2");
setFireCanPlay(true); setFireCanPlay(true);
}, 3000); }, 2000);
} }
if (!show) setFireCanPlay(false); if (!show) setFireCanPlay(false);
return () => { return () => {
@ -81,6 +81,8 @@ function FloorOneToTwo(props) {
width: "2380px", width: "2380px",
zIndex: 0, zIndex: 0,
}} }}
speed={speed}
floor={props.floor}
/> />
<FeederStatus /> <FeederStatus />
</motion.div> </motion.div>

View File

@ -19,7 +19,7 @@ function FloorTwoToOne(props) {
setTimeout(() => { setTimeout(() => {
// console.log("2-1"); // console.log("2-1");
setFireCanPlay(true); setFireCanPlay(true);
}, 3000); }, 1800);
} }
if (!show) setFireCanPlay(false); if (!show) setFireCanPlay(false);
return () => { return () => {

View File

@ -1,10 +1,10 @@
import EnterVideo from './videoComponents/EnterVideo'; import EnterVideo from "./videoComponents/EnterVideo";
import EnterToFloorOne from './videoComponents/EnterToFloor1'; import EnterToFloorOne from "./videoComponents/EnterToFloor1";
import EnterToFloorTwo from './videoComponents/EnterToFloor2'; import EnterToFloorTwo from "./videoComponents/EnterToFloor2";
import FloorOneToTwo from './videoComponents/Floor1To2'; import FloorOneToTwo from "./videoComponents/Floor1To2";
import FloorTwoToOne from './videoComponents/Floor2To1'; import FloorTwoToOne from "./videoComponents/Floor2To1";
import { useRef, useEffect, useReducer } from 'react'; import { useRef, useEffect, useReducer } from "react";
import { AnimatePresence } from 'framer-motion'; import { AnimatePresence } from "framer-motion";
const initOpacity = { const initOpacity = {
enterVideo: 1, enterVideo: 1,
@ -15,21 +15,21 @@ const initOpacity = {
}; };
const opacityReducer = (state, action) => { const opacityReducer = (state, action) => {
switch (action.type) { switch (action.type) {
case 'enter-to-1': { case "enter-to-1": {
return { return {
...initOpacity, ...initOpacity,
enterToFloorOne: 1, enterToFloorOne: 1,
enterVideo: 0, enterVideo: 0,
}; };
} }
case 'enter-to-2': { case "enter-to-2": {
return { return {
...initOpacity, ...initOpacity,
enterToFloorTwo: 1, enterToFloorTwo: 1,
enterVideo: 0, enterVideo: 0,
}; };
} }
case 'floor-1-to-2': { case "floor-1-to-2": {
return { return {
...initOpacity, ...initOpacity,
floorOneToTwo: 1, floorOneToTwo: 1,
@ -38,7 +38,7 @@ const opacityReducer = (state, action) => {
floorTwoToOne: 0, floorTwoToOne: 0,
}; };
} }
case 'floor-2-to-1': { case "floor-2-to-1": {
return { return {
...initOpacity, ...initOpacity,
floorTwoToOne: 1, floorTwoToOne: 1,
@ -52,22 +52,33 @@ const opacityReducer = (state, action) => {
function VideoContainer(props) { function VideoContainer(props) {
const floor = props.floor || null; const floor = props.floor || null;
const preFloor = props.preFloor.current || null;
const lastFloor = useRef(null); const lastFloor = useRef(null);
const [opacity, dispatch] = useReducer(opacityReducer, initOpacity); const [opacity, dispatch] = useReducer(opacityReducer, initOpacity);
useEffect(() => { useEffect(() => {
if (floor) { if (floor) {
if (floor == 1) { if (floor == 1) {
if (lastFloor.current == 2) { if (lastFloor.current == 2 || lastFloor.current == 3) {
dispatch({ type: 'floor-2-to-1' }); dispatch({ type: "floor-2-to-1" });
} else { } else {
dispatch({ type: 'enter-to-1' }); dispatch({ type: "enter-to-1" });
} }
} else if (floor == 2) { } else if (floor == 2) {
if (lastFloor.current == 1) { if (lastFloor.current == 1) {
dispatch({ type: 'floor-1-to-2' }); dispatch({ type: "floor-1-to-2" });
} else if (lastFloor.current == 3) {
// ,floor32
} else { } else {
dispatch({ type: 'enter-to-2' }); dispatch({ type: "enter-to-2" });
}
} else if (floor == 3) {
if (lastFloor.current == 1) {
dispatch({ type: "floor-1-to-2" });
} else if (lastFloor.current == 2) {
// floor23
} else {
dispatch({ type: "enter-to-2" });
} }
} }
lastFloor.current = floor; lastFloor.current = floor;
@ -78,7 +89,7 @@ function VideoContainer(props) {
// //
props.onFloorUpdate(1); props.onFloorUpdate(1);
// floor1 one enter // floor1 one enter
dispatch({ type: 'enter-to-1' }); dispatch({ type: "enter-to-1" });
}; };
function handleEnterVideoEnd() { function handleEnterVideoEnd() {
@ -95,7 +106,12 @@ function VideoContainer(props) {
/> />
<EnterToFloorOne key="enter-to-1" opacity={opacity.enterToFloorOne} /> <EnterToFloorOne key="enter-to-1" opacity={opacity.enterToFloorOne} />
<EnterToFloorTwo key="enter-to-2" opacity={opacity.enterToFloorTwo} /> <EnterToFloorTwo key="enter-to-2" opacity={opacity.enterToFloorTwo} />
<FloorOneToTwo key="1-to-2" opacity={opacity.floorOneToTwo} /> <FloorOneToTwo
key="1-to-2"
opacity={opacity.floorOneToTwo}
floor={floor}
preFloor={preFloor}
/>
<FloorTwoToOne key="2-to-1" opacity={opacity.floorTwoToOne} /> <FloorTwoToOne key="2-to-1" opacity={opacity.floorTwoToOne} />
</AnimatePresence> </AnimatePresence>
); );

View File

@ -1,12 +1,13 @@
import { useState } from "react"; import { useState, useRef } from "react";
import cls from "./index.module.css"; import cls from "./index.module.css";
import Chart2 from "../../../Common/TimeFireDir"; import Chart2 from "../../../Common/TimeFireDir";
import VideoContainer from "./VideoContainer"; import VideoContainer from "./VideoContainer";
function KilnCenter() { function KilnCenter() {
const [floor, setFloor] = useState(0); const [floor, setFloor] = useState(0);
const preFloor = useRef();
function onFloorUpdate(flr) { function onFloorUpdate(flr) {
preFloor.current = floor;
setFloor(flr); setFloor(flr);
} }
@ -29,8 +30,6 @@ function KilnCenter() {
<Chart2 /> <Chart2 />
</div> </div>
{/* menu */} {/* menu */}
<div <div
className="subMenu" className="subMenu"
@ -42,7 +41,7 @@ function KilnCenter() {
> >
<div <div
className={ className={
"flr flr1 " + cls.menuItem + " " + (floor == 1 ? cls.active : "") "flr flr1 " + cls.menuItem + " " + (floor === 1 ? cls.active : "")
} }
onClick={() => onFloorUpdate(1)} onClick={() => onFloorUpdate(1)}
> >
@ -50,7 +49,7 @@ function KilnCenter() {
</div> </div>
<div <div
className={ className={
"flr flr2 " + cls.menuItem + " " + (floor == 2 ? cls.active : "") "flr flr2 " + cls.menuItem + " " + (floor === 2 ? cls.active : "")
} }
onClick={() => onFloorUpdate(2)} onClick={() => onFloorUpdate(2)}
> >
@ -58,7 +57,7 @@ function KilnCenter() {
</div> </div>
<div <div
className={ className={
"flr flr2 " + cls.menuItem + " " + (floor == 3 ? cls.active : "") "flr flr2 " + cls.menuItem + " " + (floor === 3 ? cls.active : "")
} }
onClick={() => onFloorUpdate(3)} onClick={() => onFloorUpdate(3)}
> >
@ -67,12 +66,28 @@ function KilnCenter() {
</div> </div>
{/* 颜色指示图 */} {/* 颜色指示图 */}
<div style={{ position: "absolute", top: "30px", right:"450px" ,width: "300px", height:"41px" }}> <div
<img src={require("../../../../assets/tempIntr.png")} alt="" style={{width:"300px",height:"41px"}}/> style={{
position: "absolute",
top: "30px",
right: "450px",
width: "300px",
height: "41px",
}}
>
<img
src={require("../../../../assets/tempIntr.png")}
alt=""
style={{ width: "300px", height: "41px" }}
/>
</div> </div>
{/* video */} {/* video */}
<VideoContainer onFloorUpdate={onFloorUpdate} floor={floor} /> <VideoContainer
onFloorUpdate={onFloorUpdate}
floor={floor}
preFloor={preFloor}
/>
</div> </div>
); );
} }

View File

@ -20,7 +20,7 @@ function EnterToFloorOne(props) {
setTimeout(() => { setTimeout(() => {
// console.log("enter"); // console.log("enter");
setFireCanPlay(true); setFireCanPlay(true);
}, 5000); }, 1800);
} }
return () => { return () => {
// console.log("enter"); // console.log("enter");
@ -50,14 +50,19 @@ function EnterToFloorOne(props) {
<source src="/video/floor1.webm" type="video/mp4" /> <source src="/video/floor1.webm" type="video/mp4" />
</video> </video>
{/* {fireCanPlay && fireDir == "" && ( {fireCanPlay && fireDir == "东火" && (
<video <video
src="/video/fire_top.webm" src="/video/fire_top.webm"
muted muted
autoPlay autoPlay
loop loop
width={3900} width={3900}
style={{ position: "absolute", top: "-20px", left: "-20px" }} style={{
position: "absolute",
top: "-20px",
left: "-20px",
zIndex: 9,
}}
></video> ></video>
)} )}
{fireCanPlay && fireDir == "西火" && ( {fireCanPlay && fireDir == "西火" && (
@ -67,9 +72,14 @@ function EnterToFloorOne(props) {
autoPlay autoPlay
loop loop
width={3900} width={3900}
style={{ position: "absolute", top: "-20px", left: "-20px" }} style={{
position: "absolute",
top: "-20px",
left: "-20px",
zIndex: 9,
}}
></video> ></video>
)} */} )}
<TopColorBlockEnter /> <TopColorBlockEnter />
@ -78,7 +88,7 @@ function EnterToFloorOne(props) {
top: "218px", top: "218px",
left: "678px", left: "678px",
width: "2380px", width: "2380px",
zIndex: 0, zIndex: 10,
}} }}
/> />
<FeederStatus /> <FeederStatus />

View File

@ -1,10 +1,10 @@
import { motion, AnimatePresence } from "framer-motion"; import { motion, AnimatePresence } from "framer-motion";
import { useRef, useEffect, useMemo, useState } from "react"; import { useRef, useEffect, useState } from "react";
import FeederStatus from "../../../../Common/Feeder"; import FeederStatus from "../../../../Common/Feeder";
import TemperatureTop from "../../../../../components/Common/TemperatureTop";
import TemperatureBottom from "../../../../Common/TemperatureBottom"; import TemperatureBottom from "../../../../Common/TemperatureBottom";
import { useSelector, useDispatch } from "react-redux"; import { useSelector } from "react-redux";
import BotttomColorBlock from "./../../components/BotttomColorBlock"; import BotttomColorBlock from "./../../components/BotttomColorBlock";
import image from "./../../../../../assets/kilnSpeed.png";
function FloorOneToTwo(props) { function FloorOneToTwo(props) {
const fireInfo = useSelector((state) => state.fireInfo); const fireInfo = useSelector((state) => state.fireInfo);
@ -14,14 +14,37 @@ function FloorOneToTwo(props) {
const vd = useRef(null); const vd = useRef(null);
const show = props.opacity || 0; const show = props.opacity || 0;
//
//
const showSpeed = props.floor == 3 ? true : false; //3
const showBottom = props.floor == 2 ? true : false; //2
const speed = props.preFloor == 2 || props.preFloor == 3 ? "f" : "s";
const [speedAn, setSpeedAn] = useState({});
useEffect(() => {
// 23
if (speed === "f") {
setSpeedAn({
opacity: [0, 0, 0, 0.6, 1],
transition: { duration: 0.3, delay: 0 },
});
} else {
if (props.floor === 3) {
setSpeedAn({
opacity: [0, 0, 0, 0.6, 1],
transition: { duration: 0.3, delay: 1.5 },
});
} else {
setSpeedAn({});
}
}
}, [props.floor]);
useEffect(() => { useEffect(() => {
if (show) { if (show) {
vd.current.play(); vd.current.play();
setTimeout(() => { setTimeout(() => {
// console.log("1-2"); // console.log("1-2");
setFireCanPlay(true); setFireCanPlay(true);
}, 3000); }, 2000);
} }
if (!show) setFireCanPlay(false); if (!show) setFireCanPlay(false);
return () => { return () => {
@ -51,20 +74,27 @@ function FloorOneToTwo(props) {
<video ref={vd} muted> <video ref={vd} muted>
<source src="/video/1to2.webm" type="video/mp4" /> <source src="/video/1to2.webm" type="video/mp4" />
</video> </video>
{/* 窑炉的色块 */}
{showBottom && (
<BotttomColorBlock speed={speed} floor={props.floor} />
)}
<BotttomColorBlock /> {showBottom && fireCanPlay && fireDir == "东火" && (
{fireCanPlay && fireDir == "东火" && (
<video <video
src="/video/fire_top.webm" src="/video/fire_top.webm"
muted muted
autoPlay autoPlay
loop loop
width={3700} width={3700}
style={{ position: "absolute", top: "18px", left: "72px",zIndex: 9 }} style={{
position: "absolute",
top: "18px",
left: "72px",
zIndex: 9,
}}
></video> ></video>
)} )}
{fireCanPlay && fireDir == "西火" && ( {showBottom && fireCanPlay && fireDir == "西火" && (
// {fireCanPlay && ( // {fireCanPlay && (
<video <video
src="/video/fire_down.webm" src="/video/fire_down.webm"
@ -72,10 +102,17 @@ function FloorOneToTwo(props) {
autoPlay autoPlay
loop loop
width={3780} width={3780}
style={{ position: "absolute", top: "-24px", left: "12px",zIndex: 9 }} style={{
position: "absolute",
top: "-24px",
left: "12px",
zIndex: 9,
}}
></video> ></video>
)} )}
{/* 温度组件 */}
{showBottom && (
<TemperatureBottom <TemperatureBottom
style={{ style={{
top: "208px", top: "208px",
@ -84,7 +121,30 @@ function FloorOneToTwo(props) {
width: "2380px", width: "2380px",
zIndex: 10, zIndex: 10,
}} }}
speed={speed}
floor={props.floor}
/> />
)}
{/* 溶液速度色块 */}
{showSpeed && (
<motion.div
style={{
position: "absolute",
top: "242px",
left: "445px",
zIndex: "999",
}}
animate={speedAn}
>
<img
src={image}
alt=""
width="100%"
height="100%"
style={{ transform: "scale(0.583, 0.593)" }}
/>
</motion.div>
)}
<FeederStatus /> <FeederStatus />
</motion.div> </motion.div>
)} )}

View File

@ -20,7 +20,7 @@ function FloorTwoToOne(props) {
setTimeout(() => { setTimeout(() => {
// console.log("2-1"); // console.log("2-1");
setFireCanPlay(true); setFireCanPlay(true);
}, 3000); }, 1800);
} }
if (!show) setFireCanPlay(false); if (!show) setFireCanPlay(false);
return () => { return () => {
@ -59,7 +59,12 @@ function FloorTwoToOne(props) {
autoPlay autoPlay
loop loop
width={3800} width={3800}
style={{ position: "absolute", top: "10px", left: "0px",zIndex: 9, }} style={{
position: "absolute",
top: "10px",
left: "0px",
zIndex: 9,
}}
></video> ></video>
)} )}
{fireCanPlay && fireDir == "西火" && ( {fireCanPlay && fireDir == "西火" && (
@ -70,7 +75,12 @@ function FloorTwoToOne(props) {
autoPlay autoPlay
loop loop
width={3800} width={3800}
style={{ position: "absolute", top: "-12px", left: "-10px",zIndex: 9, }} style={{
position: "absolute",
top: "-12px",
left: "-10px",
zIndex: 9,
}}
></video> ></video>
)} )}

View File

@ -1,125 +1,367 @@
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import React from 'react'; import React from "react";
import { useEffect, useState } from "react";
import { motion, AnimatePresence } from "framer-motion"; import { motion, AnimatePresence } from "framer-motion";
import { ReactComponent as B1 } from './pic/b1.svg' import { ReactComponent as B1 } from "./pic/b1.svg";
import { ReactComponent as B2 } from './pic/b2.svg' import { ReactComponent as B2 } from "./pic/b2.svg";
import { ReactComponent as B3 } from './pic/b3.svg' import { ReactComponent as B3 } from "./pic/b3.svg";
import { ReactComponent as B4 } from './pic/b4.svg' import { ReactComponent as B4 } from "./pic/b4.svg";
import { ReactComponent as B5 } from './pic/b5.svg' import { ReactComponent as B5 } from "./pic/b5.svg";
import { ReactComponent as B6 } from './pic/b6.svg' import { ReactComponent as B6 } from "./pic/b6.svg";
import { ReactComponent as B7 } from './pic/b7.svg' import { ReactComponent as B7 } from "./pic/b7.svg";
import { ReactComponent as B8 } from './pic/b8.svg' import { ReactComponent as B8 } from "./pic/b8.svg";
import { ReactComponent as T1 } from './pic/t1.svg' import { ReactComponent as T1 } from "./pic/t1.svg";
import { ReactComponent as T2 } from './pic/t2.svg' import { ReactComponent as T2 } from "./pic/t2.svg";
import { ReactComponent as T3 } from './pic/t3.svg' import { ReactComponent as T3 } from "./pic/t3.svg";
import { ReactComponent as T4 } from './pic/t4.svg' import { ReactComponent as T4 } from "./pic/t4.svg";
import { ReactComponent as T5 } from './pic/t5.svg' import { ReactComponent as T5 } from "./pic/t5.svg";
import { ReactComponent as T6 } from './pic/t6.svg' import { ReactComponent as T6 } from "./pic/t6.svg";
import { ReactComponent as T7 } from './pic/t7.svg' import { ReactComponent as T7 } from "./pic/t7.svg";
import { ReactComponent as T8 } from './pic/t8.svg' import { ReactComponent as T8 } from "./pic/t8.svg";
const BotttomColorBlock = ({ condition }) => { const BotttomColorBlock = (props) => {
const tempBottom = useSelector((state) => state.temperature.bottom); const tempBottom = useSelector((state) => state.temperature.bottom);
const speed = props.speed;
const floor = props.floor;
const [speedAn, setSpeedAn] = useState({});
useEffect(() => {
// 23
if (speed === "f") {
setSpeedAn({});
} else {
if (floor === 2) {
setSpeedAn({
opacity: [0, 0, 0, 0.6, 1],
transition: { duration: 0.3, delay: 1.8 },
});
} else {
setSpeedAn({});
}
}
}, [floor]);
function returnColor(n) { function returnColor(n) {
let num = Number(tempBottom[n].slice(0,tempBottom[n].length - 1)) let num = Number(tempBottom[n].slice(0, tempBottom[n].length - 1));
if (num <= 200) { if (num <= 100) {
return 'rgba(42, 229, 93, 0.7)'; return "rgba(96, 0, 189, 0.7)";
} else if (num >200 && num <=400) { } else if (num > 100 && num <= 200) {
return 'rgba(133, 203, 50, 0.7)'; return "rgba(102, 7, 255, 0.7)";
} else if (num >400 && num <=600) { } else if (num > 200 && num <= 300) {
return 'rgba(255, 182, 3, 0.7)'; return "rgba(10, 20, 255, 0.7)";
} else if (num >600 && num <=800) { } else if (num > 300 && num <= 400) {
return 'rgba(255, 135, 16, 0.7)'; return "rgba(7, 89, 255, 0.7)";
} else if (num >800 && num <=1000) { } else if (num > 400 && num <= 500) {
return 'rgba(249, 89, 7, 0.7)'; return "rgba(7, 139, 255, 0.7)";
} else if (num >1000 && num <=1200) { } else if (num > 500 && num <= 600) {
return 'rgba(255, 40, 40, 0.7)'; return "rgba(7, 194, 255, 0.7)";
} else if (num >1200 && num <=1400) { } else if (num > 600 && num <= 700) {
return 'rgba(255, 38, 112, 0.7)'; return "rgba(7, 255, 253, 0.7)";
} else if (num >1400 && num <=1600) { } else if (num > 700 && num <= 800) {
return 'rgba(163, 23, 187, 0.7)'; return "rgba(7, 255, 205, 0.7)";
} else if (num >1600 && num <=1800) { } else if (num > 800 && num <= 900) {
return 'rgba(119, 14, 234, 0.7)'; return "rgba(20, 237, 127, 0.7)";
} else if (num >1800) { } else if (num > 900 && num <= 1000) {
return 'rgba(77, 11, 255, 0.7)'; return "rgba(0, 193, 39, 0.7)";
} else if (num > 1000 && num <= 1100) {
return "rgba(147, 210, 1, 0.7)";
} else if (num > 1100 && num <= 1200) {
return "rgba(206, 206, 0, 0.7)";
} else if (num > 1200 && num <= 1300) {
return "rgba(255, 226, 13, 0.7)";
} else if (num > 1300 && num <= 1400) {
return "rgba(249, 240, 146, 0.7)";
} else if (num > 1400 && num <= 1500) {
return "rgba(250, 204, 93, 0.7)";
} else if (num > 1500 && num <= 1600) {
return "rgba(240, 139, 32, 0.7)";
} else if (num > 1600 && num <= 1700) {
return "rgba(241, 88, 26, 0.7)";
} else if (num > 1700 && num <= 1800) {
return "rgba(255, 0, 0, 0.7)";
} else if (num > 1800 && num <= 1900) {
return "rgba(182, 0, 0, 0.7)";
} else if (num > 1900) {
return "rgba(140, 0, 33, 0.7)";
} }
} }
function returnColor2(n) { function returnColor2(n) {
let num = Number(tempBottom[n].slice(0,tempBottom[n].length - 1)) let num = Number(tempBottom[n].slice(0, tempBottom[n].length - 1));
if (num <= 200) { if (num <= 100) {
return 'rgba(42, 229, 93, 0.9)'; return "rgba(96, 0, 189, 0.9)";
} else if (num >200 && num <=400) { } else if (num > 100 && num <= 200) {
return 'rgba(133, 203, 50, 0.9)'; return "rgba(102, 7, 255, 0.9)";
} else if (num >400 && num <=600) { } else if (num > 200 && num <= 300) {
return 'rgba(255, 182, 3, 0.9)'; return "rgba(10, 20, 255, 0.9)";
} else if (num >600 && num <=800) { } else if (num > 300 && num <= 400) {
return 'rgba(255, 135, 16, 0.9)'; return "rgba(7, 89, 255, 0.9)";
} else if (num >800 && num <=1000) { } else if (num > 400 && num <= 500) {
return 'rgba(249, 89, 7, 0.9)'; return "rgba(7, 139, 255, 0.9)";
} else if (num >1000 && num <=1200) { } else if (num > 500 && num <= 600) {
return 'rgba(255, 40, 40, 0.9)'; return "rgba(7, 194, 255, 0.9)";
} else if (num >1200 && num <=1400) { } else if (num > 600 && num <= 700) {
return 'rgba(255, 38, 112, 0.9)'; return "rgba(7, 255, 253, 0.9)";
} else if (num >1400 && num <=1600) { } else if (num > 700 && num <= 800) {
return 'rgba(163, 23, 187, 0.9)'; return "rgba(7, 255, 205, 0.9)";
} else if (num >1600 && num <=1800) { } else if (num > 800 && num <= 900) {
return 'rgba(119, 14, 234, 0.9)'; return "rgba(20, 237, 127, 0.9)";
} else if (num >1800) { } else if (num > 900 && num <= 1000) {
return 'rgba(77, 11, 255, 0.9)'; return "rgba(0, 193, 39, 0.9)";
} else if (num > 1000 && num <= 1100) {
return "rgba(147, 210, 1, 0.9)";
} else if (num > 1100 && num <= 1200) {
return "rgba(206, 206, 0, 0.9)";
} else if (num > 1200 && num <= 1300) {
return "rgba(255, 226, 13, 0.9)";
} else if (num > 1300 && num <= 1400) {
return "rgba(249, 240, 146, 0.9)";
} else if (num > 1400 && num <= 1500) {
return "rgba(250, 204, 93, 0.9)";
} else if (num > 1500 && num <= 1600) {
return "rgba(240, 139, 32, 0.9)";
} else if (num > 1600 && num <= 1700) {
return "rgba(241, 88, 26, 0.9)";
} else if (num > 1700 && num <= 1800) {
return "rgba(255, 0, 0, 0.9)";
} else if (num > 1800 && num <= 1900) {
return "rgba(182, 0, 0, 0.9)";
} else if (num > 1900) {
return "rgba(140, 0, 33, 0.9))";
} }
} }
// svg // svg
function BigSvg() { function BigSvg() {
return ( return (
<svg width="2050px" height="700px" style={{position: "absolute", top: "320px", left: "1100px", zIndex:0}}> <svg
width="2050px"
height="700px"
style={{
position: "absolute",
top: "320px",
left: "1100px",
zIndex: 0,
}}
>
<defs> <defs>
<linearGradient id="Gradient" x1="0" x2="1" y1="0" y2="0"> <linearGradient id="Gradient" x1="0" x2="1" y1="0" y2="0">
<stop offset="0%" stop-color={returnColor2('TE302')} /> <stop offset="0%" stop-color={returnColor2("TE302")} />
<stop offset="7%" stop-color={returnColor2('TE304')} /> <stop offset="7%" stop-color={returnColor2("TE304")} />
<stop offset="14%" stop-color={returnColor2('TE306')} /> <stop offset="14%" stop-color={returnColor2("TE306")} />
<stop offset="21%" stop-color={returnColor2('TE308')} /> <stop offset="21%" stop-color={returnColor2("TE308")} />
<stop offset="28%" stop-color={returnColor2('TE309')} /> <stop offset="28%" stop-color={returnColor2("TE309")} />
<stop offset="35%" stop-color={returnColor2('TE310')} /> <stop offset="35%" stop-color={returnColor2("TE310")} />
<stop offset="42%" stop-color={returnColor2('TE312')} /> <stop offset="42%" stop-color={returnColor2("TE312")} />
<stop offset="49%" stop-color={returnColor2('TE314')} /> <stop offset="49%" stop-color={returnColor2("TE314")} />
<stop offset="56%" stop-color={returnColor2('TE315')} /> <stop offset="56%" stop-color={returnColor2("TE315")} />
<stop offset="63%" stop-color={returnColor2('TE316')} /> <stop offset="63%" stop-color={returnColor2("TE316")} />
<stop offset="70%" stop-color={returnColor2('TE318')} /> <stop offset="70%" stop-color={returnColor2("TE318")} />
<stop offset="77%" stop-color={returnColor2('TE321')} /> <stop offset="77%" stop-color={returnColor2("TE321")} />
<stop offset="84%" stop-color={returnColor2('TE331')} /> <stop offset="84%" stop-color={returnColor2("TE331")} />
<stop offset="91%" stop-color={returnColor2('TE332')} /> <stop offset="91%" stop-color={returnColor2("TE332")} />
<stop offset="100%" stop-color={returnColor2('TE332')} /> <stop offset="100%" stop-color={returnColor2("TE332")} />
</linearGradient> </linearGradient>
</defs> </defs>
<polygon points="65 251,1515 251,1524 311,1640 311,1645 290,1609 90,1650 90,1650 95,1758 95,1760 107,1665 106,1658 130,1669 190,1865 190,1867 200,1685 200,1678 223,1693 313,1990 315,1992 325,1710 325,1703 347,1717 430,1910 430,1915 446,1731 445,1725 470,1738 544,1856 544,1860 562,1755 562,1752 572,1700 572,1655 340,1543 340,1534 360,1540 395,1080 397,1080 390,1024 390,1022 398,962 398,962 390,908 390,908 398,840 398,840 390,786 390,786 398,720 398,720 390,665 390,665 398,598 398,598 390,542 390,542 398,476 398,476 390,420 390,420 398,354 398,354 391,296 391,296 400,228 400,228 392,48 392" fill="url(#Gradient)" /> <polygon
</svg>) points="65 251,1515 251,1524 311,1640 311,1645 290,1609 90,1650 90,1650 95,1758 95,1760 107,1665 106,1658 130,1669 190,1865 190,1867 200,1685 200,1678 223,1693 313,1990 315,1992 325,1710 325,1703 347,1717 430,1910 430,1915 446,1731 445,1725 470,1738 544,1856 544,1860 562,1755 562,1752 572,1700 572,1655 340,1543 340,1534 360,1540 395,1080 397,1080 390,1024 390,1022 398,962 398,962 390,908 390,908 398,840 398,840 390,786 390,786 398,720 398,720 390,665 390,665 398,598 398,598 390,542 390,542 398,476 398,476 390,420 390,420 398,354 398,354 391,296 391,296 400,228 400,228 392,48 392"
fill="url(#Gradient)"
/>
</svg>
);
} }
return ( return (
<motion.div <motion.div animate={speedAn}>
animate={{
opacity: [0, 0, 0, 0.6, 1],
transition: { duration: 0.3, delay: 2 },
}}
>
<BigSvg /> <BigSvg />
<B1 style={{fill:returnColor('TE334'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "5px", zIndex:0,transform:"scale(0.7)"}}/> <B1
<B2 style={{fill:returnColor('TE336'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "9px", zIndex:0,transform:"scale(0.7)"}}/> style={{
<B3 style={{fill:returnColor('TE338'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "10px", zIndex:0,transform:"scale(0.7)"}}/> fill: returnColor("TE334"),
<B4 style={{fill:returnColor('TE340'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "12px", zIndex:0,transform:"scale(0.7)"}}/> width: "100%",
<B5 style={{fill:returnColor('TE342'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "14px", zIndex:0,transform:"scale(0.7)"}}/> height: "100%",
<B6 style={{fill:returnColor('TE344'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "16px", zIndex:0,transform:"scale(0.7)"}}/> position: "absolute",
<B7 style={{fill:returnColor('TE346'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "18px", zIndex:0,transform:"scale(0.7)"}}/> top: "120px",
<B8 style={{fill:returnColor('TE348'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "21px", zIndex:0,transform:"scale(0.7)"}}/> left: "5px",
<T1 style={{fill:returnColor('TE333'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "5px", zIndex:0,transform:"scale(0.7)"}}/> zIndex: 0,
<T2 style={{fill:returnColor('TE335'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "9px", zIndex:0,transform:"scale(0.7)"}}/> transform: "scale(0.7)",
<T3 style={{fill:returnColor('TE337'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "10px", zIndex:0,transform:"scale(0.7)"}}/> }}
<T4 style={{fill:returnColor('TE339'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "12px", zIndex:0,transform:"scale(0.7)"}}/> />
<T5 style={{fill:returnColor('TE341'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "13px", zIndex:0,transform:"scale(0.7)"}}/> <B2
<T6 style={{fill:returnColor('TE343'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "16px", zIndex:0,transform:"scale(0.7)"}}/> style={{
<T7 style={{fill:returnColor('TE345'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "18px", zIndex:0,transform:"scale(0.7)"}}/> fill: returnColor("TE336"),
<T8 style={{fill:returnColor('TE347'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "20px", zIndex:0,transform:"scale(0.7)"}}/> width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "9px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B3
style={{
fill: returnColor("TE338"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "10px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B4
style={{
fill: returnColor("TE340"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "12px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B5
style={{
fill: returnColor("TE342"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "14px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B6
style={{
fill: returnColor("TE344"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "16px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B7
style={{
fill: returnColor("TE346"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "18px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B8
style={{
fill: returnColor("TE348"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "21px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T1
style={{
fill: returnColor("TE333"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "5px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T2
style={{
fill: returnColor("TE335"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "9px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T3
style={{
fill: returnColor("TE337"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "10px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T4
style={{
fill: returnColor("TE339"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "12px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T5
style={{
fill: returnColor("TE341"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "13px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T6
style={{
fill: returnColor("TE343"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "16px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T7
style={{
fill: returnColor("TE345"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "18px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T8
style={{
fill: returnColor("TE347"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "20px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
</motion.div> </motion.div>
); );
}; };

View File

@ -2,83 +2,78 @@ import cls from "./index.module.css";
import ReactECharts from "echarts-for-react"; import ReactECharts from "echarts-for-react";
import getOptions from "./chart.config"; import getOptions from "./chart.config";
import * as echarts from "echarts"; import * as echarts from "echarts";
import { useSelector, useDispatch } from "react-redux"; import { useEffect, useState } from "react";
import { useEffect,useState } from "react";
function CommonChart(props) { function CommonChart(props) {
const { dataSource } = props; const { dataSource } = props;
const data = dataSource.data const data = dataSource.data || [];
const yName = dataSource.yName const yName = dataSource.yName;
let seriesData = { let seriesData = {
data: data, data: data,
markLineData: [ markLineData: [
{ name: '标准线1', yAxis: dataSource.msg ? dataSource.msg.lte : 0 }, { name: "标准线1", yAxis: dataSource.msg ? dataSource.msg.lte : 0 },
{ name: '标准线2', yAxis: dataSource.msg ? dataSource.msg.gt : 0 } { name: "标准线2", yAxis: dataSource.msg ? dataSource.msg.gt : 0 },
], ],
areaStyle: { areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ {
offset: 0, offset: 0,
color: dataSource.areaColor0 color: dataSource.areaColor0,
}, },
{ {
offset: 1, offset: 1,
color: dataSource.areaColor1 color: dataSource.areaColor1,
}
]),
origin:'start'
}, },
} ]),
origin: "start",
},
};
let pieces = [ let pieces = [
{ {
lte: dataSource.msg ? dataSource.msg.lte : 0, lte: dataSource.msg ? dataSource.msg.lte : 0,
color: '#FFCB59' color: "#FFCB59",
}, },
{ {
gt: dataSource.msg ? dataSource.msg.lte : 0, gt: dataSource.msg ? dataSource.msg.lte : 0,
lte: dataSource.msg ? dataSource.msg.gt : 0, lte: dataSource.msg ? dataSource.msg.gt : 0,
color: dataSource.color color: dataSource.color,
}, },
{ {
gt: dataSource.msg ? dataSource.msg.gt : 0, gt: dataSource.msg ? dataSource.msg.gt : 0,
color: '#FFCB59' color: "#FFCB59",
} },
] ];
const [yRange, setYRange] = useState([]); const [yRange, setYRange] = useState([]);
useEffect(() => { useEffect(() => {
if (data.length > 0) {
var standardValue = dataSource.msg.sp; var standardValue = dataSource.msg.sp;
var maxY = (standardValue*100 + dataSource.range[1]*100)/100 var maxY = (standardValue * 100 + dataSource.range[1] * 100) / 100;
var minY = (standardValue*100 + dataSource.range[0]*100)/100 var minY = (standardValue * 100 + dataSource.range[0] * 100) / 100;
// //
const maxValue = Math.max(...data); const maxValue = Math.max(...data);
const minValue = Math.min(...data); const minValue = Math.min(...data);
if (maxValue > maxY) { if (maxValue > maxY) {
maxY = Math.ceil(maxValue) maxY = Math.ceil(maxValue);
} }
if (minValue < minY) { if (minValue < minY) {
minY = Math.floor(minValue) minY = Math.floor(minValue);
} }
setYRange([minY,maxY]) setYRange([minY, maxY]);
},[dataSource]) }
}, [dataSource, data]);
return ( return (
<div className={cls.commonChart}> <div className={cls.commonChart}>
{(data.length > 0) && <ReactECharts {data.length > 0 && (
option={getOptions( <ReactECharts
seriesData, option={getOptions(seriesData, pieces, yRange, yName)}
pieces,
yRange,
yName
)}
style={{ height: "100%" }} style={{ height: "100%" }}
/>} />
{(data.length <= 0) && ( )}
{data.length <= 0 && (
<p <p
style={{ style={{
paddingTop: "88px", paddingTop: "88px",

View File

@ -5,36 +5,40 @@ import CommonChart from "./../CommonChart";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
function KilnPress(props) { function KilnPress(props) {
const kilnOptimize = useSelector((state) => state.kilnOptimize); const kilnOptimize = useSelector((state) => state.kilnOptimize);
console.log(kilnOptimize)
console.log('+++++++++++++==================')
const dataSource = { const dataSource = {
color:'#12FFF5', color: "#12FFF5",
yName:'Pa', yName: "Pa",
areaColor0:'rgba(18, 255, 245, 0.4)', areaColor0: "rgba(18, 255, 245, 0.4)",
areaColor1:'rgba(18, 255, 245, 0)', areaColor1: "rgba(18, 255, 245, 0)",
msg:kilnOptimize.pressureAvg, msg: kilnOptimize.pressureAvg,
data: kilnOptimize.pressureAvg ? kilnOptimize.pressureAvg.pressureAvgFor7Day : [], data: kilnOptimize.pressureAvg
range:[-4,4] ? kilnOptimize.pressureAvg.pressureAvgFor7Day
} : [],
range: [-4, 4],
};
return ( return (
<BottomBarItem <BottomBarItem icon="kilnPress" title="窑压趋势图" style={props.style}>
icon="kilnPress"
title="窑压趋势图"
style={props.style}
>
{/* legend */} {/* legend */}
<div className={cls.legend}> <div className={cls.legend}>
<span className={cls.item}> <span className={cls.item}>
<span className={cls.block} style={{backgroundColor:'#FFCB59'}}></span>标准值外 <span
className={cls.block}
style={{ backgroundColor: "#FFCB59" }}
></span>
标准值外
</span> </span>
<span className={cls.item}> <span className={cls.item}>
<span className={cls.block} style={{backgroundColor:'#12FFF5'}}></span>标准值内 <span
className={cls.block}
style={{ backgroundColor: "#12FFF5" }}
></span>
标准值内
</span> </span>
</div> </div>
<div className={cls.chart}> <div className={cls.chart}>
<CommonChart dataSource={dataSource}/> <CommonChart dataSource={dataSource} />
</div> </div>
</BottomBarItem> </BottomBarItem>
) );
} }
export default KilnPress; export default KilnPress;

View File

@ -0,0 +1,45 @@
import { motion } from "framer-motion";
import { useEffect, useState } from "react";
import image from "./../../../../../assets/kilnSpeed.png";
function LiquidSpeedColor(props) {
const speed = props.speed;
const floor = props.floor;
const [speedAn, setSpeedAn] = useState({});
useEffect(() => {
// 23
if (speed === "f") {
setSpeedAn({});
} else {
if (floor === 3) {
setSpeedAn({
opacity: [0, 0, 0, 0.6, 1],
transition: { duration: 0.3, delay: 1.5 },
});
} else {
setSpeedAn({});
}
}
}, [floor]);
console.log(speedAn);
console.log("speedAnspeedAnspeedAnspeedAnspeedAnspeedAnspeedAn");
return (
<motion.div
style={{
position: "absolute",
top: "242px",
left: "445px",
zIndex: 999,
}}
animate={speedAn}
>
<img
src={image}
alt=""
width="100%"
height="100%"
style={{ transform: "scale(0.583, 0.593)" }}
/>
</motion.div>
);
}
export default LiquidSpeedColor;

View File

@ -1,129 +1,360 @@
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import React from 'react'; import React from "react";
import { motion, AnimatePresence } from "framer-motion"; import { motion, AnimatePresence } from "framer-motion";
import { ReactComponent as B1 } from './pic/b1.svg' import { ReactComponent as B1 } from "./pic/b1.svg";
import { ReactComponent as B2 } from './pic/b2.svg' import { ReactComponent as B2 } from "./pic/b2.svg";
import { ReactComponent as B3 } from './pic/b3.svg' import { ReactComponent as B3 } from "./pic/b3.svg";
import { ReactComponent as B4 } from './pic/b4.svg' import { ReactComponent as B4 } from "./pic/b4.svg";
import { ReactComponent as B5 } from './pic/b5.svg' import { ReactComponent as B5 } from "./pic/b5.svg";
import { ReactComponent as B6 } from './pic/b6.svg' import { ReactComponent as B6 } from "./pic/b6.svg";
import { ReactComponent as B7 } from './pic/b7.svg' import { ReactComponent as B7 } from "./pic/b7.svg";
import { ReactComponent as B8 } from './pic/b8.svg' import { ReactComponent as B8 } from "./pic/b8.svg";
import { ReactComponent as T1 } from './pic/t1.svg' import { ReactComponent as T1 } from "./pic/t1.svg";
import { ReactComponent as T2 } from './pic/t2.svg' import { ReactComponent as T2 } from "./pic/t2.svg";
import { ReactComponent as T3 } from './pic/t3.svg' import { ReactComponent as T3 } from "./pic/t3.svg";
import { ReactComponent as T4 } from './pic/t4.svg' import { ReactComponent as T4 } from "./pic/t4.svg";
import { ReactComponent as T5 } from './pic/t5.svg' import { ReactComponent as T5 } from "./pic/t5.svg";
import { ReactComponent as T6 } from './pic/t6.svg' import { ReactComponent as T6 } from "./pic/t6.svg";
import { ReactComponent as T7 } from './pic/t7.svg' import { ReactComponent as T7 } from "./pic/t7.svg";
import { ReactComponent as T8 } from './pic/t8.svg' import { ReactComponent as T8 } from "./pic/t8.svg";
const TopColorBlock = ({ condition }) => { const TopColorBlock = ({ condition }) => {
const tempTop = useSelector((state) => state.temperature.top); const tempTop = useSelector((state) => state.temperature.top);
function returnColor(n) { function returnColor(n) {
let num = Number(tempTop[n].slice(0,tempTop[n].length - 1)) let num = Number(tempTop[n].slice(0, tempTop[n].length - 1));
if (num <= 200) { if (num <= 100) {
return 'rgba(42, 229, 93, 0.7)'; return "rgba(96, 0, 189, 0.7)";
} else if (num >200 && num <=400) { } else if (num > 100 && num <= 200) {
return 'rgba(133, 203, 50, 0.7)'; return "rgba(102, 7, 255, 0.7)";
} else if (num >400 && num <=600) { } else if (num > 200 && num <= 300) {
return 'rgba(255, 182, 3, 0.7)'; return "rgba(10, 20, 255, 0.7)";
} else if (num >600 && num <=800) { } else if (num > 300 && num <= 400) {
return 'rgba(255, 135, 16, 0.7)'; return "rgba(7, 89, 255, 0.7)";
} else if (num >800 && num <=1000) { } else if (num > 400 && num <= 500) {
return 'rgba(249, 89, 7, 0.7)'; return "rgba(7, 139, 255, 0.7)";
} else if (num >1000 && num <=1200) { } else if (num > 500 && num <= 600) {
return 'rgba(255, 40, 40, 0.7)'; return "rgba(7, 194, 255, 0.7)";
} else if (num >1200 && num <=1400) { } else if (num > 600 && num <= 700) {
return 'rgba(255, 38, 112, 0.7)'; return "rgba(7, 255, 253, 0.7)";
} else if (num >1400 && num <=1600) { } else if (num > 700 && num <= 800) {
return 'rgba(163, 23, 187, 0.7)'; return "rgba(7, 255, 205, 0.7)";
} else if (num >1600 && num <=1800) { } else if (num > 800 && num <= 900) {
return 'rgba(119, 14, 234, 0.7)'; return "rgba(20, 237, 127, 0.7)";
} else if (num >1800) { } else if (num > 900 && num <= 1000) {
return 'rgba(77, 11, 255, 0.7)'; return "rgba(0, 193, 39, 0.7)";
} else if (num > 1000 && num <= 1100) {
return "rgba(147, 210, 1, 0.7)";
} else if (num > 1100 && num <= 1200) {
return "rgba(206, 206, 0, 0.7)";
} else if (num > 1200 && num <= 1300) {
return "rgba(255, 226, 13, 0.7)";
} else if (num > 1300 && num <= 1400) {
return "rgba(249, 240, 146, 0.7)";
} else if (num > 1400 && num <= 1500) {
return "rgba(250, 204, 93, 0.7)";
} else if (num > 1500 && num <= 1600) {
return "rgba(240, 139, 32, 0.7)";
} else if (num > 1600 && num <= 1700) {
return "rgba(241, 88, 26, 0.7)";
} else if (num > 1700 && num <= 1800) {
return "rgba(255, 0, 0, 0.7)";
} else if (num > 1800 && num <= 1900) {
return "rgba(182, 0, 0, 0.7)";
} else if (num > 1900) {
return "rgba(140, 0, 33, 0.7)";
} }
} }
function returnColor2(n) { function returnColor2(n) {
let num = Number(tempTop[n].slice(0,tempTop[n].length - 1)) let num = Number(tempTop[n].slice(0, tempTop[n].length - 1));
if (num <= 200) { if (num <= 100) {
return 'rgba(42, 229, 93, 0.9)'; return "rgba(96, 0, 189, 0.9)";
} else if (num >200 && num <=400) { } else if (num > 100 && num <= 200) {
return 'rgba(133, 203, 50, 0.9)'; return "rgba(102, 7, 255, 0.9)";
} else if (num >400 && num <=600) { } else if (num > 200 && num <= 300) {
return 'rgba(255, 182, 3, 0.9)'; return "rgba(10, 20, 255, 0.9)";
} else if (num >600 && num <=800) { } else if (num > 300 && num <= 400) {
return 'rgba(255, 135, 16, 0.9)'; return "rgba(7, 89, 255, 0.9)";
} else if (num >800 && num <=1000) { } else if (num > 400 && num <= 500) {
return 'rgba(249, 89, 7, 0.9)'; return "rgba(7, 139, 255, 0.9)";
} else if (num >1000 && num <=1200) { } else if (num > 500 && num <= 600) {
return 'rgba(255, 40, 40, 0.9)'; return "rgba(7, 194, 255, 0.9)";
} else if (num >1200 && num <=1400) { } else if (num > 600 && num <= 700) {
return 'rgba(255, 38, 112, 0.9)'; return "rgba(7, 255, 253, 0.9)";
} else if (num >1400 && num <=1600) { } else if (num > 700 && num <= 800) {
return 'rgba(163, 23, 187, 0.9)'; return "rgba(7, 255, 205, 0.9)";
} else if (num >1600 && num <=1800) { } else if (num > 800 && num <= 900) {
return 'rgba(119, 14, 234, 0.9)'; return "rgba(20, 237, 127, 0.9)";
} else if (num >1800) { } else if (num > 900 && num <= 1000) {
return 'rgba(77, 11, 255, 0.9)'; return "rgba(0, 193, 39, 0.9)";
} else if (num > 1000 && num <= 1100) {
return "rgba(147, 210, 1, 0.9)";
} else if (num > 1100 && num <= 1200) {
return "rgba(206, 206, 0, 0.9)";
} else if (num > 1200 && num <= 1300) {
return "rgba(255, 226, 13, 0.9)";
} else if (num > 1300 && num <= 1400) {
return "rgba(249, 240, 146, 0.9)";
} else if (num > 1400 && num <= 1500) {
return "rgba(250, 204, 93, 0.9)";
} else if (num > 1500 && num <= 1600) {
return "rgba(240, 139, 32, 0.9)";
} else if (num > 1600 && num <= 1700) {
return "rgba(241, 88, 26, 0.9)";
} else if (num > 1700 && num <= 1800) {
return "rgba(255, 0, 0, 0.9)";
} else if (num > 1800 && num <= 1900) {
return "rgba(182, 0, 0, 0.9)";
} else if (num > 1900) {
return "rgba(140, 0, 33, 0.9))";
} }
} }
// svg // svg
function BigSvg() { function BigSvg() {
return ( return (
<svg width="2050px" height="700px" style={{position: "absolute", top: "320px", left: "1080px", zIndex:0}}> <svg
width="2050px"
height="700px"
style={{
position: "absolute",
top: "320px",
left: "1080px",
zIndex: 0,
}}
>
<defs> <defs>
<linearGradient id="Gradient1" x1="0" x2="1" y1="0" y2="0"> <linearGradient id="Gradient1" x1="0" x2="1" y1="0" y2="0">
<stop offset="0%" stop-color={returnColor2('TE201')} /> <stop offset="0%" stop-color={returnColor2("TE201")} />
<stop offset="9%" stop-color={returnColor2('TE202')} /> <stop offset="9%" stop-color={returnColor2("TE202")} />
<stop offset="18%" stop-color={returnColor2('TE203')} /> <stop offset="18%" stop-color={returnColor2("TE203")} />
<stop offset="27%" stop-color={returnColor2('TE204')} /> <stop offset="27%" stop-color={returnColor2("TE204")} />
<stop offset="36%" stop-color={returnColor2('TE205')} /> <stop offset="36%" stop-color={returnColor2("TE205")} />
<stop offset="45%" stop-color={returnColor2('TE206')} /> <stop offset="45%" stop-color={returnColor2("TE206")} />
<stop offset="54%" stop-color={returnColor2('TE208')} /> <stop offset="54%" stop-color={returnColor2("TE208")} />
<stop offset="63%" stop-color={returnColor2('TE210')} /> <stop offset="63%" stop-color={returnColor2("TE210")} />
<stop offset="72%" stop-color={returnColor2('TE211')} /> <stop offset="72%" stop-color={returnColor2("TE211")} />
<stop offset="81%" stop-color={returnColor2('TE212')} /> <stop offset="81%" stop-color={returnColor2("TE212")} />
<stop offset="90%" stop-color={returnColor2('TE213')} /> <stop offset="90%" stop-color={returnColor2("TE213")} />
<stop offset="100%" stop-color={returnColor2('TE213')} /> <stop offset="100%" stop-color={returnColor2("TE213")} />
</linearGradient> </linearGradient>
<linearGradient id="Gradient2" x1="0" x2="1" y1="0" y2="0"> <linearGradient id="Gradient2" x1="0" x2="1" y1="0" y2="0">
<stop offset="0%" stop-color={returnColor2('TE216')} /> <stop offset="0%" stop-color={returnColor2("TE216")} />
<stop offset="33%" stop-color={returnColor2('TE221')} /> <stop offset="33%" stop-color={returnColor2("TE221")} />
<stop offset="66%" stop-color={returnColor2('TE225')} /> <stop offset="66%" stop-color={returnColor2("TE225")} />
<stop offset="100%" stop-color={returnColor2('TE225')} /> <stop offset="100%" stop-color={returnColor2("TE225")} />
</linearGradient> </linearGradient>
</defs> </defs>
<polygon points="27 238,1535 238,1543 310,1555 310,1558 351,1551 361,1555 420,1076 421,1076 423,1020 423,1020 421,958 421,958 423,900 423,900 421,832 421,775 423,775 421,200 425,193 399,12 400" fill="url(#Gradient1)" /> <polygon
<polygon points="1585 308,1655 308,1670 290,1640 50,1688 50,1688 58,1800 58,1804 93,1692 93,1700 168,1900 168,1906 201,1706 200,1718 312,2024 311,2029 343,1724 344,1736 445,1940 444,1946 478,1740 478,1753 573,1874 573, 1878 608,1710 608,1678 349,1668 360,1590 360" fill="url(#Gradient2)" /> points="27 238,1535 238,1543 310,1555 310,1558 351,1551 361,1555 420,1076 421,1076 423,1020 423,1020 421,958 421,958 423,900 423,900 421,832 421,775 423,775 421,200 425,193 399,12 400"
</svg>) fill="url(#Gradient1)"
/>
<polygon
points="1585 308,1655 308,1670 290,1640 50,1688 50,1688 58,1800 58,1804 93,1692 93,1700 168,1900 168,1906 201,1706 200,1718 312,2024 311,2029 343,1724 344,1736 445,1940 444,1946 478,1740 478,1753 573,1874 573, 1878 608,1710 608,1678 349,1668 360,1590 360"
fill="url(#Gradient2)"
/>
</svg>
);
} }
return ( return (
<motion.div <motion.div
animate={{ animate={{
opacity: [0, 0, 0, 0.6, 1], opacity: [0, 0, 0, 0.6, 1],
transition: { duration: 0.3, delay: 2 }, transition: { duration: 0.3, delay: 1.5 },
}} }}
> >
<BigSvg /> <BigSvg />
<B1 style={{fill:returnColor('TE228'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "5px", zIndex:0,transform:"scale(0.7)"}}/> <B1
<B2 style={{fill:returnColor('TE230'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "7px", zIndex:0,transform:"scale(0.7)"}}/> style={{
<B3 style={{fill:returnColor('TE232'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "10px", zIndex:0,transform:"scale(0.7)"}}/> fill: returnColor("TE228"),
<B4 style={{fill:returnColor('TE234'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "12px", zIndex:0,transform:"scale(0.7)"}}/> width: "100%",
<B5 style={{fill:returnColor('TE236'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "14px", zIndex:0,transform:"scale(0.7)"}}/> height: "100%",
<B6 style={{fill:returnColor('TE238'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "16px", zIndex:0,transform:"scale(0.7)"}}/> position: "absolute",
<B7 style={{fill:returnColor('TE240'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "18px", zIndex:0,transform:"scale(0.7)"}}/> top: "120px",
<B8 style={{fill:returnColor('TE242'),width: "100%", height: "100%", position: "absolute", top: "120px", left: "19px", zIndex:0,transform:"scale(0.7)"}}/> left: "5px",
<T1 style={{fill:returnColor('TE227'),width: "100%", height: "100%", position: "absolute", top: "114px", left: "5px", zIndex:0,transform:"scale(0.7)"}}/> zIndex: 0,
<T2 style={{fill:returnColor('TE229'),width: "100%", height: "100%", position: "absolute", top: "114px", left: "9px", zIndex:0,transform:"scale(0.7)"}}/> transform: "scale(0.7)",
<T3 style={{fill:returnColor('TE231'),width: "100%", height: "100%", position: "absolute", top: "114px", left: "10px", zIndex:0,transform:"scale(0.7)"}}/> }}
<T4 style={{fill:returnColor('TE233'),width: "100%", height: "100%", position: "absolute", top: "114px", left: "12px", zIndex:0,transform:"scale(0.7)"}}/> />
<T5 style={{fill:returnColor('TE235'),width: "100%", height: "100%", position: "absolute", top: "114px", left: "13px", zIndex:0,transform:"scale(0.7)"}}/> <B2
<T6 style={{fill:returnColor('TE237'),width: "100%", height: "100%", position: "absolute", top: "114px", left: "16px", zIndex:0,transform:"scale(0.7)"}}/> style={{
<T7 style={{fill:returnColor('TE239'),width: "100%", height: "100%", position: "absolute", top: "114px", left: "18px", zIndex:0,transform:"scale(0.7)"}}/> fill: returnColor("TE230"),
<T8 style={{fill:returnColor('TE241'),width: "100%", height: "100%", position: "absolute", top: "114px", left: "19px", zIndex:0,transform:"scale(0.7)"}}/> width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "7px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B3
style={{
fill: returnColor("TE232"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "10px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B4
style={{
fill: returnColor("TE234"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "12px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B5
style={{
fill: returnColor("TE236"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "14px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B6
style={{
fill: returnColor("TE238"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "16px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B7
style={{
fill: returnColor("TE240"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "18px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B8
style={{
fill: returnColor("TE242"),
width: "100%",
height: "100%",
position: "absolute",
top: "120px",
left: "19px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T1
style={{
fill: returnColor("TE227"),
width: "100%",
height: "100%",
position: "absolute",
top: "114px",
left: "5px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T2
style={{
fill: returnColor("TE229"),
width: "100%",
height: "100%",
position: "absolute",
top: "114px",
left: "9px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T3
style={{
fill: returnColor("TE231"),
width: "100%",
height: "100%",
position: "absolute",
top: "114px",
left: "10px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T4
style={{
fill: returnColor("TE233"),
width: "100%",
height: "100%",
position: "absolute",
top: "114px",
left: "12px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T5
style={{
fill: returnColor("TE235"),
width: "100%",
height: "100%",
position: "absolute",
top: "114px",
left: "13px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T6
style={{
fill: returnColor("TE237"),
width: "100%",
height: "100%",
position: "absolute",
top: "114px",
left: "16px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T7
style={{
fill: returnColor("TE239"),
width: "100%",
height: "100%",
position: "absolute",
top: "114px",
left: "18px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T8
style={{
fill: returnColor("TE241"),
width: "100%",
height: "100%",
position: "absolute",
top: "114px",
left: "19px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
</motion.div> </motion.div>
); );
}; };

View File

@ -1,129 +1,360 @@
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import React from 'react'; import React from "react";
import { motion, AnimatePresence } from "framer-motion"; import { motion, AnimatePresence } from "framer-motion";
import { ReactComponent as B1 } from './pic/b1.svg' import { ReactComponent as B1 } from "./pic/b1.svg";
import { ReactComponent as B2 } from './pic/b2.svg' import { ReactComponent as B2 } from "./pic/b2.svg";
import { ReactComponent as B3 } from './pic/b3.svg' import { ReactComponent as B3 } from "./pic/b3.svg";
import { ReactComponent as B4 } from './pic/b4.svg' import { ReactComponent as B4 } from "./pic/b4.svg";
import { ReactComponent as B5 } from './pic/b5.svg' import { ReactComponent as B5 } from "./pic/b5.svg";
import { ReactComponent as B6 } from './pic/b6.svg' import { ReactComponent as B6 } from "./pic/b6.svg";
import { ReactComponent as B7 } from './pic/b7.svg' import { ReactComponent as B7 } from "./pic/b7.svg";
import { ReactComponent as B8 } from './pic/b8.svg' import { ReactComponent as B8 } from "./pic/b8.svg";
import { ReactComponent as T1 } from './pic/t1.svg' import { ReactComponent as T1 } from "./pic/t1.svg";
import { ReactComponent as T2 } from './pic/t2.svg' import { ReactComponent as T2 } from "./pic/t2.svg";
import { ReactComponent as T3 } from './pic/t3.svg' import { ReactComponent as T3 } from "./pic/t3.svg";
import { ReactComponent as T4 } from './pic/t4.svg' import { ReactComponent as T4 } from "./pic/t4.svg";
import { ReactComponent as T5 } from './pic/t5.svg' import { ReactComponent as T5 } from "./pic/t5.svg";
import { ReactComponent as T6 } from './pic/t6.svg' import { ReactComponent as T6 } from "./pic/t6.svg";
import { ReactComponent as T7 } from './pic/t7.svg' import { ReactComponent as T7 } from "./pic/t7.svg";
import { ReactComponent as T8 } from './pic/t8.svg' import { ReactComponent as T8 } from "./pic/t8.svg";
const TopColorBlockEnter = ({ condition }) => { const TopColorBlockEnter = () => {
const tempTop = useSelector((state) => state.temperature.top); const tempTop = useSelector((state) => state.temperature.top);
function returnColor(n) { function returnColor(n) {
let num = Number(tempTop[n].slice(0,tempTop[n].length - 1)) let num = Number(tempTop[n].slice(0, tempTop[n].length - 1));
if (num <= 200) { if (num <= 100) {
return 'rgba(42, 229, 93, 0.7)'; return "rgba(96, 0, 189, 0.7)";
} else if (num >200 && num <=400) { } else if (num > 100 && num <= 200) {
return 'rgba(133, 203, 50, 0.7)'; return "rgba(102, 7, 255, 0.7)";
} else if (num >400 && num <=600) { } else if (num > 200 && num <= 300) {
return 'rgba(255, 182, 3, 0.7)'; return "rgba(10, 20, 255, 0.7)";
} else if (num >600 && num <=800) { } else if (num > 300 && num <= 400) {
return 'rgba(255, 135, 16, 0.7)'; return "rgba(7, 89, 255, 0.7)";
} else if (num >800 && num <=1000) { } else if (num > 400 && num <= 500) {
return 'rgba(249, 89, 7, 0.7)'; return "rgba(7, 139, 255, 0.7)";
} else if (num >1000 && num <=1200) { } else if (num > 500 && num <= 600) {
return 'rgba(255, 40, 40, 0.7)'; return "rgba(7, 194, 255, 0.7)";
} else if (num >1200 && num <=1400) { } else if (num > 600 && num <= 700) {
return 'rgba(255, 38, 112, 0.7)'; return "rgba(7, 255, 253, 0.7)";
} else if (num >1400 && num <=1600) { } else if (num > 700 && num <= 800) {
return 'rgba(163, 23, 187, 0.7)'; return "rgba(7, 255, 205, 0.7)";
} else if (num >1600 && num <=1800) { } else if (num > 800 && num <= 900) {
return 'rgba(119, 14, 234, 0.7)'; return "rgba(20, 237, 127, 0.7)";
} else if (num >1800) { } else if (num > 900 && num <= 1000) {
return 'rgba(77, 11, 255, 0.7)'; return "rgba(0, 193, 39, 0.7)";
} else if (num > 1000 && num <= 1100) {
return "rgba(147, 210, 1, 0.7)";
} else if (num > 1100 && num <= 1200) {
return "rgba(206, 206, 0, 0.7)";
} else if (num > 1200 && num <= 1300) {
return "rgba(255, 226, 13, 0.7)";
} else if (num > 1300 && num <= 1400) {
return "rgba(249, 240, 146, 0.7)";
} else if (num > 1400 && num <= 1500) {
return "rgba(250, 204, 93, 0.7)";
} else if (num > 1500 && num <= 1600) {
return "rgba(240, 139, 32, 0.7)";
} else if (num > 1600 && num <= 1700) {
return "rgba(241, 88, 26, 0.7)";
} else if (num > 1700 && num <= 1800) {
return "rgba(255, 0, 0, 0.7)";
} else if (num > 1800 && num <= 1900) {
return "rgba(182, 0, 0, 0.7)";
} else if (num > 1900) {
return "rgba(140, 0, 33, 0.7)";
} }
} }
function returnColor2(n) { function returnColor2(n) {
let num = Number(tempTop[n].slice(0,tempTop[n].length - 1)) let num = Number(tempTop[n].slice(0, tempTop[n].length - 1));
if (num <= 200) { if (num <= 100) {
return 'rgba(42, 229, 93, 0.9)'; return "rgba(96, 0, 189, 0.9)";
} else if (num >200 && num <=400) { } else if (num > 100 && num <= 200) {
return 'rgba(133, 203, 50, 0.9)'; return "rgba(102, 7, 255, 0.9)";
} else if (num >400 && num <=600) { } else if (num > 200 && num <= 300) {
return 'rgba(255, 182, 3, 0.9)'; return "rgba(10, 20, 255, 0.9)";
} else if (num >600 && num <=800) { } else if (num > 300 && num <= 400) {
return 'rgba(255, 135, 16, 0.9)'; return "rgba(7, 89, 255, 0.9)";
} else if (num >800 && num <=1000) { } else if (num > 400 && num <= 500) {
return 'rgba(249, 89, 7, 0.9)'; return "rgba(7, 139, 255, 0.9)";
} else if (num >1000 && num <=1200) { } else if (num > 500 && num <= 600) {
return 'rgba(255, 40, 40, 0.9)'; return "rgba(7, 194, 255, 0.9)";
} else if (num >1200 && num <=1400) { } else if (num > 600 && num <= 700) {
return 'rgba(255, 38, 112, 0.9)'; return "rgba(7, 255, 253, 0.9)";
} else if (num >1400 && num <=1600) { } else if (num > 700 && num <= 800) {
return 'rgba(163, 23, 187, 0.9)'; return "rgba(7, 255, 205, 0.9)";
} else if (num >1600 && num <=1800) { } else if (num > 800 && num <= 900) {
return 'rgba(119, 14, 234, 0.9)'; return "rgba(20, 237, 127, 0.9)";
} else if (num >1800) { } else if (num > 900 && num <= 1000) {
return 'rgba(77, 11, 255, 0.9)'; return "rgba(0, 193, 39, 0.9)";
} else if (num > 1000 && num <= 1100) {
return "rgba(147, 210, 1, 0.9)";
} else if (num > 1100 && num <= 1200) {
return "rgba(206, 206, 0, 0.9)";
} else if (num > 1200 && num <= 1300) {
return "rgba(255, 226, 13, 0.9)";
} else if (num > 1300 && num <= 1400) {
return "rgba(249, 240, 146, 0.9)";
} else if (num > 1400 && num <= 1500) {
return "rgba(250, 204, 93, 0.9)";
} else if (num > 1500 && num <= 1600) {
return "rgba(240, 139, 32, 0.9)";
} else if (num > 1600 && num <= 1700) {
return "rgba(241, 88, 26, 0.9)";
} else if (num > 1700 && num <= 1800) {
return "rgba(255, 0, 0, 0.9)";
} else if (num > 1800 && num <= 1900) {
return "rgba(182, 0, 0, 0.9)";
} else if (num > 1900) {
return "rgba(140, 0, 33, 0.9)";
} }
} }
// svg // svg
function BigSvg() { function BigSvg() {
return ( return (
<svg width="2050px" height="700px" style={{position: "absolute", top: "320px", left: "1080px", zIndex:0}}> <svg
width="2050px"
height="700px"
style={{
position: "absolute",
top: "320px",
left: "1080px",
zIndex: 0,
}}
>
<defs> <defs>
<linearGradient id="Gradient1" x1="0" x2="1" y1="0" y2="0"> <linearGradient id="Gradient1" x1="0" x2="1" y1="0" y2="0">
<stop offset="0%" stop-color={returnColor2('TE201')} /> <stop offset="0%" stop-color={returnColor2("TE201")} />
<stop offset="9%" stop-color={returnColor2('TE202')} /> <stop offset="9%" stop-color={returnColor2("TE202")} />
<stop offset="18%" stop-color={returnColor2('TE203')} /> <stop offset="18%" stop-color={returnColor2("TE203")} />
<stop offset="27%" stop-color={returnColor2('TE204')} /> <stop offset="27%" stop-color={returnColor2("TE204")} />
<stop offset="36%" stop-color={returnColor2('TE205')} /> <stop offset="36%" stop-color={returnColor2("TE205")} />
<stop offset="45%" stop-color={returnColor2('TE206')} /> <stop offset="45%" stop-color={returnColor2("TE206")} />
<stop offset="54%" stop-color={returnColor2('TE208')} /> <stop offset="54%" stop-color={returnColor2("TE208")} />
<stop offset="63%" stop-color={returnColor2('TE210')} /> <stop offset="63%" stop-color={returnColor2("TE210")} />
<stop offset="72%" stop-color={returnColor2('TE211')} /> <stop offset="72%" stop-color={returnColor2("TE211")} />
<stop offset="81%" stop-color={returnColor2('TE212')} /> <stop offset="81%" stop-color={returnColor2("TE212")} />
<stop offset="90%" stop-color={returnColor2('TE213')} /> <stop offset="90%" stop-color={returnColor2("TE213")} />
<stop offset="100%" stop-color={returnColor2('TE213')} /> <stop offset="100%" stop-color={returnColor2("TE213")} />
</linearGradient> </linearGradient>
<linearGradient id="Gradient2" x1="0" x2="1" y1="0" y2="0"> <linearGradient id="Gradient2" x1="0" x2="1" y1="0" y2="0">
<stop offset="0%" stop-color={returnColor2('TE216')} /> <stop offset="0%" stop-color={returnColor2("TE216")} />
<stop offset="33%" stop-color={returnColor2('TE221')} /> <stop offset="33%" stop-color={returnColor2("TE221")} />
<stop offset="66%" stop-color={returnColor2('TE225')} /> <stop offset="66%" stop-color={returnColor2("TE225")} />
<stop offset="100%" stop-color={returnColor2('TE225')} /> <stop offset="100%" stop-color={returnColor2("TE225")} />
</linearGradient> </linearGradient>
</defs> </defs>
<polygon points="27 238,1535 238,1543 310,1555 310,1558 351,1551 361,1555 420,1076 421,1076 423,1020 423,1020 421,958 421,958 423,900 423,900 421,832 421,775 423,775 421,200 425,193 399,12 400" fill="url(#Gradient1)" /> <polygon
<polygon points="1585 308,1655 308,1670 290,1640 50,1688 50,1688 58,1800 58,1804 93,1692 93,1700 168,1900 168,1906 201,1706 200,1718 312,2024 311,2029 343,1724 344,1736 445,1940 444,1946 478,1740 478,1753 573,1874 573, 1878 608,1710 608,1678 349,1668 360,1590 360" fill="url(#Gradient2)" /> points="27 238,1535 238,1543 310,1555 310,1558 351,1551 361,1555 420,1076 421,1076 423,1020 423,1020 421,958 421,958 423,900 423,900 421,832 421,775 423,775 421,200 425,193 399,12 400"
</svg>) fill="url(#Gradient1)"
/>
<polygon
points="1585 308,1655 308,1670 290,1640 50,1688 50,1688 58,1800 58,1804 93,1692 93,1700 168,1900 168,1906 201,1706 200,1718 312,2024 311,2029 343,1724 344,1736 445,1940 444,1946 478,1740 478,1753 573,1874 573, 1878 608,1710 608,1678 349,1668 360,1590 360"
fill="url(#Gradient2)"
/>
</svg>
);
} }
return ( return (
<motion.div <motion.div
animate={{ animate={{
opacity: [0, 0, 0, 0.6, 1], opacity: [0, 0, 0, 0.6, 1],
transition: { duration: 0.3, delay: 2 }, transition: { duration: 0.3, delay: 1.5 },
}} }}
> >
<BigSvg /> <BigSvg />
<B1 style={{fill:returnColor('TE228'),width: "100%", height: "100%", position: "absolute", top: "116px", left: "-15px", zIndex:0,transform:"scale(0.7)"}}/> <B1
<B2 style={{fill:returnColor('TE230'),width: "100%", height: "100%", position: "absolute", top: "116px", left: "-15px", zIndex:0,transform:"scale(0.7)"}}/> style={{
<B3 style={{fill:returnColor('TE232'),width: "100%", height: "100%", position: "absolute", top: "116px", left: "-15px", zIndex:0,transform:"scale(0.7)"}}/> fill: returnColor("TE228"),
<B4 style={{fill:returnColor('TE234'),width: "100%", height: "100%", position: "absolute", top: "116px", left: "-12px", zIndex:0,transform:"scale(0.7)"}}/> width: "100%",
<B5 style={{fill:returnColor('TE236'),width: "100%", height: "100%", position: "absolute", top: "116px", left: "-13px", zIndex:0,transform:"scale(0.7)"}}/> height: "100%",
<B6 style={{fill:returnColor('TE238'),width: "100%", height: "100%", position: "absolute", top: "116px", left: "-9px", zIndex:0,transform:"scale(0.7)"}}/> position: "absolute",
<B7 style={{fill:returnColor('TE240'),width: "100%", height: "100%", position: "absolute", top: "116px", left: "-8px", zIndex:0,transform:"scale(0.7)"}}/> top: "116px",
<B8 style={{fill:returnColor('TE242'),width: "100%", height: "100%", position: "absolute", top: "116px", left: "-8px", zIndex:0,transform:"scale(0.7)"}}/> left: "-15px",
<T1 style={{fill:returnColor('TE227'),width: "100%", height: "100%", position: "absolute", top: "110px", left: "-15px", zIndex:0,transform:"scale(0.7)"}}/> zIndex: 0,
<T2 style={{fill:returnColor('TE229'),width: "100%", height: "100%", position: "absolute", top: "110px", left: "-15px", zIndex:0,transform:"scale(0.7)"}}/> transform: "scale(0.7)",
<T3 style={{fill:returnColor('TE231'),width: "100%", height: "100%", position: "absolute", top: "110px", left: "-15px", zIndex:0,transform:"scale(0.7)"}}/> }}
<T4 style={{fill:returnColor('TE233'),width: "100%", height: "100%", position: "absolute", top: "110px", left: "-15px", zIndex:0,transform:"scale(0.7)"}}/> />
<T5 style={{fill:returnColor('TE235'),width: "100%", height: "100%", position: "absolute", top: "110px", left: "-12px", zIndex:0,transform:"scale(0.7)"}}/> <B2
<T6 style={{fill:returnColor('TE237'),width: "100%", height: "100%", position: "absolute", top: "110px", left: "-12px", zIndex:0,transform:"scale(0.7)"}}/> style={{
<T7 style={{fill:returnColor('TE239'),width: "100%", height: "100%", position: "absolute", top: "110px", left: "-8px", zIndex:0,transform:"scale(0.7)"}}/> fill: returnColor("TE230"),
<T8 style={{fill:returnColor('TE241'),width: "100%", height: "100%", position: "absolute", top: "110px", left: "-7px", zIndex:0,transform:"scale(0.7)"}}/> width: "100%",
height: "100%",
position: "absolute",
top: "116px",
left: "-15px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B3
style={{
fill: returnColor("TE232"),
width: "100%",
height: "100%",
position: "absolute",
top: "116px",
left: "-15px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B4
style={{
fill: returnColor("TE234"),
width: "100%",
height: "100%",
position: "absolute",
top: "116px",
left: "-12px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B5
style={{
fill: returnColor("TE236"),
width: "100%",
height: "100%",
position: "absolute",
top: "116px",
left: "-13px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B6
style={{
fill: returnColor("TE238"),
width: "100%",
height: "100%",
position: "absolute",
top: "116px",
left: "-9px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B7
style={{
fill: returnColor("TE240"),
width: "100%",
height: "100%",
position: "absolute",
top: "116px",
left: "-8px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<B8
style={{
fill: returnColor("TE242"),
width: "100%",
height: "100%",
position: "absolute",
top: "116px",
left: "-8px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T1
style={{
fill: returnColor("TE227"),
width: "100%",
height: "100%",
position: "absolute",
top: "110px",
left: "-15px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T2
style={{
fill: returnColor("TE229"),
width: "100%",
height: "100%",
position: "absolute",
top: "110px",
left: "-15px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T3
style={{
fill: returnColor("TE231"),
width: "100%",
height: "100%",
position: "absolute",
top: "110px",
left: "-15px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T4
style={{
fill: returnColor("TE233"),
width: "100%",
height: "100%",
position: "absolute",
top: "110px",
left: "-15px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T5
style={{
fill: returnColor("TE235"),
width: "100%",
height: "100%",
position: "absolute",
top: "110px",
left: "-12px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T6
style={{
fill: returnColor("TE237"),
width: "100%",
height: "100%",
position: "absolute",
top: "110px",
left: "-12px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T7
style={{
fill: returnColor("TE239"),
width: "100%",
height: "100%",
position: "absolute",
top: "110px",
left: "-8px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
<T8
style={{
fill: returnColor("TE241"),
width: "100%",
height: "100%",
position: "absolute",
top: "110px",
left: "-7px",
zIndex: 0,
transform: "scale(0.7)",
}}
/>
</motion.div> </motion.div>
); );
}; };