All files / web/src/components/side-bar animated-logo.tsx

100% Statements 120/120
100% Branches 17/17
100% Functions 1/1
100% Lines 120/120

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141    1x           1x 12x 12x   12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x     12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x     12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x     12x   12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x   12x     12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x 12x   12x 12x 12x   12x  
'use client';
 
import { motion } from 'framer-motion';
 
interface AnimatedLogoProps {
  isCollapsed: boolean;
}
 
export function AnimatedLogo({ isCollapsed }: AnimatedLogoProps) {
  return (
    <div className="relative w-full h-full overflow-hidden rounded-sm font-logo">
      {/* Animated gradient background that pulses */}
      <motion.div
        className="absolute inset-0 bg-linear-to-br from-blue-400 via-indigo-500 to-slate-500 dark:from-slate-900 dark:via-blue-950 dark:to-gray-900"
        animate={{
          backgroundPosition: ['0% 0%', '100% 100%', '0% 0%'],
        }}
        transition={{
          duration: 16,
          repeat: Number.POSITIVE_INFINITY,
          ease: 'easeInOut',
        }}
        style={{
          backgroundSize: '400% 400%',
        }}
      />
 
      {/* Large glowing orbs that move dramatically */}
      <motion.div
        className="absolute w-32 h-32 rounded-full bg-slate-300/20 dark:bg-white/10 blur-2xl"
        animate={{
          x: [-20, 60, -20],
          y: [-10, 40, -10],
          scale: [1, 1.5, 1],
          opacity: [0.3, 0.6, 0.3],
        }}
        transition={{
          duration: 6,
          repeat: Number.POSITIVE_INFINITY,
          ease: 'easeInOut',
        }}
        style={{ top: '-20%', left: '-10%' }}
      />
      <motion.div
        className="absolute w-28 h-28 rounded-full bg-blue-400/30 dark:bg-blue-400/15 blur-2xl"
        animate={{
          x: [40, -30, 40],
          y: [20, -20, 20],
          scale: [1.2, 0.8, 1.2],
          opacity: [0.4, 0.7, 0.4],
        }}
        transition={{
          duration: 8,
          repeat: Number.POSITIVE_INFINITY,
          ease: 'easeInOut',
          delay: 1,
        }}
        style={{ bottom: '-15%', right: '-10%' }}
      />
 
      {/* Pulsing rings */}
      <motion.div
        className="absolute top-1/2 left-1/2 w-20 h-20 border-2 border-white/15 dark:border-white/10 rounded-full"
        style={{
          x: '-50%',
          y: '-50%',
        }}
        animate={{
          scale: [0.8, 1.5, 0.8],
          opacity: [0.5, 0, 0.5],
        }}
        transition={{
          duration: 4,
          repeat: Number.POSITIVE_INFINITY,
          ease: 'easeOut',
        }}
      />
      <motion.div
        className="absolute top-1/2 left-1/2 w-20 h-20 border-2 border-white/15 dark:border-white/10 rounded-full"
        style={{
          x: '-50%',
          y: '-50%',
        }}
        animate={{
          scale: [0.8, 1.5, 0.8],
          opacity: [0.5, 0, 0.5],
        }}
        transition={{
          duration: 4,
          repeat: Number.POSITIVE_INFINITY,
          ease: 'easeOut',
          delay: 2,
        }}
      />
 
      {/* Logo text */}
      <div className="relative z-10 flex items-center justify-center h-full">
        {/* Collapsed state: "SA" */}
        <motion.span
          className="text-xl font-bold text-white absolute"
          initial={false}
          animate={{
            opacity: isCollapsed ? 1 : 0,
            scale: isCollapsed ? 1 : 0.9,
            filter: isCollapsed ? 'blur(0px)' : 'blur(4px)',
          }}
          transition={{
            duration: 0.3,
            ease: 'easeInOut',
          }}
          style={{
            visibility: isCollapsed ? 'visible' : 'hidden',
          }}
        >
          SA
        </motion.span>
 
        {/* Expanded state: "Super Agents" */}
        <motion.span
          className="text-xl font-bold text-white whitespace-nowrap"
          initial={false}
          animate={{
            opacity: isCollapsed ? 0 : 1,
            scale: isCollapsed ? 0.9 : 1,
            filter: isCollapsed ? 'blur(4px)' : 'blur(0px)',
          }}
          transition={{
            duration: 0.3,
            ease: 'easeInOut',
          }}
          style={{
            visibility: isCollapsed ? 'hidden' : 'visible',
          }}
        >
          Super Agents
        </motion.span>
      </div>
    </div>
  );
}