Skip to content

Commit 78736c1

Browse files
Merge pull request #2 from mathspp/codex/create-basic-stylesheet-and-tool-template
Add shared stylesheet and template for tools
2 parents ac94cfc + 2cef1bc commit 78736c1

5 files changed

Lines changed: 551 additions & 139 deletions

File tree

TOOLS_GUIDE.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22

33
## Repository Overview
44

5-
**Location**: `/home/user/tools/`
6-
**Type**: Static HTML/JavaScript web tools (200+ tools)
7-
**Hosting**: GitHub Pages (tools.simonwillison.net)
8-
**Build**: Python scripts generate docs and indices
9-
**Testing**: Playwright + pytest for automated testing
5+
**Location**: `/home/user/tools/`
6+
**Type**: Static HTML/JavaScript web tools (200+ tools)
7+
**Hosting**: GitHub Pages (tools.simonwillison.net)
8+
**Build**: Python scripts generate docs and indices
9+
**Testing**: Playwright + pytest for automated testing
10+
11+
### Shared styling
12+
13+
- `styles.css` contains the shared colour palette, typography, and form/table defaults used by every standalone tool.
14+
- `tool.html.template` provides a ready-to-copy HTML scaffold that already links `styles.css` and demonstrates the standard head/body structure for new tools.
1015

1116
---
1217

dmarc-analyser.html

Lines changed: 32 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,13 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<title>DMARC Report Analyser</title>
8+
<link rel="stylesheet" href="styles.css">
89
<style>
9-
* {
10-
box-sizing: border-box;
11-
}
12-
1310
body {
14-
font-family: "Segoe UI", Tahoma, sans-serif;
15-
margin: 0;
1611
padding: 20px;
1712
max-width: 1100px;
1813
margin-left: auto;
1914
margin-right: auto;
20-
background: #f4f5f7;
21-
color: #1f2933;
2215
}
2316

2417
h1 {
@@ -28,12 +21,12 @@
2821

2922
p.description {
3023
text-align: center;
31-
color: #52606d;
24+
color: var(--tx-2);
3225
}
3326

3427
#dropzone {
35-
border: 2px dashed #4c51bf;
36-
background: white;
28+
border: 2px dashed var(--accent-2);
29+
background: var(--bg-2);
3730
border-radius: 12px;
3831
padding: 40px 20px;
3932
text-align: center;
@@ -43,48 +36,23 @@
4336
}
4437

4538
#dropzone.dragover {
46-
background: #edf2ff;
47-
border-color: #3c366b;
39+
background: var(--ui);
40+
border-color: var(--accent);
4841
}
4942

5043
#upload-btn {
51-
background: #4c51bf;
52-
border: none;
53-
color: white;
54-
padding: 12px 24px;
55-
border-radius: 8px;
56-
font-size: 16px;
5744
margin-top: 16px;
58-
cursor: pointer;
59-
}
60-
61-
#upload-btn:hover {
62-
background: #434190;
6345
}
6446

6547
.hidden-input {
6648
display: none;
6749
}
6850

6951
.status-message {
70-
background: #fff;
71-
border-radius: 12px;
72-
padding: 16px;
7352
margin-bottom: 20px;
74-
box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
7553
display: none;
7654
}
7755

78-
.status-message.error {
79-
border-left: 4px solid #e53e3e;
80-
color: #742a2a;
81-
}
82-
83-
.status-message.success {
84-
border-left: 4px solid #38a169;
85-
color: #22543d;
86-
}
87-
8856
.summary-grid {
8957
display: grid;
9058
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
@@ -93,16 +61,16 @@
9361
}
9462

9563
.summary-card {
96-
background: white;
64+
background: var(--bg-2);
9765
border-radius: 12px;
9866
padding: 18px;
99-
box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
67+
box-shadow: var(--shadow-soft);
10068
}
10169

10270
.summary-card h3 {
10371
margin: 0 0 8px 0;
10472
font-size: 15px;
105-
color: #52606d;
73+
color: var(--tx-2);
10674
text-transform: uppercase;
10775
letter-spacing: 0.03em;
10876
}
@@ -125,17 +93,17 @@
12593
display: flex;
12694
align-items: center;
12795
gap: 6px;
128-
background: white;
96+
background: var(--bg-2);
12997
padding: 8px 12px;
13098
border-radius: 8px;
131-
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
99+
box-shadow: 0 1px 6px rgba(16, 15, 15, 0.18);
132100
}
133101

134102
.table-container {
135103
overflow-x: auto;
136104
border-radius: 12px;
137-
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
138-
background: white;
105+
box-shadow: var(--shadow-soft);
106+
background: var(--bg-2);
139107
}
140108

141109
table {
@@ -145,38 +113,38 @@
145113
}
146114

147115
thead {
148-
background: #eef2ff;
116+
background: var(--bg);
149117
}
150118

151119
th,
152120
td {
153121
padding: 12px 14px;
154122
text-align: left;
155-
border-bottom: 1px solid #e2e8f0;
123+
border-bottom: 1px solid var(--ui-2);
156124
font-size: 14px;
157125
}
158126

159127
tbody tr:nth-child(even) {
160-
background: #f8fafc;
128+
background: var(--bg);
161129
}
162130

163131
tbody tr:hover {
164-
background: #f8fafc;
132+
background: var(--ui);
165133
}
166134

167135
tr.failure {
168-
background: #fff5f5;
136+
background: rgba(175, 48, 41, 0.12);
169137
}
170138

171139
tr.failure:hover {
172-
background: #fed7d7;
140+
background: rgba(175, 48, 41, 0.18);
173141
}
174142

175143
.details-panel {
176144
margin-top: 24px;
177-
background: white;
145+
background: var(--bg-2);
178146
border-radius: 12px;
179-
box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
147+
box-shadow: var(--shadow-soft);
180148
padding: 20px;
181149
display: none;
182150
}
@@ -192,22 +160,22 @@
192160
}
193161

194162
.details-item {
195-
background: #f1f5f9;
163+
background: var(--bg);
196164
border-radius: 10px;
197165
padding: 12px;
198166
}
199167

200168
.details-item h4 {
201169
margin: 0 0 6px 0;
202170
font-size: 13px;
203-
color: #52606d;
171+
color: var(--tx-2);
204172
text-transform: uppercase;
205173
letter-spacing: 0.04em;
206174
}
207175

208176
.details-item p {
209177
margin: 0;
210-
font-family: "Roboto Mono", monospace;
178+
font-family: var(--font-mono);
211179
font-size: 14px;
212180
word-break: break-word;
213181
}
@@ -239,12 +207,12 @@ <h1>DMARC Report Analyser</h1>
239207
<p class="description">Drop a DMARC aggregate report (.xml, .gz or .zip) to see summary insights and examine failed
240208
authentication attempts.</p>
241209

242-
<div id="dropzone">
210+
<div id="dropzone" class="surface">
243211
<strong>Drop your DMARC report here</strong>
244212
<br>
245213
<button id="upload-btn" type="button">Select a file</button>
246214
<input type="file" id="file-input" class="hidden-input" accept=".xml,.zip,.gz,.gzip,.xml.gz">
247-
<p style="margin-top: 12px; color: #52606d; font-size: 14px;">
215+
<p style="margin-top: 12px; color: var(--tx-2); font-size: 14px;">
248216
Supported formats: raw XML, gzip-compressed (.gz) or ZIP archives (.zip)
249217
</p>
250218
</div>
@@ -253,23 +221,23 @@ <h1>DMARC Report Analyser</h1>
253221

254222
<section id="report-summary" style="display: none;">
255223
<div class="summary-grid">
256-
<div class="summary-card">
224+
<div class="summary-card surface">
257225
<h3>Organization</h3>
258226
<p id="summary-org"></p>
259227
</div>
260-
<div class="summary-card">
228+
<div class="summary-card surface">
261229
<h3>Domain</h3>
262230
<p id="summary-domain"></p>
263231
</div>
264-
<div class="summary-card">
232+
<div class="summary-card surface">
265233
<h3>Report Range</h3>
266234
<p id="summary-range"></p>
267235
</div>
268-
<div class="summary-card">
236+
<div class="summary-card surface">
269237
<h3>Total Messages</h3>
270238
<p id="summary-total">0</p>
271239
</div>
272-
<div class="summary-card">
240+
<div class="summary-card surface">
273241
<h3>Failures</h3>
274242
<p id="summary-failures">0</p>
275243
</div>
@@ -467,7 +435,7 @@ <h2>Record Details</h2>
467435

468436
if (!resultsBody.children.length) {
469437
const emptyRow = document.createElement('tr');
470-
emptyRow.innerHTML = `<td colspan="8" style="text-align:center; padding: 24px; color: #64748b;">No records to display with the current filters.</td>`;
438+
emptyRow.innerHTML = `<td colspan="8" style="text-align:center; padding: 24px; color: var(--tx-2);">No records to display with the current filters.</td>`;
471439
resultsBody.appendChild(emptyRow);
472440
}
473441
}

0 commit comments

Comments
 (0)