Ah, got it! You want the floating orbs to glow and move around randomly — simulating an electric circuit flowing through them.
We’ll animate each orb independently using CSS keyframes and randomized delays so they don’t all move in sync. We'll also give them a glowing effect with box-shadow and hue shifting via filter.
✅ Final Goal:
- Orbs glow like electric nodes.
- Move randomly (like current flowing).
- Each has its own motion and timing for realism.
✅ Updated Code
🧩 Template:
Update your template to generate multiple floating orbs (e.g., 20):
<template>
<div class="relative min-h-screen w-full overflow-hidden">
<div class="bg-background absolute top-0 -z-20 h-full w-full" />
<div class="wire-bg absolute top-0 -z-10 h-full w-full" />
<!-- Floating orbs overlay -->
<div class="floating-orbs absolute top-0 left-0 h-full w-full pointer-events-none">
<span v-for="n in 20" :key="n" class="orb"></span>
</div>
<slot />
</div>
<common-custom-scrollbar />
</template>
💡 Style Block (Key Part):
Add this inside <style scoped> or global if needed:
.floating-orbs {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
overflow: hidden;
}
.orb {
--size: 8px;
position: absolute;
width: var(--size);
height: var(--size);
border-radius: 50%;
background-color: #00f0ff;
box-shadow: 0 0 8px #00f0ffaa, 0 0 16px #00f0ffff;
filter: brightness(1.3) contrast(1.2) hue-rotate(0deg);
animation:
float linear infinite,
glow ease-in-out infinite,
hueShift 6s linear infinite;
}
/* Randomize each orb */
.orb:nth-child(1) { top: 10%; left: 20%; animation-duration: 8s, 4s, 10s; }
.orb:nth-child(2) { top: 80%; left: 60%; animation-duration: 6s, 5s, 8s; }
.orb:nth-child(3) { top: 50%; left: 80%; animation-duration: 7s, 3s, 12s; }
.orb:nth-child(4) { top: 30%; left: 40%; animation-duration: 9s, 6s, 7s; }
.orb:nth-child(5) { top: 70%; left: 10%; animation-duration: 10s, 5s, 9s; }
.orb:nth-child(6) { top: 20%; left: 70%; animation-duration: 5s, 4s, 11s; }
.orb:nth-child(7) { top: 60%; left: 30%; animation-duration: 7s, 3s, 6s; }
.orb:nth-child(8) { top: 90%; left: 50%; animation-duration: 6s, 5s, 10s; }
.orb:nth-child(9) { top: 40%; left: 90%; animation-duration: 8s, 4s, 13s; }
.orb:nth-child(10) { top: 10%; left: 50%; animation-duration: 9s, 5s, 8s; }
.orb:nth-child(11) { top: 25%; left: 15%; animation-duration: 7s, 6s, 9s; }
.orb:nth-child(12) { top: 65%; left: 85%; animation-duration: 10s, 4s, 14s; }
.orb:nth-child(13) { top: 35%; left: 65%; animation-duration: 6s, 5s, 10s; }
.orb:nth-child(14) { top: 85%; left: 25%; animation-duration: 8s, 3s, 12s; }
.orb:nth-child(15) { top: 55%; left: 5%; animation-duration: 9s, 6s, 7s; }
.orb:nth-child(16) { top: 15%; left: 95%; animation-duration: 7s, 4s, 8s; }
.orb:nth-child(17) { top: 45%; left: 35%; animation-duration: 6s, 5s, 9s; }
.orb:nth-child(18) { top: 75%; left: 65%; animation-duration: 10s, 3s, 11s; }
.orb:nth-child(19) { top: 95%; left: 45%; animation-duration: 8s, 6s, 10s; }
.orb:nth-child(20) { top: 5%; left: 55%; animation-duration: 9s, 5s, 13s; }
/* Orb movement */
@keyframes float {
0% { transform: translate(0, 0); }
25% { transform: translate(-5px, 5px); }
50% { transform: translate(10px, -10px); }
75% { transform: translate(-5px, -5px); }
100% { transform: translate(0, 0); }
}
/* Glow pulse */
@keyframes glow {
0%, 100% {
box-shadow: 0 0 8px #00f0ffaa, 0 0 16px #00f0ffff;
filter: brightness(1.3) contrast(1.2);
}
50% {
box-shadow: 0 0 12px #00f0ffdd, 0 0 24px #00f0ffff;
filter: brightness(1.5) contrast(1.3);
}
}
/* Hue rotation for color shift */
@keyframes hueShift {
0% { filter: hue-rotate(0deg); }
100% { filter: hue-rotate(360deg); }
}