Skip to content

Commit 92bf7ff

Browse files
committed
Docs theme
1 parent 31f136f commit 92bf7ff

File tree

8 files changed

+452
-224
lines changed

8 files changed

+452
-224
lines changed

Chrome/dashboard.html

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -264,45 +264,12 @@ <h2>General Settings</h2>
264264
role="tabpanel"
265265
aria-labelledby="about-tab-btn"
266266
>
267-
<div class="about-container">
268-
<aside class="about-sidebar" role="navigation" aria-label="About navigation">
269-
<button class="about-nav active" data-section="getting-started">Getting Started</button>
270-
<button class="about-nav" data-section="installing">Installing Scripts</button>
271-
<button class="about-nav" data-section="managing">Managing Scripts</button>
272-
<button class="about-nav" data-section="creating">Creating Scripts</button>
273-
<button class="about-nav" data-section="exporting">Exporting Scripts</button>
274-
</aside>
275-
276-
<div class="about-content">
277-
<div class="about-section active" id="getting-started">
278-
<h2>Getting Started</h2>
279-
<p>CodeTweak lets you run custom JavaScript ("user&nbsp;scripts") on the sites you choose. Click <em>New Script</em> on the dashboard, write or paste code, pick the target sites and save – that's it!</p>
280-
</div>
281-
282-
<div class="about-section" id="installing">
283-
<h2>Installing Scripts</h2>
284-
<h3>Greasy Fork (1-click)</h3>
285-
<p>Click <em>Browse Scripts</em> to open the Greasy&nbsp;Fork dialog, search for a script and press <em>Install</em>.</p>
286-
<h3>Drag &amp; Drop</h3>
287-
<p>Drag any <code>.js</code> or text file onto the dashboard to import it.</p>
288-
<h3>Paste Code</h3>
289-
<p>Open the editor, paste a script and click <em>Save</em>.</p>
290-
<h3>In-app Greasy Fork search</h3>
291-
<p>Use the search field inside the Greasy&nbsp;Fork modal to find scripts without leaving CodeTweak.</p>
292-
</div>
293-
294-
<div class="about-section" id="managing">
295-
<h2>Managing Scripts</h2>
296-
<p>Use the <em>Scripts</em> table to enable/disable, edit, update, export or delete each script. Filters above the table help locate scripts quickly.</p>
297-
<p>The badge on the extension icon shows how many scripts are active on the current tab.</p>
298-
</div>
299-
300-
<div class="about-section" id="creating">
301-
<h2>Creating Scripts</h2>
302-
<p>The built-in editor supports syntax highlighting and lets you opt-in to Greasemonkey (GM) APIs such as <code>GM_getValue</code>, <code>GM_openInTab</code> and <code>GM_notification</code>. Toggle the checkboxes to inject the APIs you need.</p>
303-
<p>You can also declare <code>@resource</code> and <code>@require</code> headers – the editor will fetch and bundle them automatically.</p>
304-
</div>
305-
</div>
267+
<div class="about-simple">
268+
<h2>About CodeTweak</h2>
269+
<p>
270+
For full documentation, guides, and API references, visit:
271+
<a href="https://mrblankcoding.github.io/CodeTweak/index.html" target="_blank" rel="noopener">https://mrblankcoding.github.io/CodeTweak/index.html</a>
272+
</p>
306273
</div>
307274
</section>
308275
</main>

Chrome/styles/global_theme.css

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* CodeTweak App Global Theme */
12
:root {
23
--primary: #6366f1;
34
--primary-hover: #4f46e5;
@@ -287,25 +288,25 @@ body.modal-open {
287288
}
288289

289290
body.light-theme {
290-
--primary: #4f46e5;
291-
--primary-hover: #4338ca;
292-
--primary-light: rgba(79, 70, 229, 0.08);
293-
--secondary: #7c3aed;
294-
--accent: #0ea5e9;
295-
296-
--bg-primary: #f8fafc;
297-
--bg-secondary: #f1f5f9;
298-
--bg-tertiary: #e2e8f0;
299-
--bg-hover: #dbeafe;
300-
301-
--text-primary: #1e293b;
302-
--text-secondary: #334155;
291+
--primary: #4f56e5;
292+
--primary-hover: #4146cf;
293+
--primary-light: rgba(79, 86, 229, 0.12);
294+
--secondary: #7646e0;
295+
--accent: #1491c9;
296+
297+
--bg-primary: #f5f7fb;
298+
--bg-secondary: #eef2f7;
299+
--bg-tertiary: #e6ebf3;
300+
--bg-hover: #e7eefc;
301+
302+
--text-primary: #1f2937;
303+
--text-secondary: #334155;
303304
--text-muted: #64748b;
304-
--text-accent: #2563eb;
305+
--text-accent: #2a5cd6;
305306

306-
--border-primary: #e2e8f0;
307-
--border-secondary: #cbd5e1;
308-
--border-accent: #4f46e5;
307+
--border-primary: #dde5ef;
308+
--border-secondary: #c7d2e1;
309+
--border-accent: #4f56e5;
309310
--border-focus: var(--primary);
310311

311312
--success: #059669;
@@ -317,14 +318,15 @@ body.light-theme {
317318
--info: #2563eb;
318319
--info-light: rgba(37, 99, 235, 0.08);
319320

320-
--shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
321-
--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
322-
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
323-
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
324-
--shadow-glow: 0 0 0 1px rgba(79, 70, 229, 0.04), 0 0 20px rgba(79, 70, 229, 0.08);
321+
/* Softer elevation for light surfaces */
322+
--shadow-xs: 0 1px 2px 0 rgba(2, 6, 23, 0.02);
323+
--shadow-sm: 0 1px 3px 0 rgba(2, 6, 23, 0.04);
324+
--shadow-md: 0 4px 6px -1px rgba(2, 6, 23, 0.06), 0 2px 4px -1px rgba(2, 6, 23, 0.04);
325+
--shadow-lg: 0 10px 15px -3px rgba(2, 6, 23, 0.05), 0 4px 6px -2px rgba(2, 6, 23, 0.03);
326+
--shadow-glow: 0 0 0 1px rgba(79, 86, 229, 0.05), 0 0 20px rgba(79, 86, 229, 0.08);
325327
--shadow-focus: 0 0 0 3px var(--primary-light);
326328

327-
--shadow-modal: 0 10px 25px rgba(0, 0, 0, 0.1);
329+
--shadow-modal: 0 10px 25px rgba(2, 6, 23, 0.10);
328330

329331
--scrollbar-track: transparent;
330332
--scrollbar-thumb: var(--border-secondary);

docs/advanced-features.html

Lines changed: 42 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,12 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>Advanced Features - CodeTweak User Manual</title>
7-
<!-- Prism.js for syntax highlighting -->
8-
<link href="https://cdn.jsdelivr.net/npm/prismjs@1/themes/prism.css" rel="stylesheet" />
7+
<link rel="stylesheet" href="theme.css">
8+
<!-- Prism.js light and dark themes -->
9+
<link id="prismLight" href="https://cdn.jsdelivr.net/npm/prismjs@1/themes/prism.css" rel="stylesheet" />
10+
<link id="prismDark" href="https://cdn.jsdelivr.net/npm/prismjs@1/themes/prism-tomorrow.css" rel="stylesheet" disabled />
911
<style>
10-
:root {
11-
--primary-color: #4ea1ff;
12-
--text-primary: #1f2937;
13-
--text-secondary: #6b7280;
14-
--background: #ffffff;
15-
--surface: #f8fafc;
16-
--border: #e5e7eb;
17-
--code-bg: #f1f5f9;
18-
--shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
19-
}
20-
21-
* {
22-
margin: 0;
23-
padding: 0;
24-
box-sizing: border-box;
25-
}
26-
27-
body {
28-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
29-
line-height: 1.6;
30-
color: var(--text-primary);
31-
background: var(--background);
32-
}
33-
34-
.container {
35-
max-width: 900px;
36-
margin: 0 auto;
37-
padding: 2rem;
38-
}
12+
.container { padding: 2rem; }
3913

4014
.nav-header {
4115
background: var(--surface);
@@ -541,6 +515,43 @@ <h3>Diagnostic Tools</h3>
541515
</div>
542516
</div>
543517

518+
<script>
519+
(function() {
520+
const STORAGE_KEY = 'codetweak-docs-theme';
521+
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)');
522+
523+
function setPrismFor(theme) {
524+
const light = document.getElementById('prismLight');
525+
const dark = document.getElementById('prismDark');
526+
if (!light || !dark) return;
527+
if (theme === 'dark') {
528+
light.disabled = true;
529+
dark.disabled = false;
530+
} else {
531+
light.disabled = false;
532+
dark.disabled = true;
533+
}
534+
}
535+
536+
function applyThemeFromStorageOrSystem() {
537+
const explicit = localStorage.getItem(STORAGE_KEY);
538+
if (explicit === 'dark' || explicit === 'light') {
539+
document.documentElement.setAttribute('data-theme', explicit);
540+
setPrismFor(explicit);
541+
} else {
542+
document.documentElement.removeAttribute('data-theme');
543+
setPrismFor(prefersDark.matches ? 'dark' : 'light');
544+
}
545+
}
546+
547+
applyThemeFromStorageOrSystem();
548+
prefersDark.addEventListener('change', () => {
549+
if (!localStorage.getItem(STORAGE_KEY)) {
550+
applyThemeFromStorageOrSystem();
551+
}
552+
});
553+
})();
554+
</script>
544555
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/prism.js"></script>
545556
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-javascript.min.js"></script>
546557
</body>

docs/editor.html

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,12 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>Writing Userscripts - CodeTweak User Manual</title>
7-
<!-- Prism.js for syntax highlighting -->
8-
<link href="https://cdn.jsdelivr.net/npm/prismjs@1/themes/prism.css" rel="stylesheet" />
7+
<link rel="stylesheet" href="theme.css">
8+
<!-- Prism.js light and dark themes -->
9+
<link id="prismLight" href="https://cdn.jsdelivr.net/npm/prismjs@1/themes/prism.css" rel="stylesheet" />
10+
<link id="prismDark" href="https://cdn.jsdelivr.net/npm/prismjs@1/themes/prism-tomorrow.css" rel="stylesheet" disabled />
911
<style>
10-
:root {
11-
--primary-color: #2563eb;
12-
--text-primary: #1f2937;
13-
--text-secondary: #6b7280;
14-
--background: #ffffff;
15-
--surface: #f9fafb;
16-
--border: #e5e7eb;
17-
--code-bg: #f3f4f6;
18-
}
19-
20-
* {
21-
margin: 0;
22-
padding: 0;
23-
box-sizing: border-box;
24-
}
25-
26-
body {
27-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
28-
line-height: 1.7;
29-
color: var(--text-primary);
30-
background: var(--background);
31-
}
32-
33-
.container {
34-
max-width: 800px;
35-
margin: 0 auto;
36-
padding: 2rem 1rem;
37-
}
12+
.container { max-width: 800px; }
3813

3914
.nav-header {
4015
background: var(--surface);
@@ -105,11 +80,12 @@
10580
}
10681

10782
.feature-card {
108-
background: white;
83+
background: var(--surface);
10984
border: 1px solid var(--border);
11085
border-radius: 8px;
11186
padding: 2rem;
11287
margin-bottom: 2rem;
88+
box-shadow: var(--shadow);
11389
}
11490

11591
pre {
@@ -183,7 +159,7 @@
183159
}
184160

185161
.nav-btn.secondary {
186-
background: white;
162+
background: var(--surface);
187163
color: var(--text-primary);
188164
border: 1px solid var(--border);
189165
}
@@ -873,7 +849,45 @@ <h4>Error Handling</h4>
873849
</div>
874850
</div>
875851

852+
<script>
853+
(function() {
854+
const STORAGE_KEY = 'codetweak-docs-theme';
855+
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)');
856+
857+
function setPrismFor(theme) {
858+
const light = document.getElementById('prismLight');
859+
const dark = document.getElementById('prismDark');
860+
if (!light || !dark) return;
861+
if (theme === 'dark') {
862+
light.disabled = true;
863+
dark.disabled = false;
864+
} else {
865+
light.disabled = false;
866+
dark.disabled = true;
867+
}
868+
}
869+
870+
function applyThemeFromStorageOrSystem() {
871+
const explicit = localStorage.getItem(STORAGE_KEY);
872+
if (explicit === 'dark' || explicit === 'light') {
873+
document.documentElement.setAttribute('data-theme', explicit);
874+
setPrismFor(explicit);
875+
} else {
876+
document.documentElement.removeAttribute('data-theme');
877+
setPrismFor(prefersDark.matches ? 'dark' : 'light');
878+
}
879+
}
880+
881+
applyThemeFromStorageOrSystem();
882+
prefersDark.addEventListener('change', () => {
883+
if (!localStorage.getItem(STORAGE_KEY)) {
884+
applyThemeFromStorageOrSystem();
885+
}
886+
});
887+
})();
888+
</script>
876889
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/prism.js"></script>
877890
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-javascript.min.js"></script>
891+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
878892
</body>
879893
</html>

0 commit comments

Comments
 (0)