continue-custom/gui/src/components/mainInput/GradientBorder.tsx

38 lines
824 B
TypeScript

import styled, { keyframes } from "styled-components";
const gradient = keyframes`
0% {
background-position: 0px 0;
}
100% {
background-position: 100em 0;
}
`;
export const GradientBorder = styled.div<{
borderRadius?: string;
borderColor?: string;
loading: 0 | 1;
}>`
border-radius: ${(props) => props.borderRadius || "0"};
padding: 1px;
background: ${(props) =>
props.borderColor
? props.borderColor
: `repeating-linear-gradient(
101.79deg,
#1BBE84 0%,
#331BBE 16%,
#BE1B55 33%,
#A6BE1B 55%,
#BE1B55 67%,
#331BBE 85%,
#1BBE84 99%
)`};
animation: ${(props) => (props.loading ? gradient : "")} 6s linear infinite;
background-size: 200% 200%;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
`;