about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/styles/components/status.scss
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-10-24 22:47:48 +0200
committerThibaut Girka <thib@sitedethib.com>2019-10-27 21:10:24 +0100
commit2ed48037ea36a5a825a60c0748266506582f7400 (patch)
treeacdae720ecec6f8a326c4c14527c66f5e03bc68e /app/javascript/flavours/glitch/styles/components/status.scss
parentbde35e7878c81a3f87b8f6876592c7d054bd2e5d (diff)
[Glitch] Replace fav icon animation with CSS
Port 3a929dbedd31ea67723746bdf387e22e66e247cd to glitch-soc

And extend that to collapse button

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/styles/components/status.scss')
-rw-r--r--app/javascript/flavours/glitch/styles/components/status.scss62
1 files changed, 62 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/styles/components/status.scss b/app/javascript/flavours/glitch/styles/components/status.scss
index a4d9983f2..77d67576b 100644
--- a/app/javascript/flavours/glitch/styles/components/status.scss
+++ b/app/javascript/flavours/glitch/styles/components/status.scss
@@ -1,3 +1,47 @@
+@keyframes spring-flip-in {
+  0% {
+    transform: rotate(0deg);
+  }
+
+  30% {
+    transform: rotate(-242.4deg);
+  }
+
+  60% {
+    transform: rotate(-158.35deg);
+  }
+
+  90% {
+    transform: rotate(-187.5deg);
+  }
+
+  100% {
+    transform: rotate(-180deg);
+  }
+}
+
+@keyframes spring-flip-out {
+  0% {
+    transform: rotate(-180deg);
+  }
+
+  30% {
+    transform: rotate(62.4deg);
+  }
+
+  60% {
+    transform: rotate(-21.635deg);
+  }
+
+  90% {
+    transform: rotate(7.5deg);
+  }
+
+  100% {
+    transform: rotate(0deg);
+  }
+}
+
 .status__content--with-action {
   cursor: pointer;
 }
@@ -430,6 +474,24 @@
     padding-left: 2px;
     padding-right: 2px;
   }
+
+  .status__collapse-button.active > .fa-angle-double-up {
+    transform: rotate(-180deg);
+  }
+}
+
+.no-reduce-motion .status__collapse-button {
+  &.activate {
+    & > .fa-angle-double-up {
+      animation: spring-flip-in 1s linear;
+    }
+  }
+
+  &.deactivate {
+    & > .fa-angle-double-up {
+      animation: spring-flip-out 1s linear;
+    }
+  }
 }
 
 .status__info__account {