HowItWorks.jsx 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import { useState, useEffect } from "react";
  2. import { Brain, Search, MessageSquare } from "lucide-react";
  3. const steps = [
  4. {
  5. icon: Search,
  6. title: "Search for a Book",
  7. description: "Enter the title of the book you want to explore.",
  8. },
  9. {
  10. icon: Brain,
  11. title: "AI Analysis",
  12. description: "The AI analyzes the book and generates a mind map.",
  13. },
  14. {
  15. icon: MessageSquare,
  16. title: "Explore Insights",
  17. description:
  18. "Ask questions and explore relationships, themes, and insights.",
  19. },
  20. ];
  21. export default function HowItWorks() {
  22. const [activeStep, setActiveStep] = useState(0);
  23. useEffect(() => {
  24. const interval = setInterval(() => {
  25. setActiveStep((prevStep) => (prevStep + 1) % steps.length);
  26. }, 3000);
  27. return () => clearInterval(interval);
  28. }, []);
  29. return (
  30. <section className="py-24 bg-gradient-to-b from-indigo-50 to-white">
  31. <div className="container mx-auto px-4">
  32. <div className="text-center max-w-3xl mx-auto mb-16">
  33. <h2 className="text-4xl md:text-5xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-indigo-600 to-blue-500 mb-4">
  34. How It Works
  35. </h2>
  36. <p className="text-lg text-indigo-600/80">
  37. Discover the power of AI-driven book analysis
  38. </p>
  39. </div>
  40. <div className="flex flex-col md:flex-row justify-center items-center space-y-8 md:space-y-0 md:space-x-8">
  41. {steps.map((step, index) => (
  42. <div
  43. key={index}
  44. className={`group relative bg-white rounded-xl p-8
  45. shadow-lg transition-all duration-300
  46. hover:shadow-2xl hover:-translate-y-1
  47. hover:bg-gradient-to-br hover:from-indigo-50 hover:to-blue-50
  48. border border-indigo-100 ${
  49. index === activeStep
  50. ? "scale-110 shadow-xl"
  51. : "scale-100"
  52. }`}
  53. >
  54. <div
  55. className="absolute inset-0 bg-gradient-to-r from-indigo-500/5 to-blue-500/5
  56. rounded-xl opacity-0 group-hover:opacity-100 transition-opacity duration-300"
  57. />
  58. <step.icon
  59. className={`w-16 h-16 mx-auto mb-6
  60. transition-transform duration-300
  61. group-hover:scale-110 group-hover:rotate-3 ${
  62. index === activeStep
  63. ? "text-indigo-600"
  64. : "text-indigo-400"
  65. }`}
  66. />
  67. <h3
  68. className="text-xl font-bold text-gray-900 mb-3
  69. group-hover:text-indigo-700 transition-colors duration-300"
  70. >
  71. {step.title}
  72. </h3>
  73. <p
  74. className="text-gray-600 group-hover:text-indigo-900/80
  75. transition-colors duration-300 leading-relaxed"
  76. >
  77. {step.description}
  78. </p>
  79. </div>
  80. ))}
  81. </div>
  82. </div>
  83. </section>
  84. );
  85. }