summaryrefslogtreecommitdiffstats
path: root/src/styles
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-02-18 19:36:23 +0100
committerArmand Philippot <git@armandphilippot.com>2022-02-18 19:36:23 +0100
commitad00b2dc9492d20b3b8c3dcd7c5b425ee7f8d404 (patch)
tree2530905a57d08a3f2933cf24c37c3f42278d22be /src/styles
parentc0f7c1c22749b66a0ec588753e7f705f3ca4224e (diff)
refactor(animations): replace width animations with transform
Animations based on width or height can be expensive and can cause lower performances. So, instead I use transform to obtain the same effect.
Diffstat (limited to 'src/styles')
-rw-r--r--src/styles/base/_animations.scss18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/styles/base/_animations.scss b/src/styles/base/_animations.scss
index 3e8f6f2..ff12c8c 100644
--- a/src/styles/base/_animations.scss
+++ b/src/styles/base/_animations.scss
@@ -87,18 +87,21 @@
@keyframes branding-name-typing {
0%,
20% {
- width: 100%;
+ transform: scaleX(1) translateX(0);
+ transform-origin: right;
visibility: visible;
}
100% {
- width: 0;
+ transform: scaleX(1) translateX(100%);
+ transform-origin: right;
}
}
@keyframes branding-job-typing {
0% {
- width: 100%;
+ transform: scaleX(1) translateX(0);
+ transform-origin: right;
content: "";
visibility: visible;
}
@@ -112,15 +115,18 @@
}
51% {
- width: 100%;
+ transform: scaleX(1) translateX(0);
+ transform-origin: right;
}
70% {
- width: 0;
+ transform: scaleX(1) translateX(100%);
+ transform-origin: right;
}
100% {
- width: 0;
+ transform: scaleX(0) translateX(100%);
+ transform-origin: right;
}
}