Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit ff36526

Browse files
authored
Merge pull request #32 from Laaouatni/line-animation-on-generate-Gcss
fix #31 added line animation on generate
2 parents ed178f7 + f4efe41 commit ff36526

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

gcode/src/API/GcodeApi/Gsimulator/Gcss/CssLine/CssLine.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ export default class CssLine {
5858
top: `${this.smallestPos.y}px`,
5959
rotate: `${this.lineAngle}deg`,
6060
backgroundColor: "var(--sky-200)",
61-
zIndex: `${GcodeAPI.array.length - this.index}`
61+
zIndex: `${GcodeAPI.array.length - this.index}`,
62+
key: `${this.index}`,
63+
animSpeed: "100ms",
6264
};
6365

6466
this.stylesKeysArray = Object.keys(this.lineStylesObj);

gcode/src/CSS/Gline/Gline_main/Gline_main.css

+20-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
}
55

66
.Gline {
7+
/*here was var(--line-width)*/
78
width: var(--line-width);
89
height: var(--line-height);
910
}
@@ -14,4 +15,22 @@
1415
left: var(--line-left);
1516
transform: rotate(var(--line-rotate));
1617
z-index: var(--line-zIndex);
17-
}
18+
}
19+
20+
.Gline {
21+
width: 0;
22+
opacity: 0;
23+
animation: gline var(--line-animSpeed) ease-in-out forwards;
24+
animation-delay: calc(var(--line-animSpeed) * var(--line-key));
25+
}
26+
27+
@keyframes gline {
28+
0% {
29+
opacity: 0;
30+
width: 0;
31+
}
32+
100% {
33+
width: var(--line-width);
34+
opacity: 1;
35+
}
36+
}

0 commit comments

Comments
 (0)