update 一层温度

This commit is contained in:
lb 2023-12-01 13:59:53 +08:00
parent b601e9065a
commit 04a15dc14c
5 changed files with 76 additions and 30 deletions

View File

@ -4,7 +4,12 @@ function BlueRect(props) {
const title = props.title || "DEFAULT"; const title = props.title || "DEFAULT";
const value = props.value || "0℃"; const value = props.value || "0℃";
return ( return (
<div className={`${cls.blueRect} ${cls[title]}`} style={{}}> <div
className={`${cls.blueRect} ${cls[title]}`}
style={{
background: props.blue ? "#0a4268ee" : "#0a426860",
}}
>
<span <span
className="title" className="title"
style={{ style={{
@ -12,11 +17,12 @@ function BlueRect(props) {
lineHeight: "24px", lineHeight: "24px",
color: props.blue ? "#40afb8" : "#fff", color: props.blue ? "#40afb8" : "#fff",
fontWeight: 600, fontWeight: 600,
userSelect: "none",
}} }}
> >
{title} {title}
</span> </span>
<span className="value" style={{ fontSize: "22px" }}> <span className="value" style={{ userSelect: "none", fontSize: "22px" }}>
{value} {value}
</span> </span>
</div> </div>

View File

@ -136,80 +136,93 @@
} }
.TE232 { .TE232 {
top: 620px; top: 620px;
left: 830px; left: 836px;
} }
.TE234 { .TE234 {
top: 620px; top: 620px;
left: 950px; left: 965px;
} }
.TE236 { .TE236 {
top: 620px; top: 620px;
left: 1070px; left: 1090px;
} }
.TE238 { .TE238 {
top: 620px; top: 620px;
left: 1190px; left: 1215px;
} }
.TE240 { .TE240 {
top: 620px; top: 620px;
left: 1310px; left: 1340px;
} }
.TE242 { .TE242 {
top: 620px; top: 620px;
left: 1430px; left: 1460px;
} }
/** center middle **/ /** center middle **/
.TE201 { .TE201 {
top: 390px; top: 410px;
transform: rotate(-1deg);
left: 450px; left: 450px;
} }
.TE202 { .TE202 {
top: 390px; top: 410px;
transform: rotate(-1deg);
left: 580px; left: 580px;
} }
.TE203 { .TE203 {
top: 390px; top: 410px;
transform: rotate(-1deg);
left: 710px; left: 710px;
} }
.TE204 { .TE204 {
top: 390px; top: 410px;
transform: rotate(-1deg);
left: 840px; left: 840px;
} }
.TE205 { .TE205 {
top: 390px; top: 410px;
transform: rotate(-1deg);
left: 970px; left: 970px;
} }
.TE206 { .TE206 {
top: 390px; top: 410px;
transform: rotate(-1deg);
left: 1100px; left: 1100px;
} }
.TE207 { .TE207 {
top: 340px; top: 335px;
transform: rotate(-1deg);
left: 1260px; left: 1260px;
} }
.TE208 { .TE208 {
top: 390px; top: 410px;
transform: rotate(-1deg);
left: 1260px; left: 1260px;
} }
.TE209 { .TE209 {
top: 480px; top: 485px;
transform: rotate(-1deg);
left: 1260px; left: 1260px;
} }
.TE210 { .TE210 {
top: 390px; top: 410px;
transform: rotate(-1deg);
left: 1390px; left: 1390px;
} }
.TE211 { .TE211 {
top: 390px; top: 410px;
transform: rotate(-1deg);
left: 1530px; left: 1530px;
} }
.TE212 { .TE212 {
top: 390px; top: 410px;
transform: rotate(-1deg);
left: 1660px; left: 1660px;
} }
.TE213 { .TE213 {
top: 390px; top: 410px;
transform: rotate(-1deg);
left: 1790px; left: 1790px;
} }

View File

@ -1,11 +1,25 @@
import BlueRect from "../BlueRect"; import BlueRect from "../BlueRect";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import { motion, AnimatePresence } from "framer-motion";
const blueTe = [
"TE271",
"TE272",
"TE273",
"TE274",
"TE275",
"TE276",
"TE277",
"TE278",
"TE279",
"TE280",
];
function TemperatureTop(props) { function TemperatureTop(props) {
const tempTop = useSelector((state) => state.temperature.top); const tempTop = useSelector((state) => state.temperature.top);
return ( return (
<div <motion.div
className="temperature-top" className="temperature-top"
style={{ style={{
position: "absolute", position: "absolute",
@ -14,12 +28,18 @@ function TemperatureTop(props) {
width: "100%", width: "100%",
height: "95vh", height: "95vh",
background: "#ccc3", background: "#ccc3",
zIndex: "-1",
...props.style
}}
animate={{
opacity: [0, 0, 0, 0.6, 1],
transition: { duration: 0.3, delay: 2 },
}} }}
> >
{Object.keys(tempTop).map((d) => ( {Object.keys(tempTop).map((d) => (
<BlueRect title={d} value={tempTop[d]} /> <BlueRect title={d} value={tempTop[d]} blue={blueTe.includes(d)} />
))} ))}
</div> </motion.div>
); );
} }

View File

@ -58,7 +58,7 @@ function KilnCenter() {
</div> </div>
{/* 覆盖层温度信息 */} {/* 覆盖层温度信息 */}
<TemperatureTop /> {/* <TemperatureTop /> */}
{/* video */} {/* video */}
<VideoContainer onFloorUpdate={onFloorUpdate} floor={floor} /> <VideoContainer onFloorUpdate={onFloorUpdate} floor={floor} />

View File

@ -2,11 +2,10 @@ import { motion, AnimatePresence } from "framer-motion";
import { useRef, useEffect, useMemo, useState } from "react"; import { useRef, useEffect, useMemo, useState } from "react";
import cls from "../index.module.css"; import cls from "../index.module.css";
// import SocketContext from '../../../../../store/socket-data-provider'; // import SocketContext from '../../../../../store/socket-data-provider';
import { useContext } from "react"; // import { useContext } from "react";
import TemperatureTop from "../../../../../components/Common/TemperatureTop";
function FloorTwoToOne(props) { function FloorTwoToOne(props) {
// const ctx = useContext(SocketContext);
const ctx = null; const ctx = null;
const fireDir = ctx?.runState?.fireDirection || null; const fireDir = ctx?.runState?.fireDirection || null;
@ -75,7 +74,7 @@ function FloorTwoToOne(props) {
></video> ></video>
)} )}
<motion.div {/* <motion.div
className={cls.videoLayer1} className={cls.videoLayer1}
key="eto1div" key="eto1div"
style={{ style={{
@ -87,7 +86,15 @@ function FloorTwoToOne(props) {
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: 2 },
}} }}
></motion.div> ></motion.div> */}
<TemperatureTop
style={{
top: "208px",
left: "638px",
width: "2380px",
zIndex: 0
}}
/>
</motion.div> </motion.div>
)} )}
</AnimatePresence> </AnimatePresence>