|
176 | 176 | if (!mask) return; |
177 | 177 |
|
178 | 178 | const rect = document.createElementNS(circuitSvgNS, 'rect'); |
| 179 | + rect.setAttribute('class', 'circuit-pulse-vertical'); |
179 | 180 | rect.setAttribute('x', '0'); |
180 | 181 | rect.setAttribute('y', '-240'); |
181 | 182 | rect.setAttribute('width', '300'); |
182 | 183 | rect.setAttribute('height', '240'); |
183 | 184 | rect.setAttribute('fill', 'url(#sweep-grad)'); |
184 | 185 |
|
185 | | - const anim = document.createElementNS(circuitSvgNS, 'animate'); |
186 | | - anim.setAttribute('attributeName', 'y'); |
187 | | - anim.setAttribute('from', '-240'); |
188 | | - anim.setAttribute('to', '1500'); |
189 | | - anim.setAttribute('dur', '1.6s'); |
190 | | - anim.setAttribute('begin', 'indefinite'); |
191 | | - anim.setAttribute('repeatCount', '1'); |
192 | | - anim.setAttribute('fill', 'freeze'); |
193 | | - anim.setAttribute('keyTimes', '0; 1'); |
194 | | - anim.setAttribute('keySplines', '0.4 0 0.2 1'); |
195 | | - anim.setAttribute('calcMode', 'spline'); |
196 | | - |
197 | | - rect.appendChild(anim); |
198 | 186 | mask.appendChild(rect); |
199 | 187 |
|
200 | | - anim.beginElement(); |
201 | | - |
202 | 188 | setTimeout(() => { |
203 | 189 | rect.remove(); |
204 | 190 | }, 1800); |
|
209 | 195 | if (!mask) return; |
210 | 196 |
|
211 | 197 | const rect = document.createElementNS(circuitSvgNS, 'rect'); |
212 | | - rect.setAttribute('x', '-300'); |
| 198 | + rect.setAttribute('class', 'circuit-pulse-horizontal'); |
| 199 | + rect.setAttribute('x', '-180'); |
213 | 200 | rect.setAttribute('y', '0'); |
214 | 201 | rect.setAttribute('width', '180'); |
215 | 202 | rect.setAttribute('height', '80'); |
216 | 203 | rect.setAttribute('fill', 'url(#sweep-grad-horizontal)'); |
217 | 204 |
|
218 | | - const anim = document.createElementNS(circuitSvgNS, 'animate'); |
219 | | - anim.setAttribute('attributeName', 'x'); |
220 | | - anim.setAttribute('from', '-180'); |
221 | | - anim.setAttribute('to', '1000'); |
222 | | - anim.setAttribute('dur', '1.6s'); |
223 | | - anim.setAttribute('begin', 'indefinite'); |
224 | | - anim.setAttribute('repeatCount', '1'); |
225 | | - anim.setAttribute('fill', 'freeze'); |
226 | | - anim.setAttribute('keyTimes', '0; 1'); |
227 | | - anim.setAttribute('keySplines', '0.4 0 0.2 1'); |
228 | | - anim.setAttribute('calcMode', 'spline'); |
229 | | - |
230 | | - rect.appendChild(anim); |
231 | 205 | mask.appendChild(rect); |
232 | 206 |
|
233 | | - anim.beginElement(); |
234 | | - |
235 | 207 | setTimeout(() => { |
236 | 208 | rect.remove(); |
237 | 209 | }, 1800); |
|
249 | 221 | spawnPulseHorizontal(); |
250 | 222 | } |
251 | 223 |
|
252 | | - // Trigger the page-load pulse automatically on DOM load |
| 224 | + // Trigger the page-load pulse automatically on DOM load. |
253 | 225 | document.addEventListener('DOMContentLoaded', () => { |
254 | 226 | randomizeCircuitDesign(); |
255 | 227 | spawnPulseVertical(); |
|
0 commit comments