jaison2611 commited on
Commit
8301a40
·
verified ·
1 Parent(s): a462a68

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +127 -8
index.html CHANGED
@@ -3,12 +3,131 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
6
- <title>Tiny AI Chat</title>
7
  <style>
8
- body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f4f4f9; margin: 0; padding: 10px; display: flex; flex-direction: column; height: 100vh; box-sizing: border-box; }
9
- /* Changed to chat-box to match your script's new target */
10
- #chat-box { flex: 1; overflow-y: auto; background: white; border-radius: 10px; padding: 15px; margin-bottom: 10px; border: 1px solid #ddd; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
11
- .msg { margin-bottom: 12px; line-height: 1.4; word-wrap: break-word; }
12
- .user-message { color: #007bff; background: #eef6ff; padding: 8px 12px; border-radius: 15px 15px 0 15px; align-self: flex-end; margin-left: 20%; }
13
- .ai-message { color: #333; background: #f0f0f0; padding: 8px 12px; border-radius: 15px 15px 15px 0; margin-right: 20%; }
14
- .controls { display: flex; gap: 8px; height: 50px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
6
+ <title>AI-Driven Dashboard | Tiny Chat</title>
7
  <style>
8
+ :root {
9
+ --primary: #007bff;
10
+ --user-bg: #eef6ff;
11
+ --ai-bg: #f0f0f0;
12
+ --text: #333;
13
+ }
14
+
15
+ body {
16
+ font-family: -apple-system, system-ui, sans-serif;
17
+ background: #f4f4f9;
18
+ margin: 0;
19
+ padding: 10px;
20
+ display: flex;
21
+ flex-direction: column;
22
+ height: 100vh;
23
+ box-sizing: border-box;
24
+ overflow: hidden; /* Prevents body bounce on mobile */
25
+ }
26
+
27
+ #status {
28
+ font-size: 11px;
29
+ color: #888;
30
+ text-align: center;
31
+ margin-bottom: 8px;
32
+ text-transform: uppercase;
33
+ letter-spacing: 0.5px;
34
+ height: 14px;
35
+ }
36
+
37
+ #chat-box {
38
+ flex: 1;
39
+ overflow-y: auto;
40
+ background: white;
41
+ border-radius: 12px;
42
+ padding: 15px;
43
+ margin-bottom: 10px;
44
+ border: 1px solid #ddd;
45
+ display: flex;
46
+ flex-direction: column;
47
+ gap: 10px;
48
+ box-shadow: 0 4px 6px rgba(0,0,0,0.05);
49
+ }
50
+
51
+ .msg {
52
+ max-width: 85%;
53
+ padding: 10px 14px;
54
+ border-radius: 18px;
55
+ font-size: 15px;
56
+ line-height: 1.4;
57
+ word-wrap: break-word;
58
+ }
59
+
60
+ .user-message {
61
+ align-self: flex-end;
62
+ background: var(--primary);
63
+ color: white;
64
+ border-bottom-right-radius: 4px;
65
+ }
66
+
67
+ .ai-message {
68
+ align-self: flex-start;
69
+ background: var(--ai-bg);
70
+ color: var(--text);
71
+ border-bottom-left-radius: 4px;
72
+ }
73
+
74
+ .controls {
75
+ display: flex;
76
+ gap: 8px;
77
+ height: 48px;
78
+ flex-shrink: 0; /* Critical for mobile keyboard visibility */
79
+ }
80
+
81
+ input {
82
+ flex: 1;
83
+ border-radius: 24px;
84
+ border: 1px solid #ccc;
85
+ padding: 0 16px;
86
+ font-size: 16px; /* Prevents iOS zoom-on-focus */
87
+ outline: none;
88
+ transition: border 0.2s;
89
+ }
90
+
91
+ input:focus { border-color: var(--primary); }
92
+
93
+ button {
94
+ background: var(--primary);
95
+ color: white;
96
+ border: none;
97
+ border-radius: 24px;
98
+ padding: 0 22px;
99
+ font-weight: 600;
100
+ cursor: pointer;
101
+ touch-action: manipulation; /* Fixes mobile tap delay */
102
+ transition: opacity 0.2s;
103
+ }
104
+
105
+ button:disabled {
106
+ background: #cbd5e0;
107
+ cursor: not-allowed;
108
+ }
109
+
110
+ /* Small screen adjustments */
111
+ @media (max-height: 500px) {
112
+ #status { display: none; }
113
+ #chat-box { padding: 8px; }
114
+ }
115
+ </style>
116
+ </head>
117
+ <body>
118
+
119
+ <div id="status">Ready to initialize engine</div>
120
+
121
+ <div id="chat-box" role="log" aria-live="polite">
122
+ <div class="msg ai-message">Welcome. Click "Load AI" to start the local model (~170MB).</div>
123
+ </div>
124
+
125
+ <div class="controls">
126
+ <input type="text" id="chat-input" placeholder="Loading..." disabled autocomplete="off">
127
+ <button id="main-btn">Load AI</button>
128
+ </div>
129
+
130
+ <script type="module" src="progress_callback.js"></script>
131
+
132
+ </body>
133
+ </html>