Skip to content

Commit 2a0d9d0

Browse files
Enhancement(Landing Page): Improve Gallery Feature Interaction.
1 parent 2c7e5ea commit 2a0d9d0

File tree

3 files changed

+30
-15
lines changed

3 files changed

+30
-15
lines changed

landing-page/src/Pages/Demo/marqu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default function TechMarquee() {
3232
<motion.div
3333
className="flex space-x-6 items-center"
3434
initial={{ x: '0%' }}
35-
animate={{ x: '-100%' }}
35+
animate={{ x: '-200%' }}
3636
transition={{
3737
duration: 10,
3838
ease: "linear",

landing-page/src/Pages/FaqPage/FAQ.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,13 @@ function FAQItem({ question, answer, isOpen, onClick, index, icon }: FAQItemProp
9696

9797
return (
9898
<motion.div
99-
className="rounded-xl overflow-hidden transition-all duration-300
100-
bg-white dark:bg-black border border-gray-100 dark:border-gray-800
101-
hover:shadow-md dark:hover:shadow-green-900/10"
99+
className={`rounded-xl overflow-hidden transition-all duration-300
100+
bg-white dark:bg-black
101+
border
102+
${isOpen
103+
? 'border- 6 border-pink-500 dark:border-grey-500'
104+
: 'border- 6 - dark:border-grey-500'}
105+
`}
102106
initial={{ opacity: 0, y: 30 }}
103107
whileInView={{ opacity: 1, y: 0 }}
104108
transition={{ duration: 0.5, delay: index * 0.1 }}

landing-page/src/Pages/HowItWorks/HowItWorks.tsx

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { motion } from "framer-motion";
2-
import { useState } from "react";
2+
import { useState, useRef } from "react";
3+
34

45
const steps = [
56
{
@@ -33,6 +34,8 @@ const steps = [
3334

3435
export default function GalleryFeatures() {
3536
const [activeStep, setActiveStep] = useState<number | null>(null);
37+
const hoverTimers = useRef<Record<number, number | null>>({});
38+
3639

3740
return (
3841
<section className="py-20 bg-gray-50 dark:bg-black transition-colors duration-300">
@@ -51,17 +54,25 @@ export default function GalleryFeatures() {
5154
whileHover={{ y: -5 }}
5255
>
5356
<div
54-
className={`bg-white dark:bg-[#121212] /* Off-Black Card */
55-
rounded-xl border border-gray-200 dark:border-gray-800
56-
shadow-md hover:shadow-lg
57-
p-6 cursor-pointer h-full /* Change cursor to pointer on hover */
58-
transition-all duration-300
59-
relative
60-
${activeStep === index ? 'ring-2 ring-pink-500 dark:ring-pink-400' : ''}`}
61-
onClick={() => setActiveStep(activeStep === index ? null : index)}
62-
style={{
63-
cursor: `url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"%3E%3Ctext x="10" y="40" font-size="40"%3E${encodeURIComponent(step.icon)}%3C/text%3E%3C/svg%3E'), auto`
57+
onMouseEnter={() => {
58+
// start a 1s timer to set active only if remains hovered
59+
hoverTimers.current[index] = window.setTimeout(() => {
60+
setActiveStep(index);
61+
hoverTimers.current[index] = null;
62+
}, 1000);
6463
}}
64+
onMouseLeave={() => {
65+
// cancel timer if leaving early; if already active, hide immediately
66+
const t = hoverTimers.current[index];
67+
if (t) {
68+
clearTimeout(t);
69+
hoverTimers.current[index] = null;
70+
}
71+
if (activeStep === index) setActiveStep(null);
72+
}}
73+
74+
className={`bg-white dark:bg-[#121212] rounded-xl border border-gray-200 dark:border-gray-800 shadow-md hover:shadow-lg p-6 cursor-pointer h-full transition-all duration-300 relative ${activeStep === index ? 'ring-2 ring-pink-500 dark:ring-pink-400' : ''}`}
75+
6576
>
6677
{/* Step Number Badge */}
6778
<div className="absolute -top-4 left-4 bg-gradient-to-br from-yellow-500 to-green-600 dark:from-green-400 dark:to-yellow-500 text-white rounded-full w-10 h-10 flex items-center justify-center shadow-lg">

0 commit comments

Comments
 (0)