|
3 | 3 | <head> |
4 | 4 | <meta charset="UTF-8"> |
5 | 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
6 | | - <title>Vision Browser</title> |
| 6 | + <title>Vision</title> |
7 | 7 | <script src="https://cdn.tailwindcss.com"></script> |
8 | 8 | <link rel="preconnect" href="https://fonts.googleapis.com"> |
9 | 9 | <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
10 | 10 | <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono&display=swap" rel="stylesheet"> |
11 | 11 | <style> |
12 | 12 | :root { |
13 | 13 | --bg-dark: #000000; |
14 | | - --bg-ui: #0a0a0a; |
15 | | - --bg-tab-active: #141414; |
16 | | - --accent: #ffffff; |
17 | | - --border: rgba(255, 255, 255, 0.1); |
| 14 | + --bg-ui: #050505; |
| 15 | + --bg-tab-active: #0f0f0f; |
| 16 | + --border: rgba(255, 255, 255, 0.06); |
18 | 17 | } |
19 | 18 |
|
20 | 19 | body { |
|
31 | 30 | .tab-bar { |
32 | 31 | display: flex; |
33 | 32 | align-items: flex-end; |
34 | | - height: 44px; |
| 33 | + height: 38px; |
35 | 34 | background: var(--bg-dark); |
36 | | - padding: 0 10px; |
| 35 | + padding: 0 12px; |
37 | 36 | border-bottom: 1px solid var(--border); |
38 | 37 | } |
39 | 38 |
|
|
50 | 49 | position: relative; |
51 | 50 | display: flex; |
52 | 51 | align-items: center; |
53 | | - height: 36px; |
54 | | - min-width: 140px; |
55 | | - max-width: 200px; |
56 | | - background: #080808; |
| 52 | + height: 30px; |
| 53 | + min-width: 150px; |
| 54 | + max-width: 210px; |
| 55 | + background: #000; |
57 | 56 | color: #555; |
58 | | - padding: 0 16px; |
59 | | - margin-right: 4px; |
| 57 | + padding: 0 14px; |
| 58 | + margin-right: 2px; |
60 | 59 | cursor: pointer; |
61 | 60 | border-radius: 10px 10px 0 0; |
62 | | - transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); |
| 61 | + transition: all 0.2s ease; |
63 | 62 | font-size: 11px; |
64 | 63 | font-weight: 500; |
65 | 64 | user-select: none; |
66 | 65 | flex-shrink: 0; |
67 | 66 | } |
68 | 67 |
|
69 | 68 | .tab:hover { |
70 | | - background: #111; |
71 | | - color: #aaa; |
72 | | - transform: translateY(-1px); |
73 | | - } |
74 | | - |
75 | | - .tab:active { |
76 | | - transform: scale(0.97); |
| 69 | + color: #999; |
77 | 70 | } |
78 | 71 |
|
79 | 72 | .tab.active { |
80 | 73 | background: var(--bg-tab-active); |
81 | 74 | color: #fff; |
82 | 75 | z-index: 10; |
83 | | - transform: translateY(0); |
84 | 76 | } |
85 | 77 |
|
86 | 78 | .tab.active::before, |
87 | 79 | .tab.active::after { |
88 | 80 | content: ''; |
89 | 81 | position: absolute; |
90 | 82 | bottom: 0; |
91 | | - width: 12px; |
92 | | - height: 12px; |
| 83 | + width: 10px; |
| 84 | + height: 10px; |
93 | 85 | background: var(--bg-tab-active); |
94 | 86 | pointer-events: none; |
95 | 87 | } |
96 | 88 |
|
97 | 89 | .tab.active::before { |
98 | | - left: -12px; |
99 | | - mask-image: radial-gradient(circle at 0 0, transparent 12px, black 12px); |
100 | | - -webkit-mask-image: radial-gradient(circle at 0 0, transparent 12px, black 12px); |
| 90 | + left: -10px; |
| 91 | + mask-image: radial-gradient(circle at 0 0, transparent 10px, black 10px); |
| 92 | + -webkit-mask-image: radial-gradient(circle at 0 0, transparent 10px, black 10px); |
101 | 93 | } |
102 | 94 |
|
103 | 95 | .tab.active::after { |
104 | | - right: -12px; |
105 | | - mask-image: radial-gradient(circle at 100% 0, transparent 12px, black 12px); |
106 | | - -webkit-mask-image: radial-gradient(circle at 100% 0, transparent 12px, black 12px); |
| 96 | + right: -10px; |
| 97 | + mask-image: radial-gradient(circle at 100% 0, transparent 10px, black 10px); |
| 98 | + -webkit-mask-image: radial-gradient(circle at 100% 0, transparent 10px, black 10px); |
107 | 99 | } |
108 | 100 |
|
109 | 101 | .tab-icon { |
110 | 102 | width: 14px; |
111 | 103 | height: 14px; |
112 | | - margin-right: 10px; |
| 104 | + margin-right: 8px; |
113 | 105 | flex-shrink: 0; |
114 | 106 | } |
115 | 107 |
|
|
121 | 113 | } |
122 | 114 |
|
123 | 115 | .tab-close { |
124 | | - width: 18px; |
125 | | - height: 18px; |
| 116 | + width: 16px; |
| 117 | + height: 16px; |
126 | 118 | display: flex; |
127 | 119 | align-items: center; |
128 | 120 | justify-content: center; |
129 | 121 | border-radius: 4px; |
130 | | - margin-left: 8px; |
| 122 | + margin-left: 6px; |
131 | 123 | opacity: 0; |
132 | 124 | transition: all 0.2s; |
133 | 125 | } |
134 | 126 |
|
135 | 127 | .tab:hover .tab-close, .tab.active .tab-close { |
136 | | - opacity: 0.6; |
| 128 | + opacity: 0.5; |
137 | 129 | } |
138 | 130 |
|
139 | 131 | .tab-close:hover { |
140 | | - background: rgba(255,255,255,0.15); |
| 132 | + background: rgba(255,255,255,0.1); |
141 | 133 | opacity: 1 !important; |
142 | | - color: #ff4d4d; |
143 | 134 | } |
144 | 135 |
|
145 | 136 | .nav-bar { |
146 | | - height: 48px; |
| 137 | + height: 42px; |
147 | 138 | background: var(--bg-ui); |
148 | 139 | display: flex; |
149 | 140 | align-items: center; |
150 | | - padding: 0 16px; |
151 | | - gap: 16px; |
| 141 | + padding: 0 12px; |
| 142 | + gap: 12px; |
152 | 143 | border-bottom: 1px solid var(--border); |
153 | 144 | } |
154 | 145 |
|
155 | 146 | .nav-btn { |
156 | | - width: 32px; |
157 | | - height: 32px; |
| 147 | + width: 28px; |
| 148 | + height: 28px; |
158 | 149 | display: flex; |
159 | 150 | align-items: center; |
160 | 151 | justify-content: center; |
161 | | - border-radius: 8px; |
| 152 | + border-radius: 6px; |
162 | 153 | color: #666; |
163 | | - transition: all 0.2s; |
| 154 | + transition: all 0.15s; |
164 | 155 | } |
165 | 156 |
|
166 | 157 | .nav-btn:hover { |
167 | | - background: rgba(255,255,255,0.08); |
| 158 | + background: rgba(255,255,255,0.06); |
168 | 159 | color: #fff; |
169 | 160 | } |
170 | 161 |
|
|
177 | 168 |
|
178 | 169 | .address-bar { |
179 | 170 | width: 100%; |
180 | | - height: 32px; |
| 171 | + height: 28px; |
181 | 172 | background: #000; |
182 | | - border: 1px solid rgba(255,255,255,0.1); |
183 | | - border-radius: 8px; |
184 | | - padding: 0 40px; |
185 | | - color: #eee; |
186 | | - font-size: 13px; |
| 173 | + border: 1px solid rgba(255,255,255,0.06); |
| 174 | + border-radius: 6px; |
| 175 | + padding: 0 36px; |
| 176 | + color: #ddd; |
| 177 | + font-size: 12px; |
187 | 178 | font-family: 'JetBrains Mono', monospace; |
188 | 179 | outline: none; |
189 | 180 | transition: border-color 0.2s; |
190 | 181 | } |
191 | 182 |
|
192 | 183 | .address-bar:focus { |
193 | | - border-color: #555; |
| 184 | + border-color: #333; |
194 | 185 | } |
195 | 186 |
|
196 | 187 | .address-icon { |
197 | 188 | position: absolute; |
198 | | - left: 12px; |
| 189 | + left: 10px; |
199 | 190 | top: 50%; |
200 | 191 | transform: translateY(-50%); |
201 | 192 | color: #444; |
|
220 | 211 | } |
221 | 212 |
|
222 | 213 | #add-tab-btn { |
223 | | - width: 32px; |
224 | | - height: 32px; |
225 | | - margin-bottom: 6px; |
226 | | - margin-left: 6px; |
| 214 | + width: 28px; |
| 215 | + height: 28px; |
| 216 | + margin-bottom: 4px; |
| 217 | + margin-left: 4px; |
227 | 218 | display: flex; |
228 | 219 | align-items: center; |
229 | 220 | justify-content: center; |
230 | | - border-radius: 8px; |
| 221 | + border-radius: 6px; |
231 | 222 | color: #444; |
232 | 223 | transition: all 0.2s; |
233 | 224 | } |
234 | 225 | #add-tab-btn:hover { |
235 | | - background: rgba(255,255,255,0.08); |
236 | 226 | color: #fff; |
237 | | - transform: rotate(90deg); |
238 | 227 | } |
239 | 228 | </style> |
240 | 229 | </head> |
241 | 230 | <body> |
242 | 231 | <div class="tab-bar"> |
243 | 232 | <div class="tabs-list" id="tabs-list"></div> |
244 | 233 | <button id="add-tab-btn"> |
245 | | - <svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg> |
| 234 | + <svg width="14" height="14" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg> |
246 | 235 | </button> |
247 | 236 | </div> |
248 | 237 |
|
249 | 238 | <div class="nav-bar"> |
250 | 239 | <div class="flex gap-1"> |
251 | | - <button class="nav-btn" id="back-btn"><svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"/></svg></button> |
252 | | - <button class="nav-btn" id="forward-btn"><svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/></svg></button> |
253 | | - <button class="nav-btn" id="refresh-btn"><svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/></svg></button> |
| 240 | + <button class="nav-btn" id="back-btn"><svg width="14" height="14" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"/></svg></button> |
| 241 | + <button class="nav-btn" id="forward-btn"><svg width="14" height="14" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/></svg></button> |
| 242 | + <button class="nav-btn" id="refresh-btn"><svg width="14" height="14" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/></svg></button> |
254 | 243 | </div> |
255 | 244 |
|
256 | 245 | <div class="address-bar-container"> |
257 | | - <div class="address-icon"><svg width="14" height="14" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/></svg></div> |
| 246 | + <div class="address-icon"><svg width="12" height="12" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/></svg></div> |
258 | 247 | <input type="text" class="address-bar" id="address-input" placeholder="Vision Search"> |
259 | 248 | </div> |
260 | 249 | </div> |
|
292 | 281 | function getEmbedUrl(input) { |
293 | 282 | const val = input.trim(); |
294 | 283 | if (!val) return 'newtab.html'; |
295 | | - |
296 | 284 | const isDomain = val.includes('.') && !val.includes(' '); |
297 | | - |
298 | 285 | if (isDomain) { |
299 | 286 | let url = val; |
300 | | - if (!url.startsWith('http')) { |
301 | | - url = 'https://' + url; |
302 | | - } |
| 287 | + if (!url.startsWith('http')) url = 'https://' + url; |
303 | 288 | return `/active/embed.html?url=${url}`; |
304 | 289 | } else { |
305 | 290 | return `/active/embed.html?url=https://www.google.com/search?q=${encodeURIComponent(val)}`; |
|
312 | 297 | id, |
313 | 298 | url, |
314 | 299 | title, |
315 | | - favicon: url === 'newtab.html' ? FAVICON_SERVICE + 'vision.inc' : FAVICON_SERVICE + extractDomain(url) |
| 300 | + favicon: url === 'newtab.html' ? FAVICON_SERVICE + 'google.com' : FAVICON_SERVICE + extractDomain(url) |
316 | 301 | }; |
317 | 302 | tabs.push(tab); |
318 | | - |
319 | 303 | const iframe = document.createElement('iframe'); |
320 | 304 | iframe.id = `iframe-${id}`; |
321 | 305 | iframe.className = 'webview'; |
322 | 306 | iframe.src = url; |
323 | 307 | viewport.appendChild(iframe); |
324 | | - |
325 | 308 | setActiveTab(id); |
326 | 309 | } |
327 | 310 |
|
328 | 311 | function setActiveTab(id) { |
329 | 312 | activeTabId = id; |
330 | 313 | const currentTab = tabs.find(t => t.id === id); |
331 | | - |
332 | 314 | document.querySelectorAll('.webview').forEach(ifrm => { |
333 | 315 | ifrm.classList.toggle('active', ifrm.id === `iframe-${id}`); |
334 | 316 | }); |
335 | | - |
336 | 317 | if (currentTab.url === 'newtab.html') { |
337 | 318 | addressInput.value = ''; |
338 | 319 | } else { |
339 | 320 | if (currentTab.url.includes('url=')) { |
340 | | - const target = currentTab.url.split('url=')[1]; |
341 | | - addressInput.value = decodeURIComponent(target); |
| 321 | + addressInput.value = decodeURIComponent(currentTab.url.split('url=')[1]); |
342 | 322 | } else { |
343 | 323 | addressInput.value = currentTab.url; |
344 | 324 | } |
345 | 325 | } |
346 | | - |
347 | 326 | renderTabs(); |
348 | 327 | } |
349 | 328 |
|
|
357 | 336 | setActiveTab(tab.id); |
358 | 337 | return; |
359 | 338 | } |
360 | | - |
361 | 339 | const index = tabs.findIndex(t => t.id === id); |
362 | 340 | tabs = tabs.filter(t => t.id !== id); |
363 | 341 | document.getElementById(`iframe-${id}`).remove(); |
364 | | - |
365 | 342 | if (activeTabId === id) { |
366 | 343 | const nextTab = tabs[index] || tabs[index - 1]; |
367 | 344 | setActiveTab(nextTab.id); |
|
388 | 365 |
|
389 | 366 | const close = document.createElement('div'); |
390 | 367 | close.className = 'tab-close'; |
391 | | - close.innerHTML = `<svg width="12" height="12" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/></svg>`; |
| 368 | + close.innerHTML = `<svg width="10" height="10" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/></svg>`; |
392 | 369 | close.onclick = (e) => closeTab(tab.id, e); |
393 | 370 |
|
394 | 371 | tabEl.appendChild(icon); |
|
402 | 379 | if (e.key === 'Enter') { |
403 | 380 | const url = getEmbedUrl(addressInput.value); |
404 | 381 | const currentTab = tabs.find(t => t.id === activeTabId); |
405 | | - |
406 | 382 | currentTab.url = url; |
407 | | - currentTab.title = addressInput.value.trim() || 'Vision Page'; |
| 383 | + currentTab.title = addressInput.value.trim() || 'Vision'; |
408 | 384 | currentTab.favicon = FAVICON_SERVICE + extractDomain(url); |
409 | | - |
410 | 385 | document.getElementById(`iframe-${activeTabId}`).src = url; |
411 | 386 | renderTabs(); |
412 | 387 | addressInput.blur(); |
|
0 commit comments