File size: 899 Bytes
8201795
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { Typography } from "@mui/material";
import { keyframes } from "@mui/system";
import { styled } from "@mui/material/styles";

const blink = keyframes`
  0% { opacity: 1; }
  49% { opacity: 1; }
  50% { opacity: 0; }
  99% { opacity: 0; }
  100% { opacity: 1; }
`;

const BlinkingTypography = styled(Typography)`
  animation: ${blink} 1.2s infinite steps(1);
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: white;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
`;

export const BlinkingText = ({ children, ...props }) => {
  const [firstWord, secondWord] = children.split(" ");
  return (
    <BlinkingTypography {...props}>
      <span>{firstWord}</span>
      <span>{secondWord}</span>
    </BlinkingTypography>
  );
};

export default BlinkingText;