|
| 1 | +import React, { useEffect, useRef } from 'react'; |
| 2 | +import styles from './AIChipAnimation.module.css'; |
| 3 | + |
| 4 | +const AIChipAnimation = () => { |
| 5 | + const svgRef = useRef(null); |
| 6 | + |
| 7 | + useEffect(() => { |
| 8 | + const svg = svgRef.current; |
| 9 | + if (!svg) return; |
| 10 | + |
| 11 | + // Add pulsing animation to circuit paths |
| 12 | + const paths = svg.querySelectorAll('.circuit-path'); |
| 13 | + paths.forEach((path, index) => { |
| 14 | + path.style.animationDelay = `${index * 0.2}s`; |
| 15 | + }); |
| 16 | + |
| 17 | + // Add data flow animation |
| 18 | + const dataPoints = svg.querySelectorAll('.data-point'); |
| 19 | + dataPoints.forEach((point, index) => { |
| 20 | + point.style.animationDelay = `${index * 0.3}s`; |
| 21 | + }); |
| 22 | + }, []); |
| 23 | + |
| 24 | + return ( |
| 25 | + <div className={styles.chipContainer}> |
| 26 | + <svg |
| 27 | + ref={svgRef} |
| 28 | + className={styles.chipSvg} |
| 29 | + viewBox="0 0 400 300" |
| 30 | + xmlns="http://www.w3.org/2000/svg" |
| 31 | + > |
| 32 | + {/* Chip base */} |
| 33 | + <rect |
| 34 | + x="50" |
| 35 | + y="50" |
| 36 | + width="300" |
| 37 | + height="200" |
| 38 | + rx="20" |
| 39 | + fill="url(#chipGradient)" |
| 40 | + stroke="url(#chipBorder)" |
| 41 | + strokeWidth="2" |
| 42 | + className={styles.chipBase} |
| 43 | + /> |
| 44 | + |
| 45 | + {/* Circuit patterns */} |
| 46 | + <g className={styles.circuitGroup}> |
| 47 | + {/* Horizontal circuits */} |
| 48 | + <path |
| 49 | + d="M 70 100 L 130 100 L 140 110 L 180 110 L 190 100 L 250 100 L 260 110 L 300 110 L 310 100 L 330 100" |
| 50 | + stroke="url(#circuitGradient)" |
| 51 | + strokeWidth="3" |
| 52 | + fill="none" |
| 53 | + className="circuit-path" |
| 54 | + /> |
| 55 | + <path |
| 56 | + d="M 70 140 L 110 140 L 120 130 L 160 130 L 170 140 L 210 140 L 220 130 L 260 130 L 270 140 L 330 140" |
| 57 | + stroke="url(#circuitGradient)" |
| 58 | + strokeWidth="3" |
| 59 | + fill="none" |
| 60 | + className="circuit-path" |
| 61 | + /> |
| 62 | + <path |
| 63 | + d="M 70 180 L 120 180 L 130 170 L 170 170 L 180 180 L 220 180 L 230 170 L 270 170 L 280 180 L 330 180" |
| 64 | + stroke="url(#circuitGradient)" |
| 65 | + strokeWidth="3" |
| 66 | + fill="none" |
| 67 | + className="circuit-path" |
| 68 | + /> |
| 69 | + |
| 70 | + {/* Vertical circuits */} |
| 71 | + <path |
| 72 | + d="M 120 70 L 120 110 L 130 120 L 130 160 L 120 170 L 120 210 L 130 220 L 130 230" |
| 73 | + stroke="url(#circuitGradient)" |
| 74 | + strokeWidth="3" |
| 75 | + fill="none" |
| 76 | + className="circuit-path" |
| 77 | + /> |
| 78 | + <path |
| 79 | + d="M 200 70 L 200 90 L 210 100 L 210 140 L 200 150 L 200 190 L 210 200 L 210 230" |
| 80 | + stroke="url(#circuitGradient)" |
| 81 | + strokeWidth="3" |
| 82 | + fill="none" |
| 83 | + className="circuit-path" |
| 84 | + /> |
| 85 | + <path |
| 86 | + d="M 280 70 L 280 100 L 270 110 L 270 150 L 280 160 L 280 200 L 270 210 L 270 230" |
| 87 | + stroke="url(#circuitGradient)" |
| 88 | + strokeWidth="3" |
| 89 | + fill="none" |
| 90 | + className="circuit-path" |
| 91 | + /> |
| 92 | + </g> |
| 93 | + |
| 94 | + {/* Processing cores */} |
| 95 | + <g className={styles.coresGroup}> |
| 96 | + <circle cx="150" cy="120" r="15" fill="url(#coreGradient)" className={styles.processingCore} /> |
| 97 | + <circle cx="250" cy="120" r="15" fill="url(#coreGradient)" className={styles.processingCore} /> |
| 98 | + <circle cx="150" cy="180" r="15" fill="url(#coreGradient)" className={styles.processingCore} /> |
| 99 | + <circle cx="250" cy="180" r="15" fill="url(#coreGradient)" className={styles.processingCore} /> |
| 100 | + |
| 101 | + {/* Core labels */} |
| 102 | + <text x="150" y="125" textAnchor="middle" className={styles.coreLabel}>AI</text> |
| 103 | + <text x="250" y="125" textAnchor="middle" className={styles.coreLabel}>ML</text> |
| 104 | + <text x="150" y="185" textAnchor="middle" className={styles.coreLabel}>NN</text> |
| 105 | + <text x="250" y="185" textAnchor="middle" className={styles.coreLabel}>LLM</text> |
| 106 | + </g> |
| 107 | + |
| 108 | + {/* Data flow points */} |
| 109 | + <g className={styles.dataFlowGroup}> |
| 110 | + <circle cx="90" cy="100" r="3" fill="#FDB516" className="data-point" /> |
| 111 | + <circle cx="160" cy="110" r="3" fill="#FDB516" className="data-point" /> |
| 112 | + <circle cx="230" cy="100" r="3" fill="#FDB516" className="data-point" /> |
| 113 | + <circle cx="310" cy="110" r="3" fill="#FDB516" className="data-point" /> |
| 114 | + |
| 115 | + <circle cx="100" cy="140" r="3" fill="#30A2FF" className="data-point" /> |
| 116 | + <circle cx="180" cy="130" r="3" fill="#30A2FF" className="data-point" /> |
| 117 | + <circle cx="250" cy="140" r="3" fill="#30A2FF" className="data-point" /> |
| 118 | + <circle cx="300" cy="130" r="3" fill="#30A2FF" className="data-point" /> |
| 119 | + </g> |
| 120 | + |
| 121 | + {/* Chip pins */} |
| 122 | + <g className={styles.pinsGroup}> |
| 123 | + {/* Left pins */} |
| 124 | + <rect x="30" y="80" width="20" height="4" fill="#8CC5FF" /> |
| 125 | + <rect x="30" y="100" width="20" height="4" fill="#8CC5FF" /> |
| 126 | + <rect x="30" y="120" width="20" height="4" fill="#8CC5FF" /> |
| 127 | + <rect x="30" y="140" width="20" height="4" fill="#8CC5FF" /> |
| 128 | + <rect x="30" y="160" width="20" height="4" fill="#8CC5FF" /> |
| 129 | + <rect x="30" y="180" width="20" height="4" fill="#8CC5FF" /> |
| 130 | + <rect x="30" y="200" width="20" height="4" fill="#8CC5FF" /> |
| 131 | + <rect x="30" y="220" width="20" height="4" fill="#8CC5FF" /> |
| 132 | + |
| 133 | + {/* Right pins */} |
| 134 | + <rect x="350" y="80" width="20" height="4" fill="#8CC5FF" /> |
| 135 | + <rect x="350" y="100" width="20" height="4" fill="#8CC5FF" /> |
| 136 | + <rect x="350" y="120" width="20" height="4" fill="#8CC5FF" /> |
| 137 | + <rect x="350" y="140" width="20" height="4" fill="#8CC5FF" /> |
| 138 | + <rect x="350" y="160" width="20" height="4" fill="#8CC5FF" /> |
| 139 | + <rect x="350" y="180" width="20" height="4" fill="#8CC5FF" /> |
| 140 | + <rect x="350" y="200" width="20" height="4" fill="#8CC5FF" /> |
| 141 | + <rect x="350" y="220" width="20" height="4" fill="#8CC5FF" /> |
| 142 | + </g> |
| 143 | + |
| 144 | + {/* Gradients and definitions */} |
| 145 | + <defs> |
| 146 | + <linearGradient id="chipGradient" x1="0%" y1="0%" x2="100%" y2="100%"> |
| 147 | + <stop offset="0%" stopColor="#1a1a2e" /> |
| 148 | + <stop offset="50%" stopColor="#16213e" /> |
| 149 | + <stop offset="100%" stopColor="#0f3460" /> |
| 150 | + </linearGradient> |
| 151 | + |
| 152 | + <linearGradient id="chipBorder" x1="0%" y1="0%" x2="100%" y2="100%"> |
| 153 | + <stop offset="0%" stopColor="#58A6FF" /> |
| 154 | + <stop offset="50%" stopColor="#30A2FF" /> |
| 155 | + <stop offset="100%" stopColor="#0969DA" /> |
| 156 | + </linearGradient> |
| 157 | + |
| 158 | + <linearGradient id="circuitGradient" x1="0%" y1="0%" x2="100%" y2="0%"> |
| 159 | + <stop offset="0%" stopColor="#58A6FF" /> |
| 160 | + <stop offset="50%" stopColor="#FDB516" /> |
| 161 | + <stop offset="100%" stopColor="#58A6FF" /> |
| 162 | + </linearGradient> |
| 163 | + |
| 164 | + <radialGradient id="coreGradient" cx="50%" cy="50%" r="50%"> |
| 165 | + <stop offset="0%" stopColor="#FDB516" /> |
| 166 | + <stop offset="70%" stopColor="#30A2FF" /> |
| 167 | + <stop offset="100%" stopColor="#0969DA" /> |
| 168 | + </radialGradient> |
| 169 | + </defs> |
| 170 | + </svg> |
| 171 | + |
| 172 | + <div className={styles.chipLabel}> |
| 173 | + <span className={styles.chipTitle}>Neural Processing Unit</span> |
| 174 | + <span className={styles.chipSubtitle}>Embedding • Classify • Similarity</span> |
| 175 | + </div> |
| 176 | + </div> |
| 177 | + ); |
| 178 | +}; |
| 179 | + |
| 180 | +export default AIChipAnimation; |
0 commit comments