Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better WEBUI #2687

Closed
Screenmax1234 opened this issue Feb 5, 2025 · 5 comments
Closed

Better WEBUI #2687

Screenmax1234 opened this issue Feb 5, 2025 · 5 comments
Labels

Comments

@Screenmax1234
Copy link

Maybe copy chatgpt website design?

@hlohaus
Copy link
Collaborator

hlohaus commented Feb 5, 2025

Screenshot_20250205_155800_Chrome.jpg

I asked a AI. It creates me that.

@Screenmax1234
Copy link
Author

Really?

@hlohaus
Copy link
Collaborator

hlohaus commented Feb 5, 2025

@Screenmax1234 that are the response from gpt-4o:

Below is an example of the HTML and CSS code which creates a similar UI, resembling the chat interface shown in the image. You can copy this code into one HTML file.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Chat UI</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #1a1a1a;
      color: #fff;
      margin: 0;
      padding: 0;
      display: flex;
      height: 100vh;
    }

    .sidebar {
      width: 25%;
      background-color: #2c2c2c;
      padding: 20px;
      display: flex;
      flex-direction: column;
      border-right: 1px solid #444;
    }

    .sidebar h3 {
      color: #a8a8a8;
      font-size: 16px;
    }

    .sidebar ul {
      list-style-type: none;
      padding: 0;
      margin: 10px 0 0 0;
    }

    .sidebar ul li {
      padding: 10px;
      cursor: pointer;
      border-radius: 5px;
      color: #fff;
    }

    .sidebar ul li.active, .sidebar ul li:hover {
      background-color: #464646;
    }

    .chat-container {
      flex: 1;
      display: flex;
      flex-direction: column;
      background-color: #1a1a1a;
    }

    .chat-header {
      padding: 15px;
      background-color: #252525;
      color: #fff;
      border-bottom: 1px solid #444;
    }

    .chat-content {
      flex: 1;
      padding: 15px;
      overflow-y: scroll;
      display: flex;
      flex-direction: column;
    }

    .message {
      margin: 10px 0;
    }

    .message.user {
      text-align: right;
    }

    .message.assistant {
      text-align: left;
    }

    .message .text {
      display: inline-block;
      padding: 10px 15px;
      border-radius: 10px;
      max-width: 60%;
    }

    .message.user .text {
      background: #4a90e2;
      color: #fff;
    }

    .message.assistant .text {
      background: #333;
      color: #fff;
    }

    .chat-footer {
      display: flex;
      padding: 10px 15px;
      background-color: #252525;
      border-top: 1px solid #444;
    }

    .chat-footer input {
      flex: 1;
      padding: 10px;
      border-radius: 5px;
      border: none;
      margin-right: 10px;
    }

    .chat-footer button {
      padding: 10px 15px;
      border: none;
      background: #4a90e2;
      color: #fff;
      border-radius: 5px;
      cursor: pointer;
    }
  </style>
</head>
<body>
  <div class="sidebar">
    <h3>Chats</h3>
    <ul>
      <li class="active">Pinned</li>
      <li>All</li>
    </ul>
    <ul>
      <li>How to create glass effect</li>
      <li>Explore NFT industry</li>
      <li>AI help in the design process</li>
      <li>What is a Web3 platform</li>
    </ul>
  </div>
  <div class="chat-container">
    <div class="chat-header">NFT</div>
    <div class="chat-content">
      <div class="message user">
        <div class="text">Ok, show me some NFT examples</div>
      </div>
      <div class="message assistant">
        <div class="text">Sure, here is an example of NFTs:</div>
      </div>
      <div class="message assistant">
        <div class="text"><img src="placeholder.jpg" alt="NFT Example" style="width: 100%; border-radius: 8px; background: #555;"></div>
      </div>
      <div class="message user">
        <div class="text">Test message 1 to demonstrate scroll behavior under the header</div>
      </div>
      <div class="message assistant">
        <div class="text">Test message 2 to demonstrate scroll behavior under the header</div>
      </div>
    </div>
    <div class="chat-footer">
      <input type="text" placeholder="Type a message">
      <button>Send</button>
    </div>
  </div>
</body>
</html>

Explanation:

  • Sidebar: Displays a list of chats on the left, including categories like "Pinned" or "All."
  • Chat Header: A section for the current chat topic ("NFT" in this example).
  • Chat Content: Shows the conversation and includes text bubbles for both user and assistant messages.
  • Chat Footer: Contains an input box and a send button.

This file is responsive and adjusts for smaller screen sizes due to flexible container layout design (flexbox). You can run this code as a standalone file by saving it as <filename>.html and opening it in a browser.

Copy link

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

@github-actions github-actions bot added the stale label Feb 13, 2025
Copy link

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants