|
1 | 1 | // SVG icons for list numbering types |
2 | 2 | // Each icon shows a list with 2 items at 200% zoom |
3 | 3 |
|
4 | | -export const numberingIcons = { |
5 | | - decimalPlain: ` |
6 | | - <svg width="200" height="150" viewBox="0 0 200 150" xmlns="http://www.w3.org/2000/svg"> |
7 | | - <style> |
8 | | - .list-text { font: bold 40px sans-serif; fill: #222; } |
9 | | - .list-line { stroke: #222; stroke-width: 3; stroke-linecap: round; } |
10 | | - </style> |
11 | | - <text x="15" y="50" class="list-text">1</text> |
12 | | - <line x1="75" y1="40" x2="185" y2="40" class="list-line" /> |
13 | | - <line x1="75" y1="80" x2="185" y2="80" class="list-line" /> |
14 | | - <text x="15" y="120" class="list-text">2</text> |
15 | | - <line x1="75" y1="115" x2="185" y2="115" class="list-line" /> |
16 | | - </svg> |
17 | | - `, |
18 | | - |
19 | | - decimal: ` |
20 | | - <svg width="200" height="150" viewBox="0 0 200 150" xmlns="http://www.w3.org/2000/svg"> |
21 | | - <style> |
22 | | - .list-text { font: bold 40px sans-serif; fill: #222; } |
23 | | - .list-line { stroke: #222; stroke-width: 3; stroke-linecap: round; } |
24 | | - </style> |
25 | | - <text x="15" y="50" class="list-text">1.</text> |
26 | | - <line x1="75" y1="40" x2="185" y2="40" class="list-line" /> |
27 | | - <line x1="75" y1="80" x2="185" y2="80" class="list-line" /> |
28 | | - <text x="15" y="120" class="list-text">2.</text> |
29 | | - <line x1="75" y1="115" x2="185" y2="115" class="list-line" /> |
30 | | - </svg> |
31 | | - `, |
32 | | - |
33 | | - decimalParen: ` |
34 | | - <svg width="200" height="150" viewBox="0 0 200 150" xmlns="http://www.w3.org/2000/svg"> |
35 | | - <style> |
36 | | - .list-text { font: bold 40px sans-serif; fill: #222; } |
37 | | - .list-line { stroke: #222; stroke-width: 3; stroke-linecap: round; } |
38 | | - </style> |
39 | | - <text x="15" y="50" class="list-text">1)</text> |
40 | | - <line x1="75" y1="40" x2="185" y2="40" class="list-line" /> |
41 | | - <line x1="75" y1="80" x2="185" y2="80" class="list-line" /> |
42 | | - <text x="15" y="120" class="list-text">2)</text> |
43 | | - <line x1="75" y1="115" x2="185" y2="115" class="list-line" /> |
44 | | - </svg> |
45 | | - `, |
46 | | - |
47 | | - upperLetter: ` |
| 4 | +function makeListIcon(text1, text2, text2X = 15) { |
| 5 | + return ` |
48 | 6 | <svg width="200" height="150" viewBox="0 0 200 150" xmlns="http://www.w3.org/2000/svg"> |
49 | 7 | <style> |
50 | 8 | .list-text { font: bold 40px sans-serif; fill: #222; } |
51 | 9 | .list-line { stroke: #222; stroke-width: 3; stroke-linecap: round; } |
52 | 10 | </style> |
53 | | - <text x="15" y="50" class="list-text">A.</text> |
| 11 | + <text x="15" y="50" class="list-text">${text1}</text> |
54 | 12 | <line x1="75" y1="40" x2="185" y2="40" class="list-line" /> |
55 | 13 | <line x1="75" y1="80" x2="185" y2="80" class="list-line" /> |
56 | | - <text x="15" y="120" class="list-text">B.</text> |
| 14 | + <text x="${text2X}" y="120" class="list-text">${text2}</text> |
57 | 15 | <line x1="75" y1="115" x2="185" y2="115" class="list-line" /> |
58 | 16 | </svg> |
59 | | - `, |
| 17 | + `; |
| 18 | +} |
60 | 19 |
|
61 | | - lowerLetter: ` |
62 | | - <svg width="200" height="150" viewBox="0 0 200 150" xmlns="http://www.w3.org/2000/svg"> |
63 | | - <style> |
64 | | - .list-text { font: bold 40px sans-serif; fill: #222; } |
65 | | - .list-line { stroke: #222; stroke-width: 3; stroke-linecap: round; } |
66 | | - </style> |
67 | | - <text x="15" y="50" class="list-text">a.</text> |
68 | | - <line x1="75" y1="40" x2="185" y2="40" class="list-line" /> |
69 | | - <line x1="75" y1="80" x2="185" y2="80" class="list-line" /> |
70 | | - <text x="15" y="120" class="list-text">b.</text> |
71 | | - <line x1="75" y1="115" x2="185" y2="115" class="list-line" /> |
72 | | - </svg> |
73 | | - `, |
74 | | - |
75 | | - letterParen: ` |
76 | | - <svg width="200" height="150" viewBox="0 0 200 150" xmlns="http://www.w3.org/2000/svg"> |
77 | | - <style> |
78 | | - .list-text { font: bold 40px sans-serif; fill: #222; } |
79 | | - .list-line { stroke: #222; stroke-width: 3; stroke-linecap: round; } |
80 | | - </style> |
81 | | - <text x="15" y="50" class="list-text">a)</text> |
82 | | - <line x1="75" y1="40" x2="185" y2="40" class="list-line" /> |
83 | | - <line x1="75" y1="80" x2="185" y2="80" class="list-line" /> |
84 | | - <text x="15" y="120" class="list-text">b)</text> |
85 | | - <line x1="75" y1="115" x2="185" y2="115" class="list-line" /> |
86 | | - </svg> |
87 | | - `, |
88 | | - |
89 | | - upperRoman: ` |
90 | | - <svg width="200" height="150" viewBox="0 0 200 150" xmlns="http://www.w3.org/2000/svg"> |
91 | | - <style> |
92 | | - .list-text { font: bold 40px sans-serif; fill: #222; } |
93 | | - .list-line { stroke: #222; stroke-width: 3; stroke-linecap: round; } |
94 | | - </style> |
95 | | - <text x="15" y="50" class="list-text">I.</text> |
96 | | - <line x1="75" y1="40" x2="185" y2="40" class="list-line" /> |
97 | | - <line x1="75" y1="80" x2="185" y2="80" class="list-line" /> |
98 | | - <text x="10" y="120" class="list-text">II.</text> |
99 | | - <line x1="75" y1="115" x2="185" y2="115" class="list-line" /> |
100 | | - </svg> |
101 | | - `, |
102 | | - |
103 | | - lowerRoman: ` |
104 | | - <svg width="200" height="150" viewBox="0 0 200 150" xmlns="http://www.w3.org/2000/svg"> |
105 | | - <style> |
106 | | - .list-text { font: bold 40px sans-serif; fill: #222; } |
107 | | - .list-line { stroke: #222; stroke-width: 3; stroke-linecap: round; } |
108 | | - </style> |
109 | | - <text x="15" y="50" class="list-text">i.</text> |
110 | | - <line x1="75" y1="40" x2="185" y2="40" class="list-line" /> |
111 | | - <line x1="75" y1="80" x2="185" y2="80" class="list-line" /> |
112 | | - <text x="15" y="120" class="list-text">ii.</text> |
113 | | - <line x1="75" y1="115" x2="185" y2="115" class="list-line" /> |
114 | | - </svg> |
115 | | - `, |
| 20 | +export const numberingIcons = { |
| 21 | + decimalPlain: makeListIcon('1', '2'), |
| 22 | + decimal: makeListIcon('1.', '2.'), |
| 23 | + decimalParen: makeListIcon('1)', '2)'), |
| 24 | + upperLetter: makeListIcon('A.', 'B.'), |
| 25 | + lowerLetter: makeListIcon('a.', 'b.'), |
| 26 | + letterParen: makeListIcon('a)', 'b)'), |
| 27 | + upperRoman: makeListIcon('I.', 'II.', 10), |
| 28 | + lowerRoman: makeListIcon('i.', 'ii.'), |
116 | 29 | }; |
0 commit comments