Card with glow effect on hover
Created Dec 26 2020
JAVASCRIPT1const Wrapper = styled(motion.div, {2position: 'relative',3width: '300px',4height: '120px',5});67const Glow = styled(motion.div, {8background: 'linear-gradient(90deg, #ffa0ae 0%, #aacaef 75%)',9position: 'absolute',10top: '0',11left: '0',12width: '100%',13height: '100%',14WebkitFilter: 'blur(15px)',15filter: 'blur(15px)',16borderRadius: '16px',17});1819const Card = styled(motion.div, {20borderRadius: '16px',21marginBottom: '0px',22overflow: 'hidden',23position: 'relative',24background: 'rgba(255, 255, 255, 0.65)',25position: 'relative',26padding: '36px 24px',27height: '100%',28div: {29color: '#4a4a4c',30display: 'flex',31justifyContent: 'center',32alignItems: 'center',33height: '50px',34},35});3637const CardWithGlow = () => {38const cardVariants = {39hover: {40scale: 1.05,41},42initial: {43scale: 1,44},45};4647const glowVariants = {48hover: {49opacity: 0.8,50},51initial: {52scale: 1.05,53opacity: 0,54},55};5657return (58<Wrapper initial="initial" whileHover="hover">59<Glow60variants={glowVariants}61transition={{62ease: 'easeOut',63delay: 0.15,64}}65/>66<Card67variants={cardVariants}68transition={{69ease: 'easeOut',70delay: 0.15,71duration: 0.5,72}}73>74<div>✨ Hover me ✨</div>75</Card>76</Wrapper>77);78};7980render(<CardWithGlow />);