#
luxiaotao1123
2024-09-21 42b108daf16fd969696a23638481111432ae8ebe
zy-acs-flow/src/page/components/PulseSignal.jsx
@@ -3,35 +3,48 @@
import { teal } from '@mui/material/colors';
const PulseSignal = (props) => {
    const { flag = true, width = 8, ...rest } = props;
    const { flag = true, width = 8, negative = false, ...rest } = props;
    return (
        <>
            <Box
                {...rest}
                sx={{
                    width: width,
                    height: width,
                    borderRadius: '50%',
                    backgroundColor: flag ? `${teal[400]}` : '#f44336',
                    display: 'inline-block',
                    animation: 'pulse 1.2s infinite',
                    '@keyframes pulse': {
                        '0%': {
                            transform: 'scale(1)',
                            opacity: 1,
            {flag ? (
                <Box
                    {...rest}
                    sx={{
                        width: width,
                        height: width,
                        borderRadius: '50%',
                        backgroundColor: `${teal[400]}`,
                        display: 'inline-block',
                        animation: `pulse ${negative ? '2' : '1.2'}s infinite`,
                        '@keyframes pulse': {
                            '0%': {
                                transform: 'scale(1)',
                                opacity: 1,
                            },
                            '50%': {
                                transform: 'scale(1.3)',
                                opacity: 0.7,
                            },
                            '100%': {
                                transform: 'scale(1)',
                                opacity: 1,
                            },
                        },
                        '50%': {
                            transform: 'scale(1.2)',
                            opacity: 0.7,
                        },
                        '100%': {
                            transform: 'scale(1)',
                            opacity: 1,
                        },
                    },
                }}
            />
                    }}
                />
            ) : (
                <Box
                    {...rest}
                    sx={{
                        width: width + width / 10,
                        height: width + width / 10,
                        borderRadius: '50%',
                        backgroundColor: '#f44336',
                        display: 'inline-block',
                    }}
                />
            )}
        </>
    )