-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
321 lines (297 loc) · 18 KB
/
index.html
File metadata and controls
321 lines (297 loc) · 18 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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Content-First Text-Based Wireframe</title>
<meta name="description" content="A text-based wireframing tool that prioritizes semantic structure and accessibility. Build inclusive UI designs where screen reader users and non-designers can participate.">
<!-- Open Graph / Social Media -->
<meta property="og:type" content="website">
<meta property="og:title" content="Content-First Text-Based Wireframe">
<meta property="og:description" content="Design accessible wireframes in text. Shift-left accessibility with semantic structure first, perfect for LLM-assisted testing.">
<meta property="og:url" content="https://github.com/mgifford/content-first-wireframe">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Content-First Text-Based Wireframe">
<meta name="twitter:description" content="Design accessible wireframes in text. Shift-left accessibility with semantic structure first.">
<!-- Mastodon / Fediverse -->
<meta name="fediverse:creator" content="@mgifford">
<!-- Link Rel Canonical -->
<link rel="canonical" href="https://github.com/mgifford/content-first-wireframe">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<a href="#main-content" class="skip-link">Skip to main content</a>
<div class="container">
<!-- Offline Indicator -->
<div id="offline-banner" class="offline-banner">
<span class="offline-icon">⚠️</span>
<span>Offline Mode - Your work is saved locally. Patterns may not load.</span>
</div>
<!-- Header -->
<header>
<h1>Content-First Text-Based Wireframe</h1>
<div class="header-actions">
<div class="document-selector">
<select id="document-select" aria-label="Select document or example">
<option value="current">Current Document</option>
</select>
</div>
<button id="help-btn" class="help-icon" type="button" title="Why text-first design?" aria-label="Learn about text-first design">
?
</button>
<button id="save-btn" type="button" title="Save wireframe to .txt file">
Save to .txt
</button>
<div class="file-input-wrapper">
<button id="load-btn-trigger" type="button" title="Load wireframe from .txt file">Load from .txt</button>
<input type="file" id="load-btn" accept=".txt" aria-label="Load wireframe from .txt file">
</div>
<button id="clear-btn" type="button" title="Clear the editor">
Clear
</button>
<button id="copy-llm-btn" type="button" title="Copy wireframe with system context for LLM">
Export to LLM
</button>
<button id="export-penpot-btn" type="button" title="Copy wireframe with Penpot instructions for LLM">
Export to Penpot
</button>
<button id="share-btn" type="button" title="Share on social media">
Share
</button>
<button id="theme-toggle" class="theme-toggle" type="button" title="Toggle dark/light mode" aria-label="Toggle dark/light mode">
<span id="theme-icon">🌙</span>
</button>
</div>
</header>
<!-- Main Layout -->
<div class="main-layout">
<!-- Left Sidebar: Pattern Library (populated from patterns.json) -->
<aside class="sidebar-left" aria-label="Pattern Library">
<!-- Patterns will be loaded here dynamically -->
<p class="loading-hint">Loading patterns...</p>
<!-- AI Writing Tools -->
<section class="pattern-group ai-tools-section" id="ai-tools-section" aria-labelledby="ai-tools-heading">
<h2 id="ai-tools-heading">AI Writing Tools</h2>
<!-- Opt-in banner: shown once when Chrome AI is available and no preference is stored -->
<div class="ai-optin-banner" id="ai-optin-banner" hidden role="group" aria-labelledby="ai-optin-heading">
<p id="ai-optin-heading" class="ai-optin-msg">
Your browser supports on-device AI writing assistance.
Would you like to try it?
All processing stays on your device.
</p>
<div class="ai-optin-actions">
<button type="button" id="ai-optin-accept-btn" class="ai-optin-accept-btn">
Turn on AI tools
</button>
<button type="button" id="ai-optin-decline-btn" class="ai-optin-decline-btn">
No thanks
</button>
</div>
</div>
<p class="ai-tools-description" id="ai-tools-description" hidden>
Editorial tools for grammar, plain language, and content quality.
All AI processing happens locally in your browser.
</p>
<p class="ai-tools-unavailable" id="ai-tools-unavailable" hidden>
Local AI assistance requires Chrome with built-in AI support.
<a href="https://developer.chrome.com/docs/ai/built-in" target="_blank" rel="noopener noreferrer">Learn more</a>
</p>
<div class="pattern-buttons" id="ai-tools-buttons" hidden>
<button type="button" id="ai-grammar-btn" class="pattern-btn ai-tool-btn" aria-busy="false">
Fix spelling & grammar
</button>
<button type="button" id="ai-plain-language-btn" class="pattern-btn ai-tool-btn" aria-busy="false">
Rewrite in plain language
</button>
<div class="ai-level-group">
<label for="ai-plain-language-level">Plain language level:</label>
<select id="ai-plain-language-level">
<option value="general">General public</option>
<option value="grade6">Grade 6</option>
<option value="grade8">Grade 8</option>
<option value="public-service">Public service standard</option>
</select>
</div>
<button type="button" id="ai-headings-btn" class="pattern-btn ai-tool-btn" aria-busy="false">
Review headings
</button>
<button type="button" id="ai-placeholders-btn" class="pattern-btn ai-tool-btn" aria-busy="false">
Replace filler with placeholders
</button>
<button type="button" id="ai-linting-btn" class="pattern-btn ai-tool-btn" aria-busy="false">
Review language quality
</button>
<button type="button" id="ai-disable-btn" class="ai-disable-btn">
Turn off AI tools
</button>
</div>
</section>
</aside>
<!-- Center: Editor -->
<main id="main-content" class="editor-container" tabindex="-1">
<div class="editor-toolbar">
<span class="editor-info">Text-based wireframe editor</span>
<span class="editor-info" id="char-count">0 characters</span>
</div>
<div class="editor-body">
<pre id="highlight-layer" aria-hidden="true"></pre>
<textarea
id="wireframe-editor"
aria-label="Wireframe editor - Write your text-based wireframe here"
placeholder="Start writing your text-based wireframe here...
Click buttons on the left to insert patterns, or type directly.
Your work is automatically saved."
spellcheck="false"
></textarea>
<div id="line-numbers" aria-hidden="true"></div>
</div>
</main>
</div>
</div>
<!-- Toast Notification -->
<div id="toast" class="toast" role="status" aria-live="polite"></div>
<!-- Share Modal -->
<div id="share-modal" class="modal-overlay" role="dialog" aria-labelledby="share-modal-title" aria-modal="true">
<div class="modal">
<div class="modal-header">
<h2 id="share-modal-title">Share this tool</h2>
<button class="modal-close" id="share-close-btn" type="button" aria-label="Close share modal">×</button>
</div>
<div class="modal-body">
<p>Promote the Content-First Text-Based Wireframe on your professional network. Customize the message below or share as-is on LinkedIn, Mastodon, or Bluesky.</p>
<label for="share-message">Your share message:</label>
<textarea id="share-message" rows="3" aria-label="Your share message"></textarea>
<label for="mastodon-instance">Mastodon instance (without https://):</label>
<input type="text" id="mastodon-instance" placeholder="mastodon.social" aria-label="Mastodon instance">
<div class="share-buttons">
<button id="share-linkedin" type="button" class="share-network-btn linkedin-btn">Share on LinkedIn</button>
<button id="share-mastodon" type="button" class="share-network-btn mastodon-btn">Share on Mastodon</button>
<button id="share-bluesky" type="button" class="share-network-btn bluesky-btn">Share on Bluesky</button>
<button id="share-copy" type="button" class="share-network-btn copy-btn">Copy message</button>
</div>
</div>
</div>
</div>
<!-- Help Modal -->
<div id="help-modal" class="modal-overlay" role="dialog" aria-labelledby="modal-title" aria-modal="true">
<div class="modal">
<div class="modal-header">
<h2 id="modal-title">Why Text-First Design?</h2>
<button class="modal-close" id="modal-close-btn" type="button" aria-label="Close modal">×</button>
</div>
<div class="modal-body">
<h3>The Problem with Visual-First Wireframing</h3>
<p>Traditional tools like <strong>Figma</strong> and <strong>Penpot</strong> prioritize visual layout before content and structure. This approach:</p>
<ul>
<li><strong>Excludes screen reader users</strong> from the design process entirely</li>
<li>Makes accessibility an afterthought instead of a foundation</li>
<li>Creates barriers for non-designers to participate in early design decisions</li>
<li>Focuses on pixels before meaning</li>
</ul>
<h3>The Text-First Advantage</h3>
<p>This tool inverts that paradigm:</p>
<ul>
<li><strong>Shift-Left Accessibility:</strong> Screen reader users can participate in wireframing and co-design</li>
<li><strong>Semantic Structure First:</strong> Define what things ARE before how they LOOK</li>
<li><strong>Inclusive Collaboration:</strong> Anyone comfortable with text documents can contribute</li>
<li><strong>Content-First Thinking:</strong> Forces clarity about information architecture and user flows</li>
<li><strong>LLM-Friendly:</strong> Structured text is perfect for AI-assisted design validation and testing</li>
</ul>
<h3>Comparison</h3>
<table class="comparison-table">
<thead>
<tr>
<th scope="col">Aspect</th>
<th scope="col">Visual-First (Figma/Penpot)</th>
<th scope="col">Text-First (This Tool)</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>First Question</strong></td>
<td>"Where should this go?"</td>
<td>"What is this?"</td>
</tr>
<tr>
<td><strong>Screen Reader Access</strong></td>
<td>Cannot use wireframes</td>
<td>Fully accessible wireframes</td>
</tr>
<tr>
<td><strong>Collaboration</strong></td>
<td>Requires design tool knowledge</td>
<td>Anyone can read/edit text</td>
</tr>
<tr>
<td><strong>Semantic Structure</strong></td>
<td>Added later (if at all)</td>
<td>Required from the start</td>
</tr>
<tr>
<td><strong>LLM Testing</strong></td>
<td>Difficult to extract structure</td>
<td>Clean, parseable format</td>
</tr>
</tbody>
</table>
<h3>Using Layout Patterns for LLMs</h3>
<p>The new <strong>Layout</strong> patterns help you convey visual structure in a way LLMs can understand:</p>
<ul>
<li><code>[2 Columns]</code> - Indicates side-by-side content areas</li>
<li><code>[Sidebar]</code> - Shows primary/secondary content hierarchy</li>
<li><code>[Card/Block]</code> - Groups related content visually</li>
<li><code>---</code> - Section dividers for visual separation</li>
</ul>
<p>When you "Copy for LLM", these layout hints help AI understand not just <em>what</em> content exists, but <em>how</em> it's organized spatially—making it easier to test user flows, validate information architecture, and simulate screen reader navigation.</p>
<h3>The Workflow</h3>
<ol>
<li><strong>Design in text:</strong> Build your wireframe using semantic patterns</li>
<li><strong>Copy for LLM:</strong> Get your design with full context included</li>
<li><strong>Test with AI agents:</strong> Ask LLMs to act as screen reader users, cognitive accessibility auditors, or service designers</li>
<li><strong>Iterate quickly:</strong> Fix issues in text before they become expensive to fix in code</li>
</ol>
<p><strong>Text is the most inclusive medium.</strong> By starting with text, you ensure everyone—including people with disabilities—can participate in creating better experiences.</p>
<h3>Open Source Project</h3>
<p>This tool is <strong>open source</strong> and freely available. The source code is hosted on GitHub where anyone can view it, report issues, or contribute improvements.</p>
<p><a href="https://github.com/mgifford/content-first-wireframe" target="_blank" rel="noopener noreferrer">View the source code on GitHub →</a></p>
</div>
</div>
</div>
<!-- AI Results Panel -->
<div id="ai-results-modal" class="modal-overlay" role="dialog" aria-labelledby="ai-results-title" aria-modal="true">
<div class="modal ai-results-panel">
<div class="modal-header">
<h2 id="ai-results-title">AI Suggestion</h2>
<button class="modal-close" id="ai-results-close-btn" type="button" aria-label="Close AI results">×</button>
</div>
<div class="modal-body" id="ai-results-body">
<!-- AI results rendered here by JavaScript -->
</div>
<div class="ai-results-footer" id="ai-results-footer">
<!-- Apply/Dismiss buttons added by JavaScript -->
</div>
</div>
</div>
<!-- Experimental Notice Footer -->
<footer class="experimental-footer">
<p>⚠️ <strong>Experimental:</strong> This tool is still in early development. Most of this site was generated with AI and has not been fully validated in real-world use.</p>
<p>💬 <strong>Feedback welcome:</strong> Please <a href="https://github.com/mgifford/content-first-wireframe/issues" target="_blank" rel="noopener noreferrer">share your results in the issue queue</a>—positive and negative. Include links and references so claims can be discussed.</p>
</footer>
<script src="app.js"></script>
<!-- Chrome Built-in AI writing assistance -->
<script src="ai/capability.js"></script>
<script src="ai/prompts/grammar.js"></script>
<script src="ai/prompts/plain-language.js"></script>
<script src="ai/prompts/headings.js"></script>
<script src="ai/prompts/placeholders.js"></script>
<script src="ai/prompts/linting.js"></script>
<script src="ai/actions/grammar.js"></script>
<script src="ai/actions/plain-language.js"></script>
<script src="ai/actions/headings.js"></script>
<script src="ai/actions/placeholders.js"></script>
<script src="ai/actions/linting.js"></script>
<script src="ui/diff-view.js"></script>
<script src="ui/ai-tools.js"></script>
</body>
</html>