diff --git a/assets/tailwind.config.js b/assets/tailwind.config.js index 7e0fad9a..5b87048b 100644 --- a/assets/tailwind.config.js +++ b/assets/tailwind.config.js @@ -13,6 +13,9 @@ module.exports = { "ibm-plex": "'IBM Plex Sans', sans-serif", mono: "'IBM Plex Mono', monospace", }, + animation: { + 'pulseFill' : 'pulse 2s ease-in-out infinite' + }, colors: { brand: "#AE2EFF", container: "#1A1A24", diff --git a/lib/starknet_explorer_web/components/core_components.ex b/lib/starknet_explorer_web/components/core_components.ex index da4b7bf4..720e9774 100644 --- a/lib/starknet_explorer_web/components/core_components.ex +++ b/lib/starknet_explorer_web/components/core_components.ex @@ -665,20 +665,21 @@ defmodule StarknetExplorerWeb.CoreComponents do def copy_button(assigns) do ~H""" -
-
-
- - +
+
+
+ + +
-
""" end + @spec tooltip(any) :: Phoenix.LiveView.Rendered.t() def tooltip(assigns) do ~H""" """ end + + @spec loading_state(any) :: Phoenix.LiveView.Rendered.t() + def loading_state(assigns) do + ~H""" + <%= if @condition do %> + <%= @content %> + <% else %> +
+ <%= @mock %> +
+ <% end %> + + + """ + end end diff --git a/lib/starknet_explorer_web/live/pages/home/index.ex b/lib/starknet_explorer_web/live/pages/home/index.ex index d7da67bb..b489aeed 100644 --- a/lib/starknet_explorer_web/live/pages/home/index.ex +++ b/lib/starknet_explorer_web/live/pages/home/index.ex @@ -72,8 +72,14 @@ defmodule StarknetExplorerWeb.HomeLive.Index do
-
Blocks Height
-
<%= assigns.block_height %>
+
Blocks Height
+
+ +
@@ -88,7 +94,14 @@ defmodule StarknetExplorerWeb.HomeLive.Index do
Messages
-
<%= @entities_count.messages_count %>
+
+ +
@@ -103,7 +116,14 @@ defmodule StarknetExplorerWeb.HomeLive.Index do
Events
-
<%= @entities_count.events_count %>
+
+ +
@@ -118,7 +138,16 @@ defmodule StarknetExplorerWeb.HomeLive.Index do
Transactions
-
<%= @entities_count.transaction_count %>
+
+
+ +
+
@@ -150,39 +179,74 @@ defmodule StarknetExplorerWeb.HomeLive.Index do
Status
Age
- <%= for block <- Enum.take(@blocks, 15) do %> -
+ <%= for n <- 1..15 do %> +
Number
- - <%= to_string(block.number) %> + + + +
Block Hash
-
+
- - <%= Utils.shorten_block_hash(block.hash) %> + + + + - + <%= if Enum.at(@blocks,n-1) do %> + + <% end %>
Status
- - <%= block.status %> + " info-label" end}"}> +
Age
- <%= Utils.get_block_age(block) %> +
<% end %> @@ -208,44 +272,76 @@ defmodule StarknetExplorerWeb.HomeLive.Index do
Status
Age
- <%= for {transaction, idx} <- Enum.take(Enum.with_index(@transactions), 15) do %> -
+ <%= for n <- 1..15 do %> +
Transaction Hash
- <%= Utils.shorten_block_hash(transaction.hash) %> + + + - + <%= if Enum.at(@transactions,n) do%> + + <% end %>
Type
-
- - <%= transaction.type %> +
" type" end }"}> + + + <%= %>
Status
- - <%= transaction.block_status %> + " info-label" end}"}> +
Age
- <%= Utils.get_block_age_from_timestamp(transaction.block_timestamp) %> +
<% end %> +
@@ -294,7 +390,7 @@ defmodule StarknetExplorerWeb.HomeLive.Index do {:ok, block_height} = StarknetExplorer.Rpc.get_block_height(socket.assigns.network) block_height = StarknetExplorer.Utils.format_number_for_display(block_height) - assign(socket, + assign(socket, blocks: blocks, transactions: transactions, entities_count: entities_count,