-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathoptions.html
More file actions
285 lines (269 loc) · 17 KB
/
options.html
File metadata and controls
285 lines (269 loc) · 17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Tab Settings</title>
<link rel="stylesheet" href="style.css">
</head>
<body class="options">
<div id="notification" class="hidden"></div>
<div id="options-wrapper">
<div id="back">
<span id="back-link">×</span>
</div>
<div class="options-sidebar">
<h1>Settings</h1>
<nav>
<a href="#general" class="active">General</a>
<a href="#shortcuts">Shortcuts</a>
<a href="#appearance">Appearance</a>
<a href="#sidebar-settings">Sidebar</a>
<a href="#preset">Backup</a>
<a href="#about">About</a>
</nav>
</div>
<div class="options-content">
<div id="general" class="options-panel active">
<h2>General Components</h2>
<label class="checkbox-label"><input type="checkbox" id="show-clock"><span class="custom-checkbox"></span> Show Clock</label>
<label class="checkbox-label"><input type="checkbox" id="show-weather"><span class="custom-checkbox"></span> Show Weather</label>
<div id="weather-options" class="sub-settings">
<label class="checkbox-label"><input type="checkbox" id="use-custom-city"><span class="custom-checkbox"></span> Use a custom location</label>
<div id="custom-city-container" style="display: none;">
<label for="custom-city">Custom City</label>
<div id="city-search-container">
<input type="text" id="custom-city" name="custom-city" placeholder="Search for a city..." autocomplete="off">
<div id="city-suggestions"></div>
</div>
</div>
<div class="setting-row segmented-control-container">
<label>Temperature Unit:</label>
<div class="segmented-control">
<label><input type="radio" name="temp-unit" value="celsius"><span>°C</span></label>
<label><input type="radio" name="temp-unit" value="fahrenheit"><span>°F</span></label>
</div>
</div>
</div>
<label class="checkbox-label"><input type="checkbox" id="show-bookmarks"><span class="custom-checkbox"></span> Show Bookmarks</label>
<div id="bookmark-folder-selector-span" class="sub-settings">
<label for="bookmark-folders">Select Bookmark folder: </label>
<select id="bookmark-folders" name="bookmark-folders">
</select>
<br>
<span id="expand-bookmarks-span">
<label class="checkbox-label"><input type="checkbox" id="expand-bookmarks"><span class="custom-checkbox"></span> Expand bookmark folders by default</label>
</span>
</div>
</div>
<div id="shortcuts" class="options-panel">
<h2>Shortcuts</h2>
<label class="checkbox-label"><input type="checkbox" id="show-topRight"><span class="custom-checkbox"></span>Show Top-Right Shortcuts</label>
<div id="shortcuts-links" class="sub-settings">
<p>Customize which shortcut links are displayed and in what order.</p>
<table class="options-table" id="top-right-links">
<thead>
<tr>
<th>Show</th>
<th>Link</th>
<th class="drag-handle-header">Order</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div id="appearance" class="options-panel">
<h2>Appearance</h2>
<div class="setting-row segmented-control-container">
<label>Theme:</label>
<div class="segmented-control">
<label><input type="radio" name="theme" value="system"><span>System</span></label>
<label><input type="radio" name="theme" value="dark"><span>Dark</span></label>
<label><input type="radio" name="theme" value="light"><span>Light</span></label>
</div>
</div>
<div class="setting-row">
<label class="checkbox-label"><input type="checkbox" id="show-autoHide"><span class="custom-checkbox"></span> Auto-hide control buttons (Show on hover)</label>
</div>
<div class="setting-row">
<label for="background-image-input">Custom Background Image:</label>
<div class="background-image-controls">
<label for="background-image-input" id="background-add-label" class="background-add-label">
<div id="background-preview-container" class="background-preview-container">
<span class="plus-icon">+</span>
</div>
</label>
<div id="image-present-container" class="background-preview-container hidden">
<img id="background-preview" src="#" alt="Background preview" class="hidden">
<button id="clear-background-image" class="clear-background-button hidden">×</button>
</div>
<input type="file" id="background-image-input" class="visually-hidden" accept="image/*">
</div>
</div>
<label class="checkbox-label"><input type="checkbox" id="use-unsplash"><span class="custom-checkbox"></span> Use random background from Unsplash</label>
<div id="unsplash-options" class="sub-settings">
<p style="font-size: 0.9em; opacity: 0.8; margin-top: -0.5em; margin-bottom: 1em;">This will fetch a new high-quality background image. It will override the custom background image if one is set.</p>
<div class="setting-row">
<label for="unsplash-api-key">Unsplash API Key (Required)</label>
<input type="text" id="unsplash-api-key" placeholder="Enter your Unsplash Access Key">
<p style="font-size: 0.8em; opacity: 0.7; margin-top: 0.3em;">An API key is required to fetch images from Unsplash. Get a free key from <a href="https://unsplash.com/developers" target="_blank" rel="noopener">Unsplash Developers</a>.</p>
</div>
<div class="tooltip-wrapper" data-tooltip="Requires an Unsplash API Key">
<div class="setting-row">
<label for="unsplash-update-frequency">Update Frequency</label>
<select id="unsplash-update-frequency" disabled>
<option value="15min">15 Minutes</option>
<option value="30min">30 Minutes</option>
<option value="hourly">Hourly</option>
<option value="daily">Daily</option>
<option value="weekly">Weekly</option>
</select>
</div>
</div>
<div class="tooltip-wrapper" data-tooltip="Requires an Unsplash API Key">
<div class="setting-row">
<label class="checkbox-label" for="show-unsplash-refresh">
<input type="checkbox" id="show-unsplash-refresh" disabled><span class="custom-checkbox"></span> Show manual refresh button
</label>
</div>
</div>
</div>
<label class="checkbox-label"><input type="checkbox" id="show-pixelArt"><span class="custom-checkbox"></span>Show Background Pixel Art</label>
<div id="pixel-art-select-div" class="sub-settings">
<label for="pixel-art-select">Select Pixel Art: </label>
<select id="pixel-art-select" name="pixel-art-select">
<option value="flowers">Flowers</option>
<option value="hearts">Hearts</option>
<option value="stars">Stars</option>
<option value="kitty">Kitty</option>
<option value="leaves">Leaves</option>
<option value="custom">Custom</option>
</select>
<br>
<div id="custom-svg-input-div">
<label for="custom-svg-input">Custom SVG</label><br>
<textarea id="custom-svg-input" name="custom-svg-input" rows="4" cols="50"
placeholder="Paste your SVG code here..."></textarea>
<br>
<ul style="text-align: left; margin-top: 0.5em;">
<li>For best results:
<ul>
<li>The SVG should have a `viewBox="0 0 512 512"` attribute.</li>
<li>Remove any `fill` attributes from the SVG paths to allow the extension's theme colors to apply.</li>
</ul>
</li>
<li>You can use online tools to create or convert images to SVG code:
<ul>
<li><a href="https://svgco.de/" target="_blank" rel="noopener">SVGcode</a> - Convert raster images (PNG, JPG) to SVG.</li>
<li><a href="https://nikitahl.github.io/svg-2-code/" target="_blank" rel="noopener">SVG-2-Code</a> - Optimize and get code from an SVG file.</li>
</ul>
</li>
</ul>
</div>
<div class="setting-row">
<label for="pixelArtOpacity">Pixel Art Opacity</label>
<input type="range" id="pixelArtOpacity" min="0" max="100" step="1">
</div>
<div class="setting-row">
<label for="pixelArtDensity">Pixel Art Density</label>
<input type="range" id="pixelArtDensity" min="0" max="100" step="1">
</div>
<div class="setting-row"><label>Pixel Art Color (Dark Theme)<input type="color" id="pixelArtColorDark"></label></div>
<div class="setting-row"><label>Pixel Art Color (Light Theme)<input type="color" id="pixelArtColorLight"></label></div>
</div>
<div class="setting-row" style="margin-top: 2em;">
<label for="custom-css">Custom CSS</label>
<p style="font-size: 0.9em; opacity: 0.8; margin-top: 0.3em; margin-bottom: 0.8em;">Add your own CSS to customize the appearance of the new tab page. Changes apply after saving settings.</p>
<textarea id="custom-css" rows="10" placeholder="/* Add your custom CSS here */
/* Example:
body { font-family: 'Comic Sans MS'; }
.clock { font-size: 5em; }
*/" style="width: 100%; font-family: monospace; font-size: 0.9em;"></textarea>
<p style="font-size: 0.8em; opacity: 0.7; margin-top: 0.5em;">Note: Invalid CSS may affect page styling. Use the "Restore Defaults" button if something breaks.</p>
</div>
</div>
<div id="sidebar-settings" class="options-panel">
<h2>Sidebar</h2>
<label class="checkbox-label"><input type="checkbox" id="show-sidebar"><span class="custom-checkbox"></span> Show Sidebar</label>
<div id="sidebar-options" class="sub-settings">
<div class="setting-row segmented-control-container">
<label>Sidebar Position:</label>
<div class="segmented-control">
<label><input type="radio" name="sidebar-position" value="left"><span>Left</span></label>
<label><input type="radio" name="sidebar-position" value="right"><span>Right</span></label>
</div>
</div>
<div class="sub-settings">
<label>Widgets (drag to reorder):</label>
<table class="options-table" id="sidebar-widgets-table">
<thead>
<tr>
<th>Show</th>
<th>Widget</th>
<th class="drag-handle-header">Order</th>
</tr>
</thead>
<tbody id="sidebar-widgets" class="reorder-list"></tbody>
</table>
</div>
<br>
<div class="setting-row">
<div class="tooltip-wrapper" id="sidebar-show-customize-wrapper" data-tooltip="This is required while 'Keep sidebar expanded' is enabled.">
<label class="checkbox-label"><input type="checkbox" id="sidebar-show-customize"><span class="custom-checkbox"></span> Show Customize button in sidebar</label>
</div>
</div>
<div class="setting-row">
<label class="checkbox-label"><input type="checkbox" id="sidebar-expanded-check"><span class="custom-checkbox"></span> Keep sidebar expanded</label>
</div>
</div>
</div>
<div id="preset" class="options-panel">
<h2>Backup</h2>
<p>Export your current settings or import a previously saved configuration.</p>
<div class="settings-data-container">
<div class="button-row">
<button id="export-settings" class="ghost-button">Export Settings</button>
<button id="import-settings" class="ghost-button">Import Settings</button>
<input type="file" id="import-file" accept=".json" style="display:none;">
</div>
<div id="import-drop-zone" class="drop-zone">
<span class="drop-zone-text">or drag & drop a settings file here</span>
</div>
</div>
</div>
<div id="about" class="options-panel">
<h2>About</h2>
<div style="display:flex; align-items:center; gap:1rem; margin-bottom:1rem;">
<img id="about-logo" src="favicons/android-chrome-512x512.png" alt="Logo" style="width:72px;height:72px;border-radius:12px;box-shadow:0 4px 8px rgba(0,0,0,0.12);">
<div>
<div id="about-title" role="button" tabindex="0" style="font-weight:bold; font-size:1.1rem;">Minimal New Tab</div>
<div style="opacity:0.8; margin-top:0.25rem;">Version <span id="extension-version">-</span></div>
</div>
</div>
<br>
<div class="about-links" style="margin-top:1rem; display:flex; gap:0.75rem; flex-wrap:wrap; align-items:center;">
<div class="tooltip-wrapper" data-tooltip="View on Chrome Web Store">
<a id="webstore-link" class="icon-link webstore-badge-link" href="https://chromewebstore.google.com/detail/minimal-new-tab/hdodpjlgcieifmkkidligdnonbfiijnd" target="_blank" rel="noopener noreferrer" aria-label="Chrome Web Store">
<img id="webstore-img" src="favicons/chromewebstore-light.png" alt="Chrome Web Store" class="webstore-badge" />
</a>
</div>
<div class="tooltip-wrapper" data-tooltip="View source on GitHub">
<a id="github-link" class="icon-link" href="https://github.com/ujain1999/minimal_newtab" target="_blank" rel="noopener noreferrer" aria-label="GitHub">
<img id="github-img" src="favicons/github-light.png" alt="GitHub" />
</a>
</div>
</div>
</div>
<div class="button-group">
<div class="button-row">
<button id="save">Save Settings</button>
<button id="restore-defaults">Restore Defaults</button>
</div>
</div>
</div>
</div>
<script src="defaultSettings.js"></script>
<script src="options.js"></script>
</body>
</html>