7#ifndef KICAD_TEMPLATE_DEFAULT_HTML_H
8#define KICAD_TEMPLATE_DEFAULT_HTML_H
18inline wxString GetCommonStyles()
22 color-scheme: light dark;
24 --bg-primary: light-dark(#FFFFFF, #1E1E1E);
25 --bg-secondary: light-dark(#F3F3F3, #2D2D2D);
26 --bg-elevated: light-dark(#FFFFFF, #333333);
27 --text-primary: light-dark(#1F2328, #DED3DD);
28 --text-secondary: light-dark(#545454, #848484);
29 --accent: light-dark(#1A81C4, #42B8EB);
30 --accent-subtle: light-dark(rgba(26, 129, 196, 0.08), rgba(66, 184, 235, 0.1));
31 --border: light-dark(#E0E0E0, #404040);
32 --shadow: light-dark(0 1px 3px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.2));
36 background-color: var(--bg-primary);
37 color: var(--text-primary);
38 font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
42 color: light-dark(#0D4A8B, #A7D7FC);
46 color: light-dark(#0A2540, #EBF5FE);
50 color: light-dark(#7C3EAE, #E9DDFC);
62inline wxString GetTemplateIcon()
65 "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" "
66 "stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">"
67 "<path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"/>"
68 "<polyline points=\"14 2 14 8 20 8\"/>"
69 "<line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\"/>"
70 "<line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\"/>"
71 "<polyline points=\"10 9 9 9 8 9\"/>"
77inline wxString GetSettingsIcon()
80 "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" "
81 "stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">"
82 "<circle cx=\"12\" cy=\"12\" r=\"3\"/>"
83 "<path d=\"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06"
84 "a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09"
85 "A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83"
86 "l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09"
87 "A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0"
88 "l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09"
89 "a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83"
90 "l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09"
91 "a1.65 1.65 0 0 0-1.51 1z\"/>"
97inline wxString GetLayersIcon()
100 "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" "
101 "stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">"
102 "<polygon points=\"12 2 2 7 12 12 22 7 12 2\"/>"
103 "<polyline points=\"2 17 12 22 22 17\"/>"
104 "<polyline points=\"2 12 12 17 22 12\"/>"
110inline wxString GetFolderIcon()
113 "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" "
114 "stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">"
115 "<path d=\"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z\"/>"
121inline wxString GetInfoIcon()
124 "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" "
125 "stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">"
126 "<circle cx=\"12\" cy=\"12\" r=\"10\"/>"
127 "<line x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\"/>"
128 "<line x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\"/>"
139 wxString bodyClass = aDarkMode ? wxS(
"kicad-dark" ) : wxS(
"" );
145 "<meta charset=\"UTF-8\">"
146 "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">"
147 "<title>KiCad Project Template Selector</title>"
149 + GetCommonStyles() +
154 "background: var(--bg-elevated);"
155 "border-radius: 8px;"
157 "box-shadow: var(--shadow);"
158 "border: 1px solid var(--border);"
161 "text-align: center;"
162 "margin-bottom: 28px;"
167 "color: var(--text-primary);"
171 "font-size: 0.95rem;"
172 "color: var(--text-secondary);"
177 "flex-direction: column;"
179 "margin-bottom: 28px;"
183 "align-items: flex-start;"
186 "background: var(--bg-secondary);"
187 "border-radius: 6px;"
194 "align-items: center;"
195 "justify-content: center;"
196 "background: var(--accent-subtle);"
197 "border-radius: 8px;"
198 "color: var(--accent);"
200 ".feature-content h3 {"
202 "font-size: 0.95rem;"
204 "color: var(--text-primary);"
206 ".feature-content p {"
208 "font-size: 0.875rem;"
209 "color: var(--text-secondary);"
213 "align-items: flex-start;"
215 "padding: 12px 14px;"
216 "background: var(--accent-subtle);"
217 "border-radius: 6px;"
218 "border-left: 3px solid var(--accent);"
222 "color: var(--accent);"
225 "font-size: 0.875rem;"
226 "color: var(--text-secondary);"
231 "<body class=\"" ) + bodyClass + wxString(
"\">"
232 "<div class=\"card\">"
233 "<div class=\"header\">"
234 "<h1 class=\"title\">" ) +
_(
"Select a Template" ) + wxString(
"</h1>"
235 "<p class=\"subtitle\">" )
236 +
_(
"Templates provide pre-configured project structures to jumpstart your design." )
239 "<div class=\"features\">"
240 "<div class=\"feature\">"
241 "<div class=\"feature-icon\">" ) + GetTemplateIcon() + wxString(
"</div>"
242 "<div class=\"feature-content\">"
243 "<h3>" ) +
_(
"Pre-configured Libraries" ) + wxString(
"</h3>"
244 "<p>" ) +
_(
"Common symbols and footprints already linked and ready to use." ) + wxString(
"</p>"
247 "<div class=\"feature\">"
248 "<div class=\"feature-icon\">" ) + GetSettingsIcon() + wxString(
"</div>"
249 "<div class=\"feature-content\">"
250 "<h3>" ) +
_(
"Design Rules" ) + wxString(
"</h3>"
251 "<p>" ) +
_(
"Electrical and mechanical constraints configured for the intended application." ) + wxString(
"</p>"
254 "<div class=\"feature\">"
255 "<div class=\"feature-icon\">" ) + GetLayersIcon() + wxString(
"</div>"
256 "<div class=\"feature-content\">"
257 "<h3>" ) +
_(
"Board Stackups" ) + wxString(
"</h3>"
258 "<p>" ) +
_(
"Layer configurations optimized for common manufacturing processes." ) + wxString(
"</p>"
262 "<div class=\"tip\">"
263 "<div class=\"tip-icon\">" ) + GetInfoIcon() + wxString(
"</div>"
264 "<p class=\"tip-text\">" )
265 +
_(
"Recently used templates appear at the top. Use the folder icon to browse custom template directories." )
278 wxString bodyClass = aDarkMode ? wxS(
"kicad-dark" ) : wxS(
"" );
284 "<meta charset=\"UTF-8\">"
285 "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">"
286 "<title>" ) + aTemplateName + wxString(
" - KiCad Template</title>"
288 + GetCommonStyles() +
293 "background: var(--bg-elevated);"
294 "border-radius: 8px;"
296 "box-shadow: var(--shadow);"
297 "border: 1px solid var(--border);"
301 "align-items: center;"
303 "margin-bottom: 20px;"
306 "background: var(--accent);"
309 "border-radius: 4px;"
310 "font-size: 0.75rem;"
312 "letter-spacing: 0.03em;"
313 "text-transform: uppercase;"
316 "font-size: 1.25rem;"
318 "color: var(--text-primary);"
322 "color: var(--text-secondary);"
323 "margin-bottom: 24px;"
326 "background: var(--bg-secondary);"
327 "border-radius: 6px;"
329 "margin-bottom: 20px;"
332 "font-size: 0.875rem;"
334 "color: var(--text-primary);"
335 "margin: 0 0 16px 0;"
340 "margin-bottom: 14px;"
350 "align-items: center;"
351 "justify-content: center;"
352 "background: var(--accent);"
354 "border-radius: 50%;"
355 "font-size: 0.75rem;"
360 "font-size: 0.875rem;"
362 "color: var(--text-primary);"
366 "font-size: 0.8125rem;"
367 "color: var(--text-secondary);"
371 "align-items: flex-start;"
373 "padding: 12px 14px;"
374 "background: var(--accent-subtle);"
375 "border-radius: 6px;"
376 "border-left: 3px solid var(--accent);"
380 "color: var(--accent);"
383 "font-size: 0.8125rem;"
384 "color: var(--text-secondary);"
388 "background: var(--bg-secondary);"
390 "border-radius: 3px;"
391 "font-size: 0.8125rem;"
392 "font-family: 'SF Mono', Monaco, Consolas, monospace;"
396 "<body class=\"" ) + bodyClass + wxString(
"\">"
397 "<div class=\"card\">"
398 "<div class=\"header\">"
399 "<span class=\"badge\">" ) +
_(
"Template" ) + wxString(
"</span>"
400 "<h1 class=\"template-name\">" ) + aTemplateName + wxString(
"</h1>"
402 "<p class=\"description\">" )
403 +
_(
"This template does not include a description. You can still use it to create a new project." )
405 "<div class=\"steps\">"
406 "<h3 class=\"steps-title\">" ) +
_(
"To use this template" ) + wxString(
"</h3>"
407 "<div class=\"step\">"
408 "<span class=\"step-number\">1</span>"
409 "<div class=\"step-content\">"
410 "<h4>" ) +
_(
"Create the project" ) + wxString(
"</h4>"
411 "<p>" ) +
_(
"Click OK to create a new project folder with this template's contents." ) + wxString(
"</p>"
414 "<div class=\"step\">"
415 "<span class=\"step-number\">2</span>"
416 "<div class=\"step-content\">"
417 "<h4>" ) +
_(
"Open schematic and PCB" ) + wxString(
"</h4>"
418 "<p>" ) +
_(
"Use the Project Manager to launch the Schematic and PCB editors." ) + wxString(
"</p>"
421 "<div class=\"step\">"
422 "<span class=\"step-number\">3</span>"
423 "<div class=\"step-content\">"
424 "<h4>" ) +
_(
"Review settings" ) + wxString(
"</h4>"
425 "<p>" ) +
_(
"Verify libraries, design rules, and board stackup match your needs." ) + wxString(
"</p>"
429 "<div class=\"hint\">"
430 "<div class=\"hint-icon\">" ) + GetInfoIcon() + wxString(
"</div>"
431 "<p class=\"hint-text\">" )
432 +
_(
"Add a description by creating" ) + wxString(
" <code>meta/info.html</code> " )
433 +
_(
"inside this template's directory." )
446 wxString bodyClass = aDarkMode ? wxS(
"kicad-dark" ) : wxS(
"" );
452 "<meta charset=\"UTF-8\">"
453 "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">"
454 "<title>No Templates - KiCad</title>"
456 + GetCommonStyles() +
461 "background: var(--bg-elevated);"
462 "border-radius: 8px;"
464 "box-shadow: var(--shadow);"
465 "border: 1px solid var(--border);"
466 "text-align: center;"
471 "margin: 0 auto 20px auto;"
473 "align-items: center;"
474 "justify-content: center;"
475 "background: var(--bg-secondary);"
476 "border-radius: 50%;"
477 "color: var(--text-secondary);"
484 "font-size: 1.25rem;"
486 "color: var(--text-primary);"
490 "color: var(--text-secondary);"
491 "margin: 0 0 24px 0;"
495 "background: var(--bg-secondary);"
496 "border-radius: 6px;"
497 "padding: 16px 20px;"
498 "margin-bottom: 20px;"
500 ".suggestions-title {"
501 "font-size: 0.875rem;"
503 "color: var(--text-primary);"
504 "margin: 0 0 12px 0;"
508 "padding-left: 20px;"
509 "color: var(--text-secondary);"
510 "font-size: 0.875rem;"
513 "margin-bottom: 8px;"
515 ".suggestions li:last-child {"
520 "align-items: flex-start;"
522 "padding: 12px 14px;"
523 "background: var(--accent-subtle);"
524 "border-radius: 6px;"
529 "color: var(--accent);"
532 "font-size: 0.8125rem;"
533 "color: var(--text-secondary);"
538 "<body class=\"" ) + bodyClass + wxString(
"\">"
539 "<div class=\"card\">"
540 "<div class=\"icon\">" ) + GetFolderIcon() + wxString(
"</div>"
541 "<h1 class=\"title\">" ) +
_(
"No Templates Found" ) + wxString(
"</h1>"
542 "<p class=\"message\">" )
543 +
_(
"The selected directory does not contain any project templates." )
545 "<div class=\"suggestions\">"
546 "<h3 class=\"suggestions-title\">" ) +
_(
"Suggestions" ) + wxString(
"</h3>"
548 "<li>" ) +
_(
"Browse to a different directory using the folder icon" ) + wxString(
"</li>"
549 "<li>" ) +
_(
"Use the refresh icon to reload the current directory" ) + wxString(
"</li>"
550 "<li>" ) +
_(
"Switch to a system templates tab" ) + wxString(
"</li>"
553 "<div class=\"tip\">"
554 "<div class=\"tip-icon\">" ) + GetInfoIcon() + wxString(
"</div>"
555 "<p class=\"tip-text\">" )
556 +
_(
"Each template needs a 'meta' folder containing configuration files." )
wxString GetWelcomeHtml(bool aDarkMode)
wxString GetTemplateInfoHtml(const wxString &aTemplateName, bool aDarkMode)
wxString GetNoTemplatesHtml(bool aDarkMode)