File size: 3,523 Bytes
ab9f226
dd1b723
 
 
7a21348
 
 
 
 
 
 
dd1b723
 
 
7a21348
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dd1b723
7a21348
 
dd1b723
 
 
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
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Apple Style Chatbot - Gemma AI</title>
  <link rel="stylesheet" href="style.css">
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
</head>

<body>
  <div class="app-container">
    <!-- Header -->
    <header class="header">
      <div class="header-content">
        <div class="header-left">
          <div class="ai-icon">
            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
              stroke-linecap="round" stroke-linejoin="round">
              <path d="M12 2L2 7v10c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V7l-10-5z" />
              <path d="M12 8v4" />
              <circle cx="12" cy="16" r="1" />
            </svg>
          </div>
          <div class="header-text">
            <h1>Gemma AI Assistant</h1>
            <p id="status" class="status-text">Loading model...</p>
          </div>
        </div>
        <div class="header-right">
          <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="built-with">
            Built with anycoder
          </a>
        </div>
      </div>
    </header>

    <!-- Chat Container -->
    <main class="chat-container">
      <div id="chatMessages" class="chat-messages">
        <div class="welcome-message">
          <div class="ai-avatar">
            <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
              <path d="M12 2L2 7v10c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V7l-10-5z" />
              <path d="M12 8v4" />
              <circle cx="12" cy="16" r="1" />
            </svg>
          </div>
          <div class="message-content">
            <p>Hello! I'm Gemma, your AI assistant. How can I help you today?</p>
          </div>
        </div>
      </div>

      <!-- Loading Indicator -->
      <div id="loadingIndicator" class="loading-indicator hidden">
        <div class="loading-spinner"></div>
        <span>Downloading model...</span>
        <div class="progress-bar">
          <div id="progressFill" class="progress-fill"></div>
        </div>
        <span id="progressText" class="progress-text">0%</span>
      </div>
    </main>

    <!-- Input Area -->
    <footer class="input-area">
      <div class="input-container">
        <textarea
          id="messageInput"
          class="message-input"
          placeholder="Type your message..."
          rows="1"
          disabled
        ></textarea>
        <button id="sendButton" class="send-button" disabled>
          <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
            <line x1="22" y1="2" x2="11" y2="13"></line>
            <polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
          </svg>
        </button>
      </div>
      <div class="input-footer">
        <small id="charCount">0 / 1000</small>
        <small>Powered by Gemma 3-270M</small>
      </div>
    </footer>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/dist/transformers.min.js"></script>
  <script src="index.js"></script>
</body>

</html>