hongjli
2025-04-07 603944bff3fa6a0541235ed0ab39ef9ba986e648
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
"use client";
 
import { Dialog, Transition } from '@headlessui/react';
import { Fragment } from 'react';
 
interface SceneIntroDialogProps {
  isOpen: boolean;
  onClose: () => void;
  onStartChat: () => void;
  scene: {
    title: string;
    description: string;
    imageUrl: string;
    background?: string;
    instructions?: string;
  };
}
 
export default function SceneIntroDialog({
  isOpen,
  onClose,
  onStartChat,
  scene
}: SceneIntroDialogProps) {
  return (
    <Transition appear show={isOpen} as={Fragment}>
      <Dialog as="div" className="relative z-50" onClose={onClose}>
        <Transition.Child
          as={Fragment}
          enter="ease-out duration-300"
          enterFrom="opacity-0"
          enterTo="opacity-100"
          leave="ease-out duration-200"
          leaveFrom="opacity-100"
          leaveTo="opacity-0"
        >
          <div className="fixed inset-0 bg-black/70" />
        </Transition.Child>
        
        <div className="fixed inset-0 overflow-y-auto">
          <div className="flex min-h-full items-center justify-center p-4">
            <Transition.Child
              as={Fragment}
              enter="ease-out duration-300"
              enterFrom="opacity-0 scale-95"
              enterTo="opacity-100 scale-100"
              leave="ease-out duration-200"
              leaveFrom="opacity-100 scale-100"
              leaveTo="opacity-0 scale-95"
            >
              <Dialog.Panel className="w-full max-w-2xl transform overflow-hidden rounded-2xl bg-gradient-to-br from-[#1E2B63] to-[#0A1033] p-6 shadow-xl transition-all">
                {/* 科技感背景效果 */}
                <div className="absolute inset-0 overflow-hidden pointer-events-none">
                  <div className="absolute inset-0 opacity-10" 
                    style={{ 
                      backgroundImage: 'radial-gradient(circle, rgba(106, 219, 255, 0.3) 1px, transparent 1px)', 
                      backgroundSize: '20px 20px' 
                    }}>
                  </div>
                  <div className="absolute top-0 left-0 right-0 h-[1px] bg-gradient-to-r from-transparent via-[#6ADBFF]/40 to-transparent"></div>
                  <div className="absolute bottom-0 left-0 right-0 h-[1px] bg-gradient-to-r from-transparent via-[#6ADBFF]/40 to-transparent"></div>
                </div>
 
                <div className="relative">
                  {/* 标题 */}
                  <Dialog.Title className="text-2xl font-bold text-white mb-4">
                    <span className="text-transparent bg-clip-text bg-gradient-to-r from-[#6ADBFF] to-[#5E72EB]">
                      {scene.title}
                    </span>
                  </Dialog.Title>
 
                  {/* 场景图片 */}
                  <div className="relative h-48 mb-6 rounded-lg overflow-hidden">
                    <img
                      src={scene.imageUrl}
                      alt={scene.title}
                      className="w-full h-full object-cover"
                    />
                    <div className="absolute inset-0 bg-gradient-to-t from-[#0A1033]/80 to-transparent"></div>
                  </div>
 
                  {/* 场景背景 */}
                  <div className="mb-6">
                    <h3 className="text-lg font-semibold text-[#6ADBFF] mb-2">场景背景</h3>
                    <p className="text-gray-300 leading-relaxed">
                      {scene.background || scene.description}
                    </p>
                  </div>
 
                  {/* 使用说明 */}
                  <div className="mb-8">
                    <h3 className="text-lg font-semibold text-[#6ADBFF] mb-2">使用说明</h3>
                    <p className="text-gray-300 leading-relaxed">
                      {scene.instructions || '通过自然语言对话的方式,描述您的具体需求,AI助手将为您提供专业的解决方案。'}
                    </p>
                  </div>
 
                  {/* 按钮组 */}
                  <div className="flex justify-end gap-4">
                    <button
                      onClick={onClose}
                      className="px-4 py-2 text-sm font-medium text-gray-300 hover:text-white transition-colors"
                    >
                      关闭
                    </button>
                    <button
                      onClick={onStartChat}
                      className="relative px-6 py-2 rounded-lg overflow-hidden group backdrop-blur-sm bg-white/5 border border-[#6ADBFF]/30 hover:border-[#6ADBFF]/50 transition-all duration-300"
                    >
                      <div className="absolute inset-0 bg-gradient-to-r from-[#6ADBFF]/5 to-[#5E72EB]/5 group-hover:from-[#6ADBFF]/10 group-hover:to-[#5E72EB]/10 transition-all duration-300"></div>
                      <span className="relative text-white group-hover:text-[#6ADBFF] transition-colors duration-300">
                        开始使用
                      </span>
                    </button>
                  </div>
                </div>
              </Dialog.Panel>
            </Transition.Child>
          </div>
        </div>
      </Dialog>
    </Transition>
  );