@@ -63,7 +63,7 @@ export function BubbleBackground() {
6363 size : A . r * 2 ,
6464 topPct : toPct ( A . y - A . r , vh ) ,
6565 leftPct : toPct ( A . x - A . r , vw ) ,
66- hue : hues [ 0 ] ,
66+ hue : hues [ 0 ] ?? 285 ,
6767 depth : 0.75 ,
6868 floatDur : 12 + Math . random ( ) * 5 ,
6969 delay : Math . random ( ) * 1.2 ,
@@ -73,7 +73,7 @@ export function BubbleBackground() {
7373 size : B . r * 2 ,
7474 topPct : toPct ( B . y - B . r , vh ) ,
7575 leftPct : toPct ( B . x - B . r , vw ) ,
76- hue : hues [ 2 ] ,
76+ hue : hues [ 2 ] ?? 200 ,
7777 depth : 1.0 ,
7878 floatDur : 12 + Math . random ( ) * 5 ,
7979 delay : Math . random ( ) * 1.2 ,
@@ -100,7 +100,7 @@ export function BubbleBackground() {
100100 size : d ,
101101 topPct : toPct ( cy - r , vh ) ,
102102 leftPct : toPct ( cx - r , vw ) ,
103- hue : hues [ ( 3 + smallSpheres . length ) % hues . length ] ,
103+ hue : hues [ ( 3 + smallSpheres . length ) % hues . length ] ?? 255 ,
104104 depth : 0.9 ,
105105 floatDur : 7 + Math . random ( ) * 4 ,
106106 delay : Math . random ( ) * 3 ,
@@ -229,17 +229,63 @@ export function BubbleBackground() {
229229 < style jsx global > { `
230230 @keyframes bb-float-y {
231231 0% {
232- transform: translate3d(0, 0, 0);
232+ transform: translate3d(0, 0, 0) scale(1);
233+ }
234+ 25% {
235+ transform: translate3d(2px, -8px, 0) scale(1.02);
233236 }
234237 50% {
235- transform: translate3d(0, -10px, 0);
238+ transform: translate3d(0, -16px, 0) scale(1);
239+ }
240+ 75% {
241+ transform: translate3d(-2px, -8px, 0) scale(0.98);
242+ }
243+ 100% {
244+ transform: translate3d(0, 0, 0) scale(1);
245+ }
246+ }
247+
248+ @keyframes bb-float-x {
249+ 0% {
250+ transform: translateX(0);
251+ }
252+ 33% {
253+ transform: translateX(4px);
254+ }
255+ 66% {
256+ transform: translateX(-4px);
257+ }
258+ 100% {
259+ transform: translateX(0);
260+ }
261+ }
262+
263+ @keyframes bb-pulse {
264+ 0% {
265+ opacity: 0.7;
266+ }
267+ 50% {
268+ opacity: 1;
269+ }
270+ 100% {
271+ opacity: 0.7;
272+ }
273+ }
274+
275+ @keyframes bb-rotate {
276+ 0% {
277+ transform: rotate(0deg);
236278 }
237279 100% {
238- transform: translate3d(0, 0, 0 );
280+ transform: rotate(360deg );
239281 }
240282 }
283+
241284 .bb-float {
242- animation: bb-float-y 9s ease-in-out infinite;
285+ animation: bb-float-y 9s ease-in-out infinite,
286+ bb-float-x 7s ease-in-out infinite,
287+ bb-pulse 6s ease-in-out infinite,
288+ bb-rotate 20s linear infinite;
243289 }
244290 ` } </ style >
245291 </ div >
0 commit comments