From 7bec3dfa373f946280c0ff98b2a197d5179b2f92 Mon Sep 17 00:00:00 2001 From: Ryan Arthur Date: Thu, 2 Aug 2018 11:43:09 -0400 Subject: [PATCH] Add intro animation to transactions on homepage - Adjust animation values for better performance --- .../assets/css/components/_animations.scss | 29 +++++++++++++++++-- .../templates/chain/_block.html.eex | 2 +- .../templates/chain/show.html.eex | 3 +- .../templates/transaction/_tile.html.eex | 2 +- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/apps/explorer_web/assets/css/components/_animations.scss b/apps/explorer_web/assets/css/components/_animations.scss index d01ac6579d..22cd004011 100644 --- a/apps/explorer_web/assets/css/components/_animations.scss +++ b/apps/explorer_web/assets/css/components/_animations.scss @@ -3,7 +3,7 @@ 100% {opacity: 1;} } -@keyframes fade-up { +@keyframes fade-up-blocks-homepage { 0% { flex-basis: 0%; width: 0%; @@ -23,13 +23,36 @@ } } +@keyframes fade-up { + 0% { + height: 0; + opacity: 0; + } + 25% { + opacity: 0; + transform: translateY(10px) scale(0.97); + } + 50% { + height: 98px; + } + 100% { + opacity: 1; + transform: translateY(0) scale(1); + } +} + .fade-in { animation: fade-in 1s ease-out forwards; } +.fade-up-blocks-homepage { + will-change: transform, opacity, width; + max-height: 98px; + animation: fade-up-blocks-homepage 0.6s cubic-bezier(0.455, 0.03, 0.515, 0.955); +} .fade-up { - will-change: transform, opacity, width; + will-change: transform, opacity, height; max-height: 98px; - animation: fade-up 0.55s cubic-bezier(0.455, 0.03, 0.515, 0.955); + animation: fade-up 0.6s cubic-bezier(0.455, 0.03, 0.515, 0.955); } diff --git a/apps/explorer_web/lib/explorer_web/templates/chain/_block.html.eex b/apps/explorer_web/lib/explorer_web/templates/chain/_block.html.eex index ee9ba26f85..88cbe9d301 100644 --- a/apps/explorer_web/lib/explorer_web/templates/chain/_block.html.eex +++ b/apps/explorer_web/lib/explorer_web/templates/chain/_block.html.eex @@ -1,4 +1,4 @@ -
+
<%= link(@block, to: block_path(ExplorerWeb.Endpoint, :show, @locale, @block), class: "tile-title") %>
diff --git a/apps/explorer_web/lib/explorer_web/templates/chain/show.html.eex b/apps/explorer_web/lib/explorer_web/templates/chain/show.html.eex index c0a2c387a2..15ee6be8ae 100644 --- a/apps/explorer_web/lib/explorer_web/templates/chain/show.html.eex +++ b/apps/explorer_web/lib/explorer_web/templates/chain/show.html.eex @@ -63,7 +63,8 @@
-
+ +
diff --git a/apps/explorer_web/lib/explorer_web/templates/transaction/_tile.html.eex b/apps/explorer_web/lib/explorer_web/templates/transaction/_tile.html.eex index a6f1b7d4d7..c2b5dd41aa 100644 --- a/apps/explorer_web/lib/explorer_web/templates/transaction/_tile.html.eex +++ b/apps/explorer_web/lib/explorer_web/templates/transaction/_tile.html.eex @@ -1,4 +1,4 @@ -
+
<%= ExplorerWeb.TransactionView.transaction_display_type(@transaction) %>