From 736cd3ab57270855f8419af47ddbc82906bac654 Mon Sep 17 00:00:00 2001 From: shibao Date: Fri, 18 Feb 2022 17:43:08 -0500 Subject: [PATCH] add liveview loading and reconnection screen --- assets/css/app.scss | 18 +++++++++++++ .../templates/layout/live.html.heex | 26 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/assets/css/app.scss b/assets/css/app.scss index 602ce989..0d33aa81 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -16,6 +16,24 @@ $fa-font-path: "@fortawesome/fontawesome-free/webfonts"; scrollbar-color: rgba(161, 161, 170, var(--tw-bg-opacity)) white; } +.fa-fade { + animation: pulse 1s ease-in-out 0s infinite alternate; +} + +@keyframes pulse { + 0% { scale: 0.95; opacity: 0.5; } + 100% { scale: 1.0; opacity: 1; } +} + +.phx-connected > #disconnect, #loading { + opacity: 0 !important; + pointer-events: none; +} + +.phx-loading:not(.phx-error) > #loading, .phx-error > #disconnect { + opacity: 0.95 !important; +} + /* Alerts and form errors used by phx.new */ .alert { padding: 15px; diff --git a/lib/cannery_web/templates/layout/live.html.heex b/lib/cannery_web/templates/layout/live.html.heex index 55f20ebb..68c6dfef 100644 --- a/lib/cannery_web/templates/layout/live.html.heex +++ b/lib/cannery_web/templates/layout/live.html.heex @@ -26,3 +26,29 @@ <%= @inner_content %> + +
+

+ <%= gettext("Loading...") %> +

+ + +
+ +
+

+ <%= gettext("Reconnecting...") %> +

+ + +