Skip to content

Commit 3b3138b

Browse files
authored
Update index.html
1 parent ff8a965 commit 3b3138b

1 file changed

Lines changed: 29 additions & 26 deletions

File tree

index.html

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>Vision Browser</title>
6+
<title>Vision</title>
77
<script src="https://cdn.tailwindcss.com"></script>
88
<style>
99
:root {
10-
--bg: #000000;
11-
--nav-bg: #0d0d0d;
12-
--tab-active: #0d0d0d;
10+
--bg: #0a0a0a;
11+
--nav-bg: #0f0f0f;
12+
--tab-active: #0f0f0f;
1313
--text-main: #ffffff;
14-
--text-dim: #555555;
15-
--border: rgba(255, 255, 255, 0.04);
14+
--text-dim: #777777;
15+
--border: rgba(255, 255, 255, 0.06);
16+
--input-gray: #121212;
1617
}
1718

1819
body {
@@ -60,7 +61,7 @@
6061
border-radius: 10px 10px 0 0;
6162
}
6263

63-
.tab:hover { color: #888; }
64+
.tab:hover { color: #aaa; }
6465

6566
.tab.active {
6667
background: var(--tab-active);
@@ -145,22 +146,22 @@
145146
align-items: center;
146147
justify-content: center;
147148
border-radius: 6px;
148-
color: #444;
149+
color: #555;
149150
transition: all 0.2s;
150151
}
151152

152153
.nav-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }
153154

154155
.address-box {
155156
position: relative;
156-
width: 720px;
157+
width: 950px;
157158
margin: 0 auto;
158159
}
159160

160161
.address-bar {
161162
width: 100%;
162163
height: 32px;
163-
background: #050505;
164+
background: var(--input-gray);
164165
border: 1px solid var(--border);
165166
border-radius: 16px;
166167
padding: 0 32px;
@@ -172,17 +173,17 @@
172173
}
173174

174175
.address-bar:focus {
175-
border-color: #333;
176+
border-color: #444;
176177
color: #fff;
177-
background: #000;
178+
background: #1a1a1a;
178179
}
179180

180181
.address-icon {
181182
position: absolute;
182183
left: 12px;
183184
top: 50%;
184185
transform: translateY(-50%);
185-
color: #333;
186+
color: #444;
186187
}
187188

188189
.viewport {
@@ -211,7 +212,7 @@
211212
justify-content: center;
212213
margin-bottom: 6px;
213214
margin-left: 20px;
214-
color: #333;
215+
color: #444;
215216
border-radius: 4px;
216217
transition: all 0.2s;
217218
}
@@ -238,9 +239,8 @@
238239
<div class="address-icon">
239240
<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="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"/></svg>
240241
</div>
241-
<input type="text" id="address-input" class="address-bar" placeholder="Search with Vision or type a URL" autocomplete="off" spellcheck="false">
242+
<input type="text" id="address-input" class="address-bar" placeholder="Search Vision" autocomplete="off" spellcheck="false">
242243
</div>
243-
244244
<div style="width: 100px;"></div>
245245
</div>
246246

@@ -263,7 +263,9 @@
263263
const val = input.trim();
264264
if (!val) return 'newtab.html';
265265

266-
if (val.startsWith('http://') || val.startsWith('https://')) {
266+
if (val.startsWith('https://')) {
267+
return `/active/embed.html?url=${val}`;
268+
} else if (val.startsWith('http://')) {
267269
return `/active/embed.html?url=${val}`;
268270
} else if (val.includes('.') && !val.includes(' ')) {
269271
return `/active/embed.html?url=https://${val}`;
@@ -274,18 +276,19 @@
274276

275277
function getDisplayUrl(url) {
276278
if (url === 'newtab.html') return '';
277-
if (url.includes('url=https://')) {
278-
return decodeURIComponent(url.split('url=https://')[1]);
279-
}
279+
let target = url;
280280
if (url.includes('url=')) {
281-
return decodeURIComponent(url.split('url=')[1]);
281+
target = decodeURIComponent(url.split('url=')[1]);
282282
}
283-
return url;
283+
return target.replace(/^https?:\/\//, '');
284284
}
285285

286286
function extractDomain(url) {
287287
try {
288-
const target = url.includes('url=') ? decodeURIComponent(url.split('url=')[1]) : url;
288+
let target = url;
289+
if (url.includes('url=')) {
290+
target = decodeURIComponent(url.split('url=')[1]);
291+
}
289292
if (!target.startsWith('http')) return 'google.com';
290293
return new URL(target).hostname;
291294
} catch (e) { return 'google.com'; }
@@ -370,7 +373,7 @@
370373
const currentTab = tabs.find(t => t.id === activeTabId);
371374

372375
currentTab.url = resolved;
373-
currentTab.title = getDisplayUrl(resolved) || 'Loading...';
376+
currentTab.title = getDisplayUrl(resolved) || 'Vision';
374377
currentTab.favicon = FAVICON_SERVICE + extractDomain(resolved);
375378

376379
document.getElementById(`iframe-${activeTabId}`).src = resolved;
@@ -390,12 +393,12 @@
390393
if (e.data && e.data.type === 'meta-update') {
391394
const t = tabs.find(x => x.id === activeTabId);
392395
if (t) {
393-
t.title = e.data.title || t.title;
396+
if (e.data.title) t.title = e.data.title;
394397
if (e.data.url) {
395398
t.url = e.data.url;
396399
addressInput.value = getDisplayUrl(t.url);
397400
}
398-
t.favicon = FAVICON_SERVICE + extractDomain(t.url);
401+
t.favicon = FAVICON_SERVICE + extractDomain(t.url || '');
399402
renderTabs();
400403
}
401404
}

0 commit comments

Comments
 (0)