"use client" import type React from "react" import { useState, useEffect } from "react" import Link from "next/link" import { useRouter } from "next/navigation" import { Button } from "@/components/ui/button" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Textarea } from "@/components/ui/textarea" import { Checkbox } from "@/components/ui/checkbox" import { Sparkles, ArrowLeft, Send, BarChart3, Eye, EyeOff, Shield, Info } from "lucide-react" import { useToast } from "@/hooks/use-toast" import { soundManager } from "@/lib/sound-effects" import HeaderMusicControl from "@/components/header-music-control" export default function SubmitPage() { const [formData, setFormData] = useState({ title: "", currentPain: "", expectedSolution: "", expectedEffect: "", isPublic: true, // 預設為公開 }) const [isSubmitting, setIsSubmitting] = useState(false) const { toast } = useToast() const router = useRouter() // 初始化音效系統 useEffect(() => { const initSound = async () => { // 用戶首次點擊時啟動音頻上下文 const handleFirstInteraction = async () => { await soundManager.play("hover") // 測試音效 document.removeEventListener("click", handleFirstInteraction) } document.addEventListener("click", handleFirstInteraction) } initSound() }, []) const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() setIsSubmitting(true) // 播放提交音效 await soundManager.play("submit") await new Promise((resolve) => setTimeout(resolve, 1500)) const wishes = JSON.parse(localStorage.getItem("wishes") || "[]") const newWish = { id: Date.now(), ...formData, createdAt: new Date().toISOString(), } wishes.push(newWish) localStorage.setItem("wishes", JSON.stringify(wishes)) // 播放成功音效 await soundManager.play("success") toast({ title: "你的困擾已成功提交", description: formData.isPublic ? "正在為你準備專業的回饋,其他人也能看到你的分享..." : "正在為你準備專業的回饋,你的分享將保持私密...", }) setFormData({ title: "", currentPain: "", expectedSolution: "", expectedEffect: "", isPublic: true, }) setIsSubmitting(false) // 跳轉到感謝頁面 setTimeout(() => { router.push("/thank-you") }, 1000) } const handleChange = (field: string, value: string | boolean) => { setFormData((prev) => ({ ...prev, [field]: value })) } const handleButtonClick = async () => { await soundManager.play("click") } return (
{/* 星空背景 - 手機優化 */}
{[...Array(25)].map((_, i) => (
))}
{/* Header - 修復跑版問題 */}
{/* Logo 區域 - 防止文字換行 */}

心願星河

{/* 導航區域 */}
{/* Main Content - 手機優化 */}
{/* 小許願瓶 - 添加呼吸動畫 */}
{/* 小星光粒子 */}
{/* 呼吸光暈 */}

分享你的工作困擾

每一個困擾都是改善的起點,我們會用專業的角度為你分析和建議

困擾分享
請詳細描述你的工作困擾,我們會認真分析並提供專業建議
handleChange("title", e.target.value)} required className="bg-slate-700/50 border-blue-600/50 text-white placeholder:text-blue-300 focus:border-cyan-400 text-sm md:text-base" />