|
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 | | - <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet"> |
| 10 | + <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=JetBrains+Mono&display=swap" rel="stylesheet"> |
11 | 11 | <style> |
12 | 12 | body { |
13 | 13 | font-family: 'Inter', sans-serif; |
|
19 | 19 | justify-content: center; |
20 | 20 | height: 100vh; |
21 | 21 | overflow: hidden; |
| 22 | + background-size: cover; |
| 23 | + background-position: center; |
| 24 | + background-repeat: no-repeat; |
22 | 25 | } |
23 | 26 |
|
24 | 27 | .container { |
25 | 28 | width: 100%; |
26 | | - max-width: 500px; |
| 29 | + max-width: 440px; |
27 | 30 | text-align: center; |
28 | 31 | padding: 2rem; |
| 32 | + position: relative; |
| 33 | + z-index: 10; |
| 34 | + } |
| 35 | + |
| 36 | + .liquid-panel { |
| 37 | + background: #000000; |
| 38 | + padding: 3rem 2rem; |
| 39 | + display: flex; |
| 40 | + flex-direction: column; |
| 41 | + align-items: center; |
29 | 42 | } |
30 | 43 |
|
31 | 44 | .time { |
32 | | - font-size: 6rem; |
| 45 | + font-size: 5rem; |
33 | 46 | font-weight: 700; |
34 | | - letter-spacing: -4px; |
| 47 | + letter-spacing: -3px; |
35 | 48 | margin-bottom: 0.25rem; |
36 | 49 | line-height: 1; |
37 | 50 | } |
38 | 51 |
|
39 | 52 | .date { |
40 | | - font-size: 0.75rem; |
| 53 | + font-size: 0.7rem; |
41 | 54 | text-transform: uppercase; |
42 | | - letter-spacing: 0.4em; |
43 | | - color: #444; |
44 | | - margin-bottom: 3.5rem; |
| 55 | + letter-spacing: 0.3em; |
| 56 | + color: #666; |
| 57 | + margin-bottom: 2.5rem; |
45 | 58 | } |
46 | 59 |
|
47 | 60 | .search-box { |
48 | 61 | position: relative; |
49 | 62 | width: 100%; |
| 63 | + max-width: 320px; |
50 | 64 | } |
51 | 65 |
|
52 | 66 | .search-input { |
53 | 67 | width: 100%; |
54 | | - background: #0a0a0a; |
55 | | - border: 1px solid #1a1a1a; |
56 | | - border-radius: 30px; |
57 | | - padding: 1.25rem 2rem; |
| 68 | + background: #111; |
| 69 | + border: none; |
| 70 | + border-radius: 24px; |
| 71 | + padding: 0.8rem 1.5rem; |
58 | 72 | color: #fff; |
59 | | - font-size: 1.1rem; |
| 73 | + font-size: 0.95rem; |
60 | 74 | outline: none; |
61 | | - transition: border-color 0.3s; |
| 75 | + text-align: center; |
| 76 | + transition: all 0.2s ease; |
62 | 77 | } |
63 | 78 |
|
64 | | - .search-input:focus { |
65 | | - border-color: #333; |
| 79 | + .search-input:hover { |
| 80 | + background: #181818; |
66 | 81 | } |
67 | 82 |
|
68 | | - .search-icon { |
69 | | - position: absolute; |
70 | | - right: 1.5rem; |
71 | | - top: 50%; |
72 | | - transform: translateY(-50%); |
73 | | - color: #333; |
| 83 | + .search-input:focus { |
| 84 | + background: #202020; |
| 85 | + box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05); |
74 | 86 | } |
75 | 87 |
|
76 | 88 | .footer { |
|
82 | 94 | justify-content: space-between; |
83 | 95 | align-items: center; |
84 | 96 | font-size: 10px; |
85 | | - color: #333; |
| 97 | + color: #666; |
86 | 98 | text-transform: uppercase; |
87 | 99 | letter-spacing: 0.1em; |
| 100 | + z-index: 20; |
88 | 101 | } |
89 | 102 |
|
90 | 103 | .status-pill { |
91 | | - background: #0a0a0a; |
92 | | - border: 1px solid #1a1a1a; |
93 | | - padding: 4px 10px; |
94 | | - border-radius: 4px; |
| 104 | + background: #000; |
| 105 | + border: 1px solid #111; |
| 106 | + padding: 6px 12px; |
95 | 107 | display: flex; |
96 | 108 | align-items: center; |
97 | 109 | gap: 8px; |
| 110 | + border-radius: 4px; |
98 | 111 | } |
99 | 112 |
|
100 | | - .battery-bar { |
101 | | - width: 18px; |
102 | | - height: 8px; |
| 113 | + .battery-container { |
| 114 | + width: 20px; |
| 115 | + height: 10px; |
103 | 116 | border: 1px solid #333; |
104 | 117 | position: relative; |
| 118 | + padding: 1px; |
| 119 | + border-radius: 1px; |
105 | 120 | } |
106 | | - .battery-bar::after { |
107 | | - content: ''; |
108 | | - position: absolute; |
109 | | - left: 0; |
110 | | - top: 0; |
| 121 | + |
| 122 | + .battery-fill { |
111 | 123 | height: 100%; |
112 | | - width: 10%; |
113 | | - background: #444; |
| 124 | + background: #fff; |
| 125 | + width: 0%; |
| 126 | + transition: width 0.3s; |
| 127 | + } |
| 128 | + |
| 129 | + .wallpaper-btn { |
| 130 | + position: fixed; |
| 131 | + top: 1.5rem; |
| 132 | + right: 1.5rem; |
| 133 | + background: #000; |
| 134 | + border: 1px solid #111; |
| 135 | + color: #666; |
| 136 | + padding: 6px 12px; |
| 137 | + font-size: 10px; |
| 138 | + text-transform: uppercase; |
| 139 | + cursor: pointer; |
| 140 | + transition: all 0.2s; |
| 141 | + z-index: 30; |
| 142 | + border-radius: 4px; |
| 143 | + } |
| 144 | + |
| 145 | + .wallpaper-btn:hover { |
| 146 | + border-color: #333; |
| 147 | + color: #fff; |
| 148 | + } |
| 149 | + |
| 150 | + #file-input { |
| 151 | + display: none; |
114 | 152 | } |
115 | 153 | </style> |
116 | 154 | </head> |
117 | | -<body> |
| 155 | +<body id="page-body"> |
| 156 | + <input type="file" id="file-input" accept="image/gif, image/jpeg, image/png"> |
| 157 | + <button class="wallpaper-btn" onclick="document.getElementById('file-input').click()">Vision Paper</button> |
| 158 | + |
118 | 159 | <div class="container"> |
119 | | - <div class="date" id="date">-- --- --</div> |
120 | | - <div class="time" id="time">00:00</div> |
121 | | - |
122 | | - <div class="search-box"> |
123 | | - <input type="text" id="input" class="search-input" placeholder="Vision Search" autocomplete="off"> |
124 | | - <div class="search-icon"> |
125 | | - <svg width="20" height="20" 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> |
| 160 | + <div class="liquid-panel"> |
| 161 | + <div class="date" id="date">-- --- --</div> |
| 162 | + <div class="time" id="time">00:00</div> |
| 163 | + |
| 164 | + <div class="search-box"> |
| 165 | + <input type="text" id="input" class="search-input" placeholder="Search Vision" autocomplete="off"> |
126 | 166 | </div> |
127 | 167 | </div> |
128 | 168 | </div> |
129 | 169 |
|
130 | 170 | <div class="footer"> |
131 | 171 | <div class="status-pill"> |
132 | | - <div class="battery-bar"></div> |
133 | | - <span>10% Power</span> |
| 172 | + <div class="battery-container"> |
| 173 | + <div class="battery-fill" id="battery-fill"></div> |
| 174 | + </div> |
| 175 | + <span id="battery-text">--%</span> |
134 | 176 | </div> |
135 | | - <div class="flex gap-4"> |
| 177 | + <div class="flex gap-6"> |
136 | 178 | <span id="small-time">00:00</span> |
137 | | - <span>Vision OS v1.0</span> |
| 179 | + <span>Vision Core v1.3</span> |
138 | 180 | </div> |
139 | 181 | </div> |
140 | 182 |
|
|
149 | 191 | document.getElementById('date').textContent = now.toLocaleDateString('en-US', options).toUpperCase(); |
150 | 192 | } |
151 | 193 |
|
| 194 | + async function updateBattery() { |
| 195 | + try { |
| 196 | + const battery = await navigator.getBattery(); |
| 197 | + const setLevel = () => { |
| 198 | + const level = Math.round(battery.level * 100); |
| 199 | + document.getElementById('battery-text').textContent = level + '%'; |
| 200 | + document.getElementById('battery-fill').style.width = level + '%'; |
| 201 | + }; |
| 202 | + setLevel(); |
| 203 | + battery.onlevelchange = setLevel; |
| 204 | + } catch (e) { |
| 205 | + document.getElementById('battery-text').textContent = 'AC'; |
| 206 | + document.getElementById('battery-fill').style.width = '100%'; |
| 207 | + } |
| 208 | + } |
| 209 | + |
| 210 | + const fileInput = document.getElementById('file-input'); |
| 211 | + fileInput.addEventListener('change', (e) => { |
| 212 | + const file = e.target.files[0]; |
| 213 | + if (file) { |
| 214 | + const reader = new FileReader(); |
| 215 | + reader.onload = (event) => { |
| 216 | + const url = event.target.result; |
| 217 | + document.body.style.backgroundImage = `url(${url})`; |
| 218 | + localStorage.setItem('vision_wallpaper', url); |
| 219 | + }; |
| 220 | + reader.readAsDataURL(file); |
| 221 | + } |
| 222 | + }); |
| 223 | + |
| 224 | + const savedWallpaper = localStorage.getItem('vision_wallpaper'); |
| 225 | + if (savedWallpaper) { |
| 226 | + document.body.style.backgroundImage = `url(${savedWallpaper})`; |
| 227 | + } |
| 228 | + |
152 | 229 | setInterval(tick, 1000); |
153 | 230 | tick(); |
| 231 | + updateBattery(); |
154 | 232 |
|
155 | 233 | const input = document.getElementById('input'); |
156 | 234 | input.onkeydown = (e) => { |
|
0 commit comments