|
16 | 16 | font-family: 'Inter', sans-serif; |
17 | 17 | margin: 0; |
18 | 18 | overflow: hidden; |
19 | | - background: var(--default-gradient); |
20 | | - background-size: cover; |
21 | | - background-position: center; |
22 | | - background-repeat: no-repeat; |
| 19 | + background: transparent; |
23 | 20 | height: 100vh; |
24 | 21 | color: white; |
25 | 22 | display: flex; |
26 | 23 | align-items: center; |
27 | 24 | justify-content: center; |
28 | 25 | user-select: none; |
29 | | - transition: background 0.5s ease; |
30 | 26 | } |
31 | 27 |
|
32 | 28 | .glass-card { |
33 | | - background: rgba(0, 0, 0, 0.2); |
| 29 | + background: rgba(0, 0, 0, 0.4); |
34 | 30 | backdrop-filter: blur(25px); |
35 | 31 | border: 1px solid rgba(255, 255, 255, 0.1); |
36 | 32 | border-radius: 40px; |
|
39 | 35 | width: 100%; |
40 | 36 | max-width: 600px; |
41 | 37 | text-align: center; |
42 | | - transition: transform 0.3s ease; |
43 | | - position: relative; |
44 | | - z-index: 10; |
45 | | - } |
46 | | - |
47 | | - .search-container { |
48 | | - position: relative; |
49 | | - margin-top: 2rem; |
50 | | - width: 100%; |
51 | 38 | } |
52 | 39 |
|
53 | 40 | .search-input { |
|
60 | 47 | font-size: 1.25rem; |
61 | 48 | color: white; |
62 | 49 | outline: none; |
63 | | - transition: all 0.2s ease; |
64 | 50 | } |
65 | 51 |
|
66 | 52 | .search-input:focus { |
|
69 | 55 | box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.3); |
70 | 56 | } |
71 | 57 |
|
72 | | - .search-icon { |
73 | | - position: absolute; |
74 | | - left: 24px; |
75 | | - top: 50%; |
76 | | - transform: translateY(-50%); |
77 | | - color: rgba(255, 255, 255, 0.6); |
78 | | - } |
79 | | - |
80 | | - .clock { |
81 | | - font-size: 1.2rem; |
82 | | - font-weight: 600; |
83 | | - letter-spacing: 0.1em; |
84 | | - text-transform: uppercase; |
85 | | - color: rgba(255, 255, 255, 0.8); |
86 | | - margin-top: 1rem; |
87 | | - } |
88 | | - |
89 | 58 | .brand-title { |
90 | 59 | font-size: 5rem; |
91 | 60 | font-weight: 800; |
|
96 | 65 | margin-bottom: 0.5rem; |
97 | 66 | } |
98 | 67 |
|
99 | | - /* Customize Panel */ |
100 | 68 | #customize-trigger { |
101 | 69 | position: absolute; |
102 | 70 | bottom: 2rem; |
|
108 | 76 | border-radius: 12px; |
109 | 77 | color: rgba(255, 255, 255, 0.7); |
110 | 78 | cursor: pointer; |
111 | | - transition: all 0.2s ease; |
112 | | - z-index: 20; |
113 | | - } |
114 | | - |
115 | | - #customize-trigger:hover { |
116 | | - background: rgba(0, 0, 0, 0.5); |
117 | | - color: white; |
118 | | - transform: translateY(-2px); |
119 | 79 | } |
120 | 80 |
|
121 | 81 | #customize-panel { |
|
128 | 88 | border: 1px solid rgba(255, 255, 255, 0.1); |
129 | 89 | border-radius: 20px; |
130 | 90 | padding: 1.5rem; |
131 | | - box-shadow: 0 20px 40px rgba(0,0,0,0.4); |
132 | 91 | display: none; |
133 | 92 | flex-direction: column; |
134 | 93 | gap: 1rem; |
135 | 94 | z-index: 30; |
136 | 95 | } |
137 | 96 |
|
138 | | - .customize-option { |
139 | | - display: flex; |
140 | | - align-items: center; |
141 | | - justify-content: space-between; |
142 | | - gap: 1rem; |
143 | | - font-size: 0.9rem; |
144 | | - font-weight: 500; |
145 | | - color: rgba(255, 255, 255, 0.9); |
146 | | - } |
147 | | - |
148 | 97 | .btn-action { |
149 | 98 | padding: 0.5rem 1rem; |
150 | 99 | background: #4c1d95; |
|
153 | 102 | cursor: pointer; |
154 | 103 | transition: background 0.2s; |
155 | 104 | text-align: center; |
156 | | - width: 100%; |
157 | | - } |
158 | | - |
159 | | - .btn-action:hover { |
160 | | - background: #7c3aed; |
161 | 105 | } |
162 | 106 |
|
163 | 107 | input[type="color"] { |
|
169 | 113 | cursor: pointer; |
170 | 114 | background: none; |
171 | 115 | } |
172 | | - |
173 | | - input[type="color"]::-webkit-color-swatch-wrapper { |
174 | | - padding: 0; |
175 | | - } |
176 | | - |
177 | | - input[type="color"]::-webkit-color-swatch { |
178 | | - border: 2px solid rgba(255, 255, 255, 0.2); |
179 | | - border-radius: 50%; |
180 | | - } |
181 | 116 | </style> |
182 | 117 | </head> |
183 | 118 | <body> |
184 | 119 | <div class="glass-card"> |
185 | 120 | <h1 class="brand-title">Vision</h1> |
186 | | - <div id="clock" class="clock">00:00:00 — JAN 01</div> |
| 121 | + <div id="clock" class="text-xl font-semibold opacity-80 mb-8">00:00:00</div> |
187 | 122 |
|
188 | | - <form id="search-form" class="search-container"> |
189 | | - <div class="search-icon"> |
| 123 | + <form id="search-form" class="relative"> |
| 124 | + <div class="absolute left-6 top-1/2 -translate-y-1/2 text-white/50"> |
190 | 125 | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg> |
191 | 126 | </div> |
192 | 127 | <input type="text" id="search-input" class="search-input" placeholder="What's your next vision?" autofocus autocomplete="off"> |
193 | 128 | </form> |
194 | 129 |
|
195 | | - <div class="mt-8 flex gap-3 justify-center"> |
| 130 | + <div class="mt-8 flex gap-4 justify-center"> |
196 | 131 | <a href="#" class="p-3 bg-white/5 rounded-2xl border border-white/10 hover:bg-white/10 transition-colors"> |
197 | 132 | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="20" rx="5" ry="5"></rect><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path><line x1="17.5" y1="6.5" x2="17.51" y2="6.5"></line></svg> |
198 | 133 | </a> |
199 | 134 | <a href="#" class="p-3 bg-white/5 rounded-2xl border border-white/10 hover:bg-white/10 transition-colors"> |
200 | 135 | <svg xmlns="http://www.w3.org/2000/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="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"></path></svg> |
201 | 136 | </a> |
202 | | - <a href="#" class="p-3 bg-white/5 rounded-2xl border border-white/10 hover:bg-white/10 transition-colors"> |
203 | | - <svg xmlns="http://www.w3.org/2000/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="M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z"></path></svg> |
204 | | - </a> |
205 | 137 | </div> |
206 | 138 | </div> |
207 | 139 |
|
208 | | - <!-- Customize Trigger --> |
209 | 140 | <button id="customize-trigger" title="Customize Background"> |
210 | | - <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z"/><path d="M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/></svg> |
| 141 | + <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z"/><path d="M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"/><path d="M12 2v2"/><path d="M12 20v2"/></svg> |
211 | 142 | </button> |
212 | 143 |
|
213 | | - <!-- Customize Panel --> |
214 | 144 | <div id="customize-panel"> |
215 | 145 | <div class="text-lg font-bold mb-2 text-purple-400">Appearance</div> |
216 | | - |
217 | | - <div class="customize-option"> |
218 | | - <span>Background Image</span> |
219 | | - <label class="btn-action"> |
220 | | - Upload |
221 | | - <input type="file" id="bg-upload" accept="image/*" class="hidden"> |
222 | | - </label> |
223 | | - </div> |
224 | | - |
225 | | - <div class="customize-option"> |
226 | | - <span>Background Color</span> |
227 | | - <input type="color" id="bg-color" value="#4c1d95"> |
228 | | - </div> |
229 | | - |
230 | | - <div class="border-t border-white/10 pt-4 mt-2"> |
231 | | - <button id="bg-reset" class="btn-action bg-white/10 hover:bg-white/20">Reset to Default</button> |
| 146 | + <div class="flex flex-col gap-3"> |
| 147 | + <div class="flex justify-between items-center text-sm"> |
| 148 | + <span>Wallpaper</span> |
| 149 | + <label class="btn-action"> |
| 150 | + Upload |
| 151 | + <input type="file" id="bg-upload" accept="image/*" class="hidden"> |
| 152 | + </label> |
| 153 | + </div> |
| 154 | + <div class="flex justify-between items-center text-sm"> |
| 155 | + <span>Color</span> |
| 156 | + <input type="color" id="bg-color" value="#4c1d95"> |
| 157 | + </div> |
| 158 | + <button id="bg-reset" class="btn-action bg-white/10">Reset</button> |
232 | 159 | </div> |
233 | 160 | </div> |
234 | 161 |
|
235 | 162 | <script> |
236 | 163 | const clockEl = document.getElementById('clock'); |
237 | 164 | const searchForm = document.getElementById('search-form'); |
238 | 165 | const searchInput = document.getElementById('search-input'); |
239 | | - |
240 | 166 | const customizeTrigger = document.getElementById('customize-trigger'); |
241 | 167 | const customizePanel = document.getElementById('customize-panel'); |
242 | 168 | const bgUpload = document.getElementById('bg-upload'); |
243 | 169 | const bgColor = document.getElementById('bg-color'); |
244 | 170 | const bgReset = document.getElementById('bg-reset'); |
245 | 171 |
|
246 | | - // Clock Update |
247 | 172 | function updateClock() { |
248 | 173 | const now = new Date(); |
249 | | - const timeStr = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); |
250 | | - const dateStr = now.toLocaleDateString([], { month: 'short', day: '2-digit' }).toUpperCase(); |
251 | | - clockEl.textContent = `${timeStr} — ${dateStr}`; |
| 174 | + clockEl.textContent = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' }); |
252 | 175 | } |
253 | | - |
254 | 176 | setInterval(updateClock, 1000); |
255 | 177 | updateClock(); |
256 | 178 |
|
257 | | - // Search Logic |
258 | 179 | searchForm.onsubmit = (e) => { |
259 | 180 | e.preventDefault(); |
260 | 181 | const query = searchInput.value.trim(); |
261 | | - if (query) { |
262 | | - window.parent.postMessage({ type: 'navigate', query }, '*'); |
263 | | - } |
| 182 | + if (query) window.parent.postMessage({ type: 'navigate', query }, '*'); |
264 | 183 | }; |
265 | 184 |
|
266 | | - // Customize Panel Toggle |
267 | 185 | customizeTrigger.onclick = (e) => { |
268 | 186 | e.stopPropagation(); |
269 | | - const isVisible = customizePanel.style.display === 'flex'; |
270 | | - customizePanel.style.display = isVisible ? 'none' : 'flex'; |
| 187 | + customizePanel.style.display = customizePanel.style.display === 'flex' ? 'none' : 'flex'; |
271 | 188 | }; |
272 | 189 |
|
273 | | - document.addEventListener('click', (e) => { |
274 | | - if (!customizePanel.contains(e.target) && e.target !== customizeTrigger) { |
275 | | - customizePanel.style.display = 'none'; |
276 | | - } |
277 | | - }); |
278 | | - |
279 | | - // Background Logic |
280 | 190 | function setBackground(type, value) { |
281 | | - if (type === 'image') { |
282 | | - document.body.style.background = `url(${value})`; |
283 | | - document.body.style.backgroundSize = 'cover'; |
284 | | - document.body.style.backgroundPosition = 'center'; |
285 | | - localStorage.setItem('vision_bg_type', 'image'); |
286 | | - localStorage.setItem('vision_bg_value', value); |
287 | | - } else if (type === 'color') { |
288 | | - document.body.style.background = value; |
289 | | - localStorage.setItem('vision_bg_type', 'color'); |
290 | | - localStorage.setItem('vision_bg_value', value); |
291 | | - } else { |
292 | | - document.body.style.background = 'var(--default-gradient)'; |
293 | | - localStorage.removeItem('vision_bg_type'); |
294 | | - localStorage.removeItem('vision_bg_value'); |
295 | | - } |
296 | | - } |
297 | | - |
298 | | - // Load persisted background |
299 | | - const savedType = localStorage.getItem('vision_bg_type'); |
300 | | - const savedValue = localStorage.getItem('vision_bg_value'); |
301 | | - if (savedType && savedValue) { |
302 | | - setBackground(savedType, savedValue); |
303 | | - if (savedType === 'color') bgColor.value = savedValue; |
| 191 | + localStorage.setItem('vision_bg_type', type); |
| 192 | + localStorage.setItem('vision_bg_value', value); |
| 193 | + window.parent.postMessage({ type: 'bg-update' }, '*'); |
304 | 194 | } |
305 | 195 |
|
306 | 196 | bgUpload.onchange = (e) => { |
307 | 197 | const file = e.target.files[0]; |
308 | 198 | if (!file) return; |
309 | | - |
310 | 199 | const reader = new FileReader(); |
311 | | - reader.onload = (event) => { |
312 | | - setBackground('image', event.target.result); |
313 | | - }; |
| 200 | + reader.onload = (event) => setBackground('image', event.target.result); |
314 | 201 | reader.readAsDataURL(file); |
315 | 202 | }; |
316 | 203 |
|
317 | | - bgColor.oninput = (e) => { |
318 | | - setBackground('color', e.target.value); |
319 | | - }; |
320 | | - |
321 | | - bgReset.onclick = () => { |
322 | | - setBackground('default'); |
323 | | - bgColor.value = '#4c1d95'; |
324 | | - }; |
| 204 | + bgColor.oninput = (e) => setBackground('color', e.target.value); |
| 205 | + bgReset.onclick = () => setBackground('default', ''); |
325 | 206 |
|
326 | | - // Inform browser shell of our title |
327 | 207 | window.parent.postMessage({ type: 'metadata', title: 'Vision Home' }, '*'); |
328 | 208 | </script> |
329 | 209 | </body> |
|
0 commit comments