Skip to content

Commit f884778

Browse files
committed
hotfix(community-network-card): remove floating animations on mobile
1 parent 982aa70 commit f884778

1 file changed

Lines changed: 7 additions & 37 deletions

File tree

app/community/page.tsx

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,10 @@ type MobileNetworkNode = {
6262
alt: string;
6363
handle: string;
6464
url: string;
65-
phaseOffset: number;
6665
};
6766

6867
type MobileNetworkLogoProps = {
6968
logo: MobileNetworkNode;
70-
index: number;
7169
};
7270

7371
function FloatingNetworkLogo({ logo, baseX, baseY, cursorX, cursorY, pointerActive }: FloatingNetworkLogoProps) {
@@ -153,43 +151,20 @@ function FloatingNetworkLogo({ logo, baseX, baseY, cursorX, cursorY, pointerActi
153151
);
154152
}
155153

156-
function MobileNetworkLogo({ logo, index }: MobileNetworkLogoProps) {
157-
const prefersReducedMotion = useReducedMotion();
158-
154+
function MobileNetworkLogo({ logo }: MobileNetworkLogoProps) {
159155
return (
160-
<motion.a
156+
<a
161157
href={logo.url}
162158
target="_blank"
163159
rel="noopener noreferrer"
164160
className="relative z-10 block w-[76px] h-[76px] rounded-full bg-white p-2.5 shadow-[0_10px_26px_rgba(15,23,42,0.26)] overflow-hidden"
165-
initial={{ opacity: 0, y: 8, scale: 0.96 }}
166-
whileInView={{ opacity: 1, y: 0, scale: 1 }}
167-
viewport={{ once: true, margin: "-20px" }}
168-
whileTap={{ scale: 1.05 }}
169-
animate={prefersReducedMotion ? undefined : { y: [0, -2, 0] }}
170-
style={{ willChange: "transform" }}
171-
transition={
172-
prefersReducedMotion
173-
? { delay: index * 0.08, duration: 0.32 }
174-
: {
175-
y: {
176-
duration: 4.8 + index * 0.45,
177-
ease: "easeInOut",
178-
repeat: Infinity,
179-
delay: logo.phaseOffset * 1.6,
180-
},
181-
delay: index * 0.08,
182-
duration: 0.32,
183-
}
184-
}
185161
>
186162
<BlurImage src={logo.src} alt={logo.alt} className="rounded-full object-contain" fill sizes="76px" />
187-
</motion.a>
163+
</a>
188164
);
189165
}
190166

191167
export default function CommunityPage() {
192-
const prefersReducedMotion = useReducedMotion();
193168
const networkRef = useRef<HTMLDivElement>(null);
194169
const cursorX = useMotionValue(0);
195170
const cursorY = useMotionValue(0);
@@ -321,21 +296,18 @@ export default function CommunityPage() {
321296
alt: "BIND",
322297
handle: "@bit_indonesia",
323298
url: "https://www.instagram.com/bit_indonesia/",
324-
phaseOffset: 0.12,
325299
},
326300
{
327301
src: permitImg,
328302
alt: "PERMIT Beijing",
329303
handle: "@permitbeijing",
330304
url: "https://www.instagram.com/permitbeijing/",
331-
phaseOffset: 0.48,
332305
},
333306
{
334307
src: ppitImg,
335308
alt: "PPIT Tiongkok",
336309
handle: "@ppitiongkok",
337310
url: "https://www.instagram.com/ppitiongkok/",
338-
phaseOffset: 0.78,
339311
},
340312
];
341313

@@ -569,18 +541,16 @@ export default function CommunityPage() {
569541
<div className="relative rounded-[1.5rem] border border-white/15 bg-white/[0.04] backdrop-blur-sm p-5">
570542
<div className="absolute left-9 right-9 top-1/2 -translate-y-1/2 h-px bg-gradient-to-r from-white/10 via-white/35 to-white/10" />
571543
<div className="relative z-10 grid grid-cols-3 gap-4 place-items-center">
572-
{mobileNetworkNodes.map((logo, index) => (
573-
<MobileNetworkLogo key={logo.handle} logo={logo} index={index} />
544+
{mobileNetworkNodes.map((logo) => (
545+
<MobileNetworkLogo key={logo.handle} logo={logo} />
574546
))}
575547
</div>
576548
</div>
577-
<motion.p
549+
<p
578550
className="mt-4 text-[11px] text-center text-slate-300/90 tracking-wide"
579-
animate={prefersReducedMotion ? undefined : { opacity: [0.82, 1, 0.82] }}
580-
transition={{ duration: 4.5, repeat: Infinity, ease: "easeInOut" }}
581551
>
582552
Tap any logo to open Instagram.
583-
</motion.p>
553+
</p>
584554
</div>
585555
</div>
586556
</div>

0 commit comments

Comments
 (0)