import { Timeline, CollisionBalls } from './chunk-622Y6LTH.mjs';
import { cn } from './chunk-3NHAT7D4.mjs';
import React2, { useState, useEffect } from 'react';
import { clsx } from 'clsx';
import Link from 'next/link';

var About = ({
  timelineConfig,
  collisionBallsConfig
}) => {
  return /* @__PURE__ */ React2.createElement("section", { id: "about", className: "py-16 bg-white" }, /* @__PURE__ */ React2.createElement("div", { className: "container mx-auto px-4" }, /* @__PURE__ */ React2.createElement("h2", { className: "text-3xl font-bold text-center mb-12" }, "\u5173\u4E8E\u6211"), /* @__PURE__ */ React2.createElement("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-12" }, /* @__PURE__ */ React2.createElement("div", { className: "bg-white rounded-lg shadow-lg p-6" }, /* @__PURE__ */ React2.createElement("h3", { className: "text-2xl font-semibold mb-6" }, "\u4E2A\u4EBA\u7ECF\u5386"), /* @__PURE__ */ React2.createElement(Timeline, { items: timelineConfig.items })), /* @__PURE__ */ React2.createElement("div", { className: "bg-white rounded-lg shadow-lg p-6" }, /* @__PURE__ */ React2.createElement("h3", { className: "text-2xl font-semibold mb-6" }, "\u6280\u80FD\u5C55\u793A"), /* @__PURE__ */ React2.createElement("div", { style: { height: "400px", position: "relative" } }, /* @__PURE__ */ React2.createElement(CollisionBalls, { collisionBallsConfig }))))));
};
var About_default = About;
var Contact = () => {
  const [formData, setFormData] = useState({
    name: "",
    email: "",
    message: ""
  });
  const [isSubmitting, setIsSubmitting] = useState(false);
  const [submitStatus, setSubmitStatus] = useState("idle");
  const handleChange = (e) => {
    const { name, value } = e.target;
    setFormData((prev) => ({
      ...prev,
      [name]: value
    }));
  };
  const handleSubmit = async (e) => {
    e.preventDefault();
    setIsSubmitting(true);
    setSubmitStatus("idle");
    try {
      await new Promise((resolve) => setTimeout(resolve, 1e3));
      setSubmitStatus("success");
      setFormData({ name: "", email: "", message: "" });
    } catch (error) {
      setSubmitStatus("error");
    } finally {
      setIsSubmitting(false);
    }
  };
  return /* @__PURE__ */ React2.createElement("section", { id: "contact", className: "py-16 bg-gray-50" }, /* @__PURE__ */ React2.createElement("div", { className: "max-w-4xl mx-auto px-4 sm:px-6 lg:px-8" }, /* @__PURE__ */ React2.createElement("div", { className: "text-center mb-12" }, /* @__PURE__ */ React2.createElement("h2", { className: "text-3xl font-bold text-gray-900 sm:text-4xl" }, "\u8054\u7CFB\u6211"), /* @__PURE__ */ React2.createElement("p", { className: "mt-4 text-lg text-gray-600" }, "\u6709\u4EFB\u4F55\u95EE\u9898\u6216\u5EFA\u8BAE\uFF1F\u8BF7\u968F\u65F6\u8054\u7CFB\u6211")), /* @__PURE__ */ React2.createElement("div", { className: "bg-white rounded-lg shadow-xl p-6 sm:p-8" }, /* @__PURE__ */ React2.createElement("form", { onSubmit: handleSubmit, className: "space-y-6" }, /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("label", { htmlFor: "name", className: "block text-sm font-medium text-gray-700" }, "\u59D3\u540D"), /* @__PURE__ */ React2.createElement(
    "input",
    {
      type: "text",
      name: "name",
      id: "name",
      value: formData.name,
      onChange: handleChange,
      required: true,
      className: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",
      placeholder: "\u8BF7\u8F93\u5165\u60A8\u7684\u59D3\u540D"
    }
  )), /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700" }, "\u90AE\u7BB1"), /* @__PURE__ */ React2.createElement(
    "input",
    {
      type: "email",
      name: "email",
      id: "email",
      value: formData.email,
      onChange: handleChange,
      required: true,
      className: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",
      placeholder: "\u8BF7\u8F93\u5165\u60A8\u7684\u90AE\u7BB1"
    }
  )), /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("label", { htmlFor: "message", className: "block text-sm font-medium text-gray-700" }, "\u6D88\u606F"), /* @__PURE__ */ React2.createElement(
    "textarea",
    {
      name: "message",
      id: "message",
      rows: 4,
      value: formData.message,
      onChange: handleChange,
      required: true,
      className: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",
      placeholder: "\u8BF7\u8F93\u5165\u60A8\u7684\u6D88\u606F"
    }
  )), /* @__PURE__ */ React2.createElement("div", { className: "flex items-center justify-end" }, /* @__PURE__ */ React2.createElement(
    "button",
    {
      type: "submit",
      disabled: isSubmitting,
      className: clsx("inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white", isSubmitting ? "bg-blue-400 cursor-not-allowed" : "bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500")
    },
    isSubmitting ? "\u53D1\u9001\u4E2D..." : "\u53D1\u9001\u6D88\u606F"
  )), submitStatus === "success" && /* @__PURE__ */ React2.createElement("div", { className: "rounded-md bg-green-50 p-4" }, /* @__PURE__ */ React2.createElement("div", { className: "flex" }, /* @__PURE__ */ React2.createElement("div", { className: "flex-shrink-0" }, /* @__PURE__ */ React2.createElement("svg", { className: "h-5 w-5 text-green-400", viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React2.createElement("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" }))), /* @__PURE__ */ React2.createElement("div", { className: "ml-3" }, /* @__PURE__ */ React2.createElement("p", { className: "text-sm font-medium text-green-800" }, "\u6D88\u606F\u5DF2\u6210\u529F\u53D1\u9001\uFF01")))), submitStatus === "error" && /* @__PURE__ */ React2.createElement("div", { className: "rounded-md bg-red-50 p-4" }, /* @__PURE__ */ React2.createElement("div", { className: "flex" }, /* @__PURE__ */ React2.createElement("div", { className: "flex-shrink-0" }, /* @__PURE__ */ React2.createElement("svg", { className: "h-5 w-5 text-red-400", viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React2.createElement("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }))), /* @__PURE__ */ React2.createElement("div", { className: "ml-3" }, /* @__PURE__ */ React2.createElement("p", { className: "text-sm font-medium text-red-800" }, "\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")))))), /* @__PURE__ */ React2.createElement("div", { className: "mt-12 grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3" }, /* @__PURE__ */ React2.createElement("div", { className: "bg-white rounded-lg shadow-lg p-6 text-center" }, /* @__PURE__ */ React2.createElement("div", { className: "text-blue-600 mb-4" }, /* @__PURE__ */ React2.createElement("svg", { className: "h-8 w-8 mx-auto", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, /* @__PURE__ */ React2.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }))), /* @__PURE__ */ React2.createElement("h3", { className: "text-lg font-medium text-gray-900" }, "\u90AE\u7BB1"), /* @__PURE__ */ React2.createElement("p", { className: "mt-2 text-gray-600" }, "your.email@example.com")), /* @__PURE__ */ React2.createElement("div", { className: "bg-white rounded-lg shadow-lg p-6 text-center" }, /* @__PURE__ */ React2.createElement("div", { className: "text-blue-600 mb-4" }, /* @__PURE__ */ React2.createElement("svg", { className: "h-8 w-8 mx-auto", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, /* @__PURE__ */ React2.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }))), /* @__PURE__ */ React2.createElement("h3", { className: "text-lg font-medium text-gray-900" }, "\u7535\u8BDD"), /* @__PURE__ */ React2.createElement("p", { className: "mt-2 text-gray-600" }, "+86 123 4567 8900")), /* @__PURE__ */ React2.createElement("div", { className: "bg-white rounded-lg shadow-lg p-6 text-center" }, /* @__PURE__ */ React2.createElement("div", { className: "text-blue-600 mb-4" }, /* @__PURE__ */ React2.createElement("svg", { className: "h-8 w-8 mx-auto", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, /* @__PURE__ */ React2.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /* @__PURE__ */ React2.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }))), /* @__PURE__ */ React2.createElement("h3", { className: "text-lg font-medium text-gray-900" }, "\u5730\u5740"), /* @__PURE__ */ React2.createElement("p", { className: "mt-2 text-gray-600" }, "\u4E2D\u56FD\uFF0C\u5317\u4EAC")))));
};
var Contact_default = Contact;
var Home = ({ homeConfig, className }) => {
  const { title, subtitle, buttons, imageSrc } = homeConfig;
  const [displayText, setDisplayText] = useState("");
  const [currentIndex, setCurrentIndex] = useState(0);
  useEffect(() => {
    if (currentIndex < title.length) {
      const timer = setTimeout(() => {
        setDisplayText((prev) => prev + title[currentIndex]);
        setCurrentIndex((prev) => prev + 1);
      }, 150);
      return () => clearTimeout(timer);
    }
    return () => {
      setDisplayText("");
      setCurrentIndex(0);
    };
  }, [currentIndex, title]);
  return /* @__PURE__ */ React2.createElement(
    "section",
    {
      id: "home",
      className: cn("min-h-screen flex items-center justify-center py-16 bg-gradient-to-b from-white to-gray-50", className)
    },
    /* @__PURE__ */ React2.createElement("div", { className: "container mx-auto px-4" }, /* @__PURE__ */ React2.createElement("div", { className: "flex flex-col md:flex-row items-center gap-12" }, /* @__PURE__ */ React2.createElement("div", { className: "flex-1 text-center md:text-left" }, /* @__PURE__ */ React2.createElement("h1", { className: "text-4xl md:text-6xl font-bold mb-6 text-gray-900" }, /* @__PURE__ */ React2.createElement("span", { className: "inline-block" }, displayText), /* @__PURE__ */ React2.createElement("span", { className: "animate-pulse ml-1 text-blue-500" }, "|")), /* @__PURE__ */ React2.createElement("p", { className: "text-xl md:text-2xl text-gray-600 mb-8" }, subtitle), /* @__PURE__ */ React2.createElement("div", { className: "flex flex-wrap gap-4 justify-center md:justify-start" }, buttons.map((button) => /* @__PURE__ */ React2.createElement(
      "a",
      {
        key: button.link,
        href: button.link,
        className: "px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-all duration-300 shadow-md hover:shadow-lg font-medium"
      },
      button.text
    )))), /* @__PURE__ */ React2.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React2.createElement("div", { className: "relative group" }, /* @__PURE__ */ React2.createElement("div", { className: "absolute -inset-1 bg-gradient-to-r from-blue-600 to-purple-600 rounded-lg blur opacity-25 group-hover:opacity-50 transition duration-1000 group-hover:duration-200" }), /* @__PURE__ */ React2.createElement(
      "img",
      {
        src: imageSrc,
        alt: "Profile",
        className: "relative w-full max-w-md mx-auto rounded-lg shadow-xl transform hover:scale-[1.02] transition-transform duration-300 bg-white"
      }
    )))))
  );
};
var Home_default = Home;
var ExperimentCard = ({
  href,
  title,
  description,
  tags,
  category,
  isCompleted,
  updatedAt,
  createdAt,
  className
}) => {
  const formatDate = (dateString) => {
    if (!dateString) return "";
    try {
      const date = new Date(dateString);
      return date.toLocaleDateString("zh-CN", {
        year: "numeric",
        month: "2-digit",
        day: "2-digit"
      });
    } catch (e) {
      return dateString;
    }
  };
  return /* @__PURE__ */ React2.createElement(Link, { href, className: cn("block group", className) }, /* @__PURE__ */ React2.createElement("div", { className: "w-full h-full bg-white rounded-2xl overflow-hidden shadow-md hover:shadow-2xl transition-all duration-300 transform group-hover:-translate-y-1 border border-gray-100 hover:border-gray-200" }, /* @__PURE__ */ React2.createElement("div", { className: "p-6" }, /* @__PURE__ */ React2.createElement("div", { className: "flex items-start justify-between mb-4" }, /* @__PURE__ */ React2.createElement("h3", { className: "text-xl font-semibold text-gray-900 flex-1 pr-4 leading-tight" }, title), /* @__PURE__ */ React2.createElement("div", { className: "flex flex-col gap-2 flex-shrink-0" }, /* @__PURE__ */ React2.createElement("span", { className: cn(
    "px-3 py-1.5 text-xs font-medium rounded-full shadow-sm",
    category === "utility" ? "bg-gradient-to-r from-green-50 to-green-100 text-green-700 border border-green-200" : "bg-gradient-to-r from-purple-50 to-purple-100 text-purple-700 border border-purple-200"
  ) }, category === "utility" ? "\u{1F527} \u5B9E\u7528\u5DE5\u5177" : "\u{1F3AE} \u4F11\u95F2\u5A31\u4E50"), /* @__PURE__ */ React2.createElement("span", { className: cn(
    "px-3 py-1.5 text-xs font-medium rounded-full shadow-sm border",
    isCompleted ? "bg-gradient-to-r from-emerald-50 to-emerald-100 text-emerald-700 border border-emerald-200" : "bg-gradient-to-r from-orange-50 to-orange-100 text-orange-700 border border-orange-200"
  ) }, isCompleted ? "\u2705 \u5DF2\u5B8C\u6210" : "\u{1F6A7} \u8FDB\u884C\u4E2D"))), /* @__PURE__ */ React2.createElement("p", { className: "text-gray-600 mb-4" }, description), updatedAt && /* @__PURE__ */ React2.createElement("div", { className: "flex items-center gap-1 mb-3 text-xs text-gray-500" }, /* @__PURE__ */ React2.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" }, /* @__PURE__ */ React2.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" })), /* @__PURE__ */ React2.createElement("span", null, "\u66F4\u65B0\u4E8E: ", formatDate(updatedAt)), createdAt && createdAt !== updatedAt && /* @__PURE__ */ React2.createElement("span", { className: "ml-2 text-gray-400" }, "\u521B\u5EFA\u4E8E: ", formatDate(createdAt))), /* @__PURE__ */ React2.createElement("div", { className: "flex flex-wrap gap-2" }, tags.map((tag) => /* @__PURE__ */ React2.createElement(
    "span",
    {
      key: tag,
      className: "px-3 py-1.5 text-xs font-medium bg-gradient-to-r from-gray-50 to-gray-100 text-gray-700 rounded-full border border-gray-200 shadow-sm hover:shadow-md transition-shadow duration-200"
    },
    "#",
    tag
  ))))));
};
var ProjectCarousel = ({ projects, className }) => {
  const [currentIndex, setCurrentIndex] = useState(0);
  const nextSlide = () => {
    setCurrentIndex(
      (prevIndex) => prevIndex === projects.length - 1 ? 0 : prevIndex + 1
    );
  };
  const prevSlide = () => {
    setCurrentIndex(
      (prevIndex) => prevIndex === 0 ? projects.length - 1 : prevIndex - 1
    );
  };
  return /* @__PURE__ */ React2.createElement("section", { id: "projects", className: cn("py-16 bg-gray-50", className) }, /* @__PURE__ */ React2.createElement("div", { className: "container mx-auto px-4" }, /* @__PURE__ */ React2.createElement("h2", { className: "text-3xl font-bold text-center mb-12 text-gray-900" }, "\u9879\u76EE\u5C55\u793A"), /* @__PURE__ */ React2.createElement("div", { className: "relative max-w-4xl mx-auto" }, /* @__PURE__ */ React2.createElement("div", { className: "relative h-[400px] overflow-hidden rounded-lg shadow-xl" }, projects.map((project, index) => /* @__PURE__ */ React2.createElement(
    "div",
    {
      key: project.id,
      className: cn(
        "absolute w-full h-full transition-all duration-500 transform",
        index === currentIndex ? "translate-x-0 opacity-100" : index < currentIndex ? "-translate-x-full opacity-0" : "translate-x-full opacity-0"
      )
    },
    /* @__PURE__ */ React2.createElement(
      ExperimentCard,
      {
        href: project.link || "#",
        title: project.title,
        description: project.description,
        tags: project.tags,
        category: "utility"
      }
    )
  ))), /* @__PURE__ */ React2.createElement(
    "button",
    {
      onClick: prevSlide,
      className: "absolute left-4 top-1/2 -translate-y-1/2 p-2 rounded-full bg-white/80 hover:bg-white shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-all z-[10]"
    },
    /* @__PURE__ */ React2.createElement(
      "svg",
      {
        className: "w-6 h-6 text-gray-600",
        fill: "none",
        stroke: "currentColor",
        viewBox: "0 0 24 24"
      },
      /* @__PURE__ */ React2.createElement(
        "path",
        {
          strokeLinecap: "round",
          strokeLinejoin: "round",
          strokeWidth: 2,
          d: "M15 19l-7-7 7-7"
        }
      )
    )
  ), /* @__PURE__ */ React2.createElement(
    "button",
    {
      onClick: nextSlide,
      className: "absolute right-4 top-1/2 -translate-y-1/2 p-2 rounded-full bg-white/80 hover:bg-white shadow-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-all z-[10]"
    },
    /* @__PURE__ */ React2.createElement(
      "svg",
      {
        className: "w-6 h-6 text-gray-600",
        fill: "none",
        stroke: "currentColor",
        viewBox: "0 0 24 24"
      },
      /* @__PURE__ */ React2.createElement(
        "path",
        {
          strokeLinecap: "round",
          strokeLinejoin: "round",
          strokeWidth: 2,
          d: "M9 5l7 7-7 7"
        }
      )
    )
  ), /* @__PURE__ */ React2.createElement("div", { className: "absolute bottom-4 left-1/2 transform -translate-x-1/2 flex space-x-2 z-[10]" }, projects.map((_, index) => /* @__PURE__ */ React2.createElement(
    "button",
    {
      key: index,
      onClick: () => setCurrentIndex(index),
      className: cn(
        "w-2 h-2 rounded-full transition-all duration-300",
        index === currentIndex ? "bg-blue-500 w-4" : "bg-gray-300"
      )
    }
  ))))));
};

export { About_default, Contact_default, ExperimentCard, Home_default, ProjectCarousel };
//# sourceMappingURL=chunk-OFYBMMWT.mjs.map
//# sourceMappingURL=chunk-OFYBMMWT.mjs.map