Skip to content

Commit 3211c0a

Browse files
committed
Replace multiple SVG elements with single path element.
This should improve performance because there will be fewer DOM elements.
1 parent 9dff09d commit 3211c0a

File tree

1 file changed

+32
-51
lines changed

1 file changed

+32
-51
lines changed

src/components/cylc/SVGTask.vue

Lines changed: 32 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -94,54 +94,29 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
9494
9595
The "x" in the centre of the outline used to represent failure.
9696
-->
97-
<g
98-
class="cross"
99-
transform="rotate(45, 50, 50)"
100-
>
101-
<rect
102-
x="43"
103-
y="15"
104-
width="14"
105-
height="70"
106-
rx="7.5"
107-
ry="7.5"
108-
/>
109-
<rect
110-
x="15"
111-
y="43"
112-
width="70"
113-
height="14"
114-
rx="7.5"
115-
ry="7.5"
116-
/>
117-
</g>
97+
<path class="cross"
98+
d="
99+
m30,30
100+
l40 40
101+
m0,-40
102+
l-40 40
103+
"
104+
/>
105+
118106
<!-- expired
119107
120108
A clock face, at about 5pm.
121109
-->
122-
<g
123-
class="expired"
124-
>
125-
<rect
126-
x="50"
127-
y="46"
128-
width="42"
129-
height="8"
130-
rx="5"
131-
ry="5"
132-
transform="rotate(-90, 50, 50)"
133-
/>
134-
<rect
135-
x="50"
136-
y="46"
137-
width="30"
138-
height="8"
139-
rx="5"
140-
ry="5"
141-
transform="rotate(45, 50, 50)"
142-
/>
143-
</g>
110+
<path
111+
class="clockhands_big"
112+
d="
113+
m50,12
114+
l0 38
115+
l18 18
116+
"
117+
/>
144118
</g>
119+
145120
<!-- modifier
146121
147122
Represents any task state modifiers e.g. isHeld, isRunahead, isQueued.
@@ -391,11 +366,11 @@ const modifierTransform = _getModifierTransform()
391366
fill: none;
392367
stroke: none;
393368
}
394-
.cross rect {
369+
.cross path {
395370
fill: none;
396371
stroke: none;
397372
}
398-
.expired rect {
373+
.clockhands_big {
399374
fill: none;
400375
stroke: none;
401376
}
@@ -454,17 +429,21 @@ const modifierTransform = _getModifierTransform()
454429
.outline {
455430
fill: $foreground;
456431
}
457-
.cross rect {
458-
fill: $background;
432+
.cross {
433+
stroke: $background;
434+
stroke-width: 14px;
435+
stroke-linecap: round;
459436
}
460437
}
461438
462439
&.submit-failed .status {
463440
.outline {
464441
fill: $background;
465442
}
466-
.cross rect {
467-
fill: $foreground;
443+
.cross {
444+
stroke: $foreground;
445+
stroke-width: 14px;
446+
stroke-linecap: round;
468447
}
469448
}
470449
@@ -475,8 +454,10 @@ const modifierTransform = _getModifierTransform()
475454
.dot {
476455
fill: $background;
477456
}
478-
.expired rect {
479-
fill: $background;
457+
.clockhands_big {
458+
stroke: $background;
459+
stroke-width: 8px;
460+
stroke-linecap: round;
480461
}
481462
}
482463

0 commit comments

Comments
 (0)