AhmadHakami commited on
Commit
ebbe2c7
·
verified ·
1 Parent(s): 3ce9a10

Build a dark-theme landing interface similar in structure and behavior to ChatGPT’s home screen. Include:

Browse files

A centered headline that reads: “Hi there. What should we dive into today?”

A large message-input component (“Message Copilot”) centered on the page with rounded corners. The input should include:

A label

A dropdown selector with multiple modes: “Smart (GPT-5)”, “Quick response”, “Think Deeper”, “Study and learn”, and “Search”

An attachments icon on the right

Below the main input, place a row of suggestion buttons such as “Create content”, “Improve writing”, “Write a first draft”, “Draft a text”, etc.

Implement a modal or dropdown menu for the model selector that shows short descriptions beneath each mode.

Use a dark, modern UI design with the following elements:

Deep navy background

Subtle glows and shadows

Smooth transitions

A responsive layout that centers content on large screens and adapts on mobile

Use React + Tailwind CSS. Organize components cleanly (e.g., Header, ModelSelector, MessageInput, Suggestions).

Provide fully working React code, including components, Tailwind classes, and any supporting structures.

README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Dark Copilot Dive
3
- emoji: 🏆
4
- colorFrom: gray
5
- colorTo: indigo
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
1
  ---
2
+ title: Dark Copilot Dive 🚀
3
+ colorFrom: blue
4
+ colorTo: blue
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://huggingface.co/deepsite).
components/Header.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class Header extends React.Component {
2
+ render() {
3
+ return (
4
+ <header className="w-full py-6 text-center">
5
+ <h1 className="text-4xl font-bold bg-gradient-to-r from-blue-400 to-purple-500 text-transparent bg-clip-text">
6
+ Hi there. What should we dive into today?
7
+ </h1>
8
+ </header>
9
+ );
10
+ }
11
+ }
components/MessageInput.js ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class MessageInput extends React.Component {
2
+ constructor(props) {
3
+ super(props);
4
+ this.state = {
5
+ message: ''
6
+ };
7
+ }
8
+
9
+ handleChange = (e) => {
10
+ this.setState({ message: e.target.value });
11
+ };
12
+
13
+ handleSubmit = (e) => {
14
+ e.preventDefault();
15
+ if (this.state.message.trim()) {
16
+ this.props.onSend(this.state.message);
17
+ this.setState({ message: '' });
18
+ }
19
+ };
20
+
21
+ render() {
22
+ return (
23
+ <form onSubmit={this.handleSubmit} className="w-full max-w-2xl mx-auto">
24
+ <div className="mb-4">
25
+ <label htmlFor="message" className="block text-sm font-medium text-gray-300 mb-2">
26
+ Message Copilot
27
+ </label>
28
+ <div className="flex">
29
+ <input
30
+ type="text"
31
+ id="message"
32
+ value={this.state.message}
33
+ onChange={this.handleChange}
34
+ placeholder="Type your message here..."
35
+ className="flex-1 px-4 py-3 bg-secondary border border-gray-600 rounded-l-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
36
+ />
37
+ <button
38
+ type="button"
39
+ className="px-4 py-3 bg-secondary border-t border-r border-b border-gray-600 hover:bg-gray-700 transition-colors"
40
+ >
41
+ <i data-feather="paperclip" className="w-5 h-5"></i>
42
+ </button>
43
+ <button
44
+ type="submit"
45
+ className="px-4 py-3 bg-blue-600 hover:bg-blue-700 rounded-r-lg transition-colors"
46
+ >
47
+ <i data-feather="send" className="w-5 h-5"></i>
48
+ </button>
49
+ </div>
50
+ </div>
51
+ </form>
52
+ );
53
+ }
54
+ }
components/ModelSelector.js ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class ModelSelector extends React.Component {
2
+ constructor(props) {
3
+ super(props);
4
+ this.state = {
5
+ isOpen: false,
6
+ selectedMode: 'Smart (GPT-5)'
7
+ };
8
+ }
9
+
10
+ toggleDropdown = () => {
11
+ this.setState(prevState => ({ isOpen: !prevState.isOpen }));
12
+ };
13
+
14
+ selectMode = (mode) => {
15
+ this.setState({
16
+ selectedMode: mode,
17
+ isOpen: false
18
+ });
19
+ this.props.onModeChange(mode);
20
+ };
21
+
22
+ render() {
23
+ const modes = [
24
+ { name: 'Smart (GPT-5)', desc: 'Most capable model for complex tasks' },
25
+ { name: 'Quick response', desc: 'Fast answers for simple questions' },
26
+ { name: 'Think Deeper', desc: 'More creative and detailed responses' },
27
+ { name: 'Study and learn', desc: 'Educational explanations and breakdowns' },
28
+ { name: 'Search', desc: 'Web-connected information retrieval' }
29
+ ];
30
+
31
+ return (
32
+ <div className="relative">
33
+ <button
34
+ onClick={this.toggleDropdown}
35
+ className="flex items-center justify-between w-full px-4 py-2 bg-secondary border border-gray-600 rounded-lg hover:bg-gray-700 transition-colors"
36
+ >
37
+ <span>{this.state.selectedMode}</span>
38
+ <i data-feather="chevron-down" className="w-4 h-4 ml-2"></i>
39
+ </button>
40
+
41
+ {this.state.isOpen && (
42
+ <div className="absolute z-10 mt-1 w-full bg-secondary border border-gray-600 rounded-lg shadow-lg overflow-hidden">
43
+ {modes.map((mode, index) => (
44
+ <div
45
+ key={index}
46
+ onClick={() => this.selectMode(mode.name)}
47
+ className="px-4 py-3 hover:bg-gray-700 cursor-pointer transition-colors"
48
+ >
49
+ <div className="font-medium">{mode.name}</div>
50
+ <div className="text-sm text-gray-400">{mode.desc}</div>
51
+ </div>
52
+ ))}
53
+ </div>
54
+ )}
55
+ </div>
56
+ );
57
+ }
58
+ }
components/Suggestions.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class Suggestions extends React.Component {
2
+ render() {
3
+ const suggestions = [
4
+ 'Create content',
5
+ 'Improve writing',
6
+ 'Write a first draft',
7
+ 'Draft a text',
8
+ 'Generate ideas',
9
+ 'Analyze document',
10
+ 'Summarize text',
11
+ 'Answer questions'
12
+ ];
13
+
14
+ return (
15
+ <div className="flex flex-wrap justify-center gap-3 mt-6 max-w-2xl mx-auto">
16
+ {suggestions.map((suggestion, index) => (
17
+ <button
18
+ key={index}
19
+ onClick={() => this.props.onSuggestionClick(suggestion)}
20
+ className="px-4 py-2 bg-secondary hover:bg-gray-700 rounded-full text-sm font-medium transition-colors"
21
+ >
22
+ {suggestion}
23
+ </button>
24
+ ))}
25
+ </div>
26
+ );
27
+ }
28
+ }
index.html CHANGED
@@ -1,19 +1,33 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en" class="dark">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Dark Copilot</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://unpkg.com/feather-icons"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <script src="https://unpkg.com/react@18/umd/react.development.js"></script>
11
+ <script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
12
+ <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
13
+ <style>
14
+ .bg-primary {
15
+ background-color: #0f172a;
16
+ }
17
+ .bg-secondary {
18
+ background-color: #1e293b;
19
+ }
20
+ </style>
21
+ </head>
22
+ <body class="bg-primary min-h-screen text-gray-100">
23
+ <div id="root"></div>
24
+
25
+ <script type="text/babel" src="components/Header.js"></script>
26
+ <script type="text/babel" src="components/ModelSelector.js"></script>
27
+ <script type="text/babel" src="components/MessageInput.js"></script>
28
+ <script type="text/babel" src="components/Suggestions.js"></script>
29
+ <script type="text/babel" src="script.js"></script>
30
+ <script>feather.replace();</script>
31
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
32
+ </body>
33
+ </html>
script.js ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class App extends React.Component {
2
+ constructor(props) {
3
+ super(props);
4
+ this.state = {
5
+ currentMode: 'Smart (GPT-5)'
6
+ };
7
+ }
8
+
9
+ handleModeChange = (mode) => {
10
+ this.setState({ currentMode: mode });
11
+ };
12
+
13
+ handleSendMessage = (message) => {
14
+ console.log(`Sending message in ${this.state.currentMode} mode:`, message);
15
+ // Here you would typically call your API
16
+ };
17
+
18
+ handleSuggestionClick = (suggestion) => {
19
+ console.log(`Selected suggestion:`, suggestion);
20
+ // Here you would handle the suggestion selection
21
+ };
22
+
23
+ render() {
24
+ return (
25
+ <div className="min-h-screen flex flex-col items-center justify-center px-4 pb-20">
26
+ <Header />
27
+ <div className="w-full max-w-2xl mb-6">
28
+ <ModelSelector onModeChange={this.handleModeChange} />
29
+ </div>
30
+ <MessageInput onSend={this.handleSendMessage} />
31
+ <Suggestions onSuggestionClick={this.handleSuggestionClick} />
32
+ </div>
33
+ );
34
+ }
35
+ }
36
+
37
+ ReactDOM.render(<App />, document.getElementById('root'));