Spaces:
Running
Running
Upload index.html with huggingface_hub
Browse files- index.html +144 -19
index.html
CHANGED
|
@@ -2,28 +2,153 @@
|
|
| 2 |
<html lang="en">
|
| 3 |
|
| 4 |
<head>
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
| 10 |
</head>
|
| 11 |
|
| 12 |
<body>
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
</body>
|
| 28 |
|
| 29 |
</html>
|
|
|
|
| 2 |
<html lang="en">
|
| 3 |
|
| 4 |
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<title>Apple Style Chatbot - Powered by Transformers.js</title>
|
| 8 |
+
<link rel="stylesheet" href="style.css">
|
| 9 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 10 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 11 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
| 12 |
</head>
|
| 13 |
|
| 14 |
<body>
|
| 15 |
+
<div class="app-container">
|
| 16 |
+
<!-- Header -->
|
| 17 |
+
<header class="header">
|
| 18 |
+
<div class="header-content">
|
| 19 |
+
<div class="logo">
|
| 20 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
| 21 |
+
<path d="M12 2L2 7V17L12 22L22 17V7L12 2Z" stroke="url(#gradient)" stroke-width="2" stroke-linecap="round"
|
| 22 |
+
stroke-linejoin="round" />
|
| 23 |
+
<path d="M12 22V12" stroke="url(#gradient)" stroke-width="2" stroke-linecap="round"
|
| 24 |
+
stroke-linejoin="round" />
|
| 25 |
+
<path d="M22 7L12 12L2 7" stroke="url(#gradient)" stroke-width="2" stroke-linecap="round"
|
| 26 |
+
stroke-linejoin="round" />
|
| 27 |
+
<defs>
|
| 28 |
+
<linearGradient id="gradient" x1="0%" y1="0%" x2="100%" y2="100%">
|
| 29 |
+
<stop offset="0%" style="stop-color:#007AFF;stop-opacity:1" />
|
| 30 |
+
<stop offset="100%" style="stop-color:#5856D6;stop-opacity:1" />
|
| 31 |
+
</linearGradient>
|
| 32 |
+
</defs>
|
| 33 |
+
</svg>
|
| 34 |
+
<span>AI Chatbot</span>
|
| 35 |
+
</div>
|
| 36 |
+
<div class="header-actions">
|
| 37 |
+
<button id="clearBtn" class="header-btn">
|
| 38 |
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 39 |
+
<path d="M3 6h18M8 6V4a2 2 0 012-2h4a2 2 0 012 2v2m3 0v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6h14zM10 11v6M14 11v6"/>
|
| 40 |
+
</svg>
|
| 41 |
+
Clear
|
| 42 |
+
</button>
|
| 43 |
+
<button id="settingsBtn" class="header-btn">
|
| 44 |
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 45 |
+
<circle cx="12" cy="12" r="3"/>
|
| 46 |
+
<path d="M12 1v6m0 6v6m4.22-13.22l4.24 4.24M1.54 1.54l4.24 4.24M1 12h6m6 0h6"/>
|
| 47 |
+
</svg>
|
| 48 |
+
Settings
|
| 49 |
+
</button>
|
| 50 |
+
</div>
|
| 51 |
+
</div>
|
| 52 |
+
<div class="attribution">
|
| 53 |
+
Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">anycoder</a>
|
| 54 |
+
</div>
|
| 55 |
+
</header>
|
| 56 |
+
|
| 57 |
+
<!-- Main Content -->
|
| 58 |
+
<main class="main-content">
|
| 59 |
+
<!-- Loading Screen -->
|
| 60 |
+
<div id="loadingScreen" class="loading-screen">
|
| 61 |
+
<div class="loading-content">
|
| 62 |
+
<div class="loading-spinner"></div>
|
| 63 |
+
<h2>Loading AI Model</h2>
|
| 64 |
+
<p>Initializing Gemma-3-270M model...</p>
|
| 65 |
+
<div class="progress-bar">
|
| 66 |
+
<div id="progressFill" class="progress-fill"></div>
|
| 67 |
+
</div>
|
| 68 |
+
<div id="loadingStatus" class="loading-status">Preparing...</div>
|
| 69 |
+
</div>
|
| 70 |
+
</div>
|
| 71 |
+
|
| 72 |
+
<!-- Chat Container -->
|
| 73 |
+
<div id="chatContainer" class="chat-container" style="display: none;">
|
| 74 |
+
<div id="messagesList" class="messages-list">
|
| 75 |
+
<!-- Welcome Message -->
|
| 76 |
+
<div class="message assistant">
|
| 77 |
+
<div class="message-avatar">
|
| 78 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 79 |
+
<path d="M12 2L2 7V17L12 22L22 17V7L12 2Z" />
|
| 80 |
+
</svg>
|
| 81 |
+
</div>
|
| 82 |
+
<div class="message-content">
|
| 83 |
+
<div class="message-text">
|
| 84 |
+
Hello! I'm your AI assistant powered by Gemma-3. How can I help you today?
|
| 85 |
+
</div>
|
| 86 |
+
<div class="message-time">Just now</div>
|
| 87 |
+
</div>
|
| 88 |
+
</div>
|
| 89 |
+
</div>
|
| 90 |
+
</div>
|
| 91 |
+
|
| 92 |
+
<!-- Input Area -->
|
| 93 |
+
<div id="inputArea" class="input-area" style="display: none;">
|
| 94 |
+
<div class="input-container">
|
| 95 |
+
<textarea
|
| 96 |
+
id="messageInput"
|
| 97 |
+
class="message-input"
|
| 98 |
+
placeholder="Type your message here..."
|
| 99 |
+
rows="1"
|
| 100 |
+
maxlength="1000"
|
| 101 |
+
></textarea>
|
| 102 |
+
<button id="sendBtn" class="send-btn" disabled>
|
| 103 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 104 |
+
<path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/>
|
| 105 |
+
</svg>
|
| 106 |
+
</button>
|
| 107 |
+
</div>
|
| 108 |
+
<div class="input-footer">
|
| 109 |
+
<span id="charCount">0 / 1000</span>
|
| 110 |
+
<span class="model-info">Gemma-3-270M • Transformers.js</span>
|
| 111 |
+
</div>
|
| 112 |
+
</div>
|
| 113 |
+
</main>
|
| 114 |
+
|
| 115 |
+
<!-- Settings Modal -->
|
| 116 |
+
<div id="settingsModal" class="modal">
|
| 117 |
+
<div class="modal-content">
|
| 118 |
+
<div class="modal-header">
|
| 119 |
+
<h2>Settings</h2>
|
| 120 |
+
<button class="close-btn" id="closeSettings">
|
| 121 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 122 |
+
<path d="M18 6L6 18M6 6l12 12"/>
|
| 123 |
+
</svg>
|
| 124 |
+
</button>
|
| 125 |
+
</div>
|
| 126 |
+
<div class="modal-body">
|
| 127 |
+
<div class="setting-group">
|
| 128 |
+
<label for="maxTokens">Max Tokens</label>
|
| 129 |
+
<input type="range" id="maxTokens" min="128" max="1024" value="512" step="128">
|
| 130 |
+
<span id="maxTokensValue">512</span>
|
| 131 |
+
</div>
|
| 132 |
+
<div class="setting-group">
|
| 133 |
+
<label for="temperature">Temperature</label>
|
| 134 |
+
<input type="range" id="temperature" min="0" max="1" value="0.7" step="0.1">
|
| 135 |
+
<span id="temperatureValue">0.7</span>
|
| 136 |
+
</div>
|
| 137 |
+
<div class="setting-group">
|
| 138 |
+
<label>
|
| 139 |
+
<input type="checkbox" id="streaming" checked>
|
| 140 |
+
Enable streaming
|
| 141 |
+
</label>
|
| 142 |
+
</div>
|
| 143 |
+
</div>
|
| 144 |
+
<div class="modal-footer">
|
| 145 |
+
<button class="btn btn-primary" id="saveSettings">Save Settings</button>
|
| 146 |
+
</div>
|
| 147 |
+
</div>
|
| 148 |
+
</div>
|
| 149 |
+
</div>
|
| 150 |
+
|
| 151 |
+
<script type="module" src="index.js"></script>
|
| 152 |
</body>
|
| 153 |
|
| 154 |
</html>
|