From 0a56b32b172be8d48afdaf246a5c201bf7bc7ef8 Mon Sep 17 00:00:00 2001 From: shibao Date: Sun, 22 Jan 2023 23:39:34 -0500 Subject: [PATCH] make loading/reconnection less intrusive --- CHANGELOG.md | 1 + assets/css/app.scss | 4 +-- .../templates/layout/live.html.heex | 26 +++++-------------- priv/gettext/de/LC_MESSAGES/default.po | 7 +---- priv/gettext/default.pot | 7 +---- priv/gettext/en/LC_MESSAGES/default.po | 7 +---- priv/gettext/es/LC_MESSAGES/default.po | 7 +---- priv/gettext/fr/LC_MESSAGES/default.po | 7 +---- priv/gettext/ga/LC_MESSAGES/default.po | 7 +---- 9 files changed, 16 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb522c87..0cb5c2e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # v0.8.1 - Update dependencies - Show topbar on form submit/page refresh +- Make loading/reconnection less intrusive # v0.8.0 - Add search to catalog, ammo, container, tag and range index pages diff --git a/assets/css/app.scss b/assets/css/app.scss index 0d33aa81..4ac466b4 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -25,12 +25,12 @@ $fa-font-path: "@fortawesome/fontawesome-free/webfonts"; 100% { scale: 1.0; opacity: 1; } } -.phx-connected > #disconnect, #loading { +.phx-connected > #disconnect { opacity: 0 !important; pointer-events: none; } -.phx-loading:not(.phx-error) > #loading, .phx-error > #disconnect { +.phx-error > #disconnect { opacity: 0.95 !important; } diff --git a/lib/cannery_web/templates/layout/live.html.heex b/lib/cannery_web/templates/layout/live.html.heex index 1f976182..c3cd0ef7 100644 --- a/lib/cannery_web/templates/layout/live.html.heex +++ b/lib/cannery_web/templates/layout/live.html.heex @@ -27,28 +27,16 @@ -
-

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

- - -
-
-

+ + +

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

- -
diff --git a/priv/gettext/de/LC_MESSAGES/default.po b/priv/gettext/de/LC_MESSAGES/default.po index 987d2efc..4c325649 100644 --- a/priv/gettext/de/LC_MESSAGES/default.po +++ b/priv/gettext/de/LC_MESSAGES/default.po @@ -632,16 +632,11 @@ msgstr "Demarkiert" msgid "Firing type" msgstr "Patronenhülsenform" -#: lib/cannery_web/templates/layout/live.html.heex:50 +#: lib/cannery_web/templates/layout/live.html.heex:40 #, elixir-autogen, elixir-format msgid "Reconnecting..." msgstr "Neu verbinden..." -#: lib/cannery_web/templates/layout/live.html.heex:37 -#, elixir-autogen, elixir-format -msgid "Loading..." -msgstr "Lädt..." - #: lib/cannery_web/live/container_live/index.ex:32 #: lib/cannery_web/live/container_live/show.ex:113 #, elixir-autogen, elixir-format diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index a7a9adce..c32ec256 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -615,16 +615,11 @@ msgstr "" msgid "Firing type" msgstr "" -#: lib/cannery_web/templates/layout/live.html.heex:50 +#: lib/cannery_web/templates/layout/live.html.heex:40 #, elixir-autogen, elixir-format msgid "Reconnecting..." msgstr "" -#: lib/cannery_web/templates/layout/live.html.heex:37 -#, elixir-autogen, elixir-format -msgid "Loading..." -msgstr "" - #: lib/cannery_web/live/container_live/index.ex:32 #: lib/cannery_web/live/container_live/show.ex:113 #, elixir-autogen, elixir-format diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index 424cc1a2..87ed351a 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -615,16 +615,11 @@ msgstr "" msgid "Firing type" msgstr "" -#: lib/cannery_web/templates/layout/live.html.heex:50 +#: lib/cannery_web/templates/layout/live.html.heex:40 #, elixir-autogen, elixir-format msgid "Reconnecting..." msgstr "" -#: lib/cannery_web/templates/layout/live.html.heex:37 -#, elixir-autogen, elixir-format -msgid "Loading..." -msgstr "" - #: lib/cannery_web/live/container_live/index.ex:32 #: lib/cannery_web/live/container_live/show.ex:113 #, elixir-autogen, elixir-format diff --git a/priv/gettext/es/LC_MESSAGES/default.po b/priv/gettext/es/LC_MESSAGES/default.po index 89e39aa1..12bf198b 100644 --- a/priv/gettext/es/LC_MESSAGES/default.po +++ b/priv/gettext/es/LC_MESSAGES/default.po @@ -633,16 +633,11 @@ msgstr "Retirar" msgid "Firing type" msgstr "Tipo de fuego" -#: lib/cannery_web/templates/layout/live.html.heex:50 +#: lib/cannery_web/templates/layout/live.html.heex:40 #, elixir-autogen, elixir-format msgid "Reconnecting..." msgstr "Reconectando..." -#: lib/cannery_web/templates/layout/live.html.heex:37 -#, elixir-autogen, elixir-format -msgid "Loading..." -msgstr "Cargando..." - #: lib/cannery_web/live/container_live/index.ex:32 #: lib/cannery_web/live/container_live/show.ex:113 #, elixir-autogen, elixir-format diff --git a/priv/gettext/fr/LC_MESSAGES/default.po b/priv/gettext/fr/LC_MESSAGES/default.po index 4a54f79b..9a094f9c 100644 --- a/priv/gettext/fr/LC_MESSAGES/default.po +++ b/priv/gettext/fr/LC_MESSAGES/default.po @@ -634,16 +634,11 @@ msgstr "Désélectionner" msgid "Firing type" msgstr "Type d’allumage" -#: lib/cannery_web/templates/layout/live.html.heex:50 +#: lib/cannery_web/templates/layout/live.html.heex:40 #, elixir-autogen, elixir-format msgid "Reconnecting..." msgstr "Reconnexion en cours…" -#: lib/cannery_web/templates/layout/live.html.heex:37 -#, elixir-autogen, elixir-format -msgid "Loading..." -msgstr "Chargement en cours…" - #: lib/cannery_web/live/container_live/index.ex:32 #: lib/cannery_web/live/container_live/show.ex:113 #, elixir-autogen, elixir-format diff --git a/priv/gettext/ga/LC_MESSAGES/default.po b/priv/gettext/ga/LC_MESSAGES/default.po index c396a82d..13400aa8 100644 --- a/priv/gettext/ga/LC_MESSAGES/default.po +++ b/priv/gettext/ga/LC_MESSAGES/default.po @@ -626,16 +626,11 @@ msgstr "" msgid "Firing type" msgstr "" -#: lib/cannery_web/templates/layout/live.html.heex:50 +#: lib/cannery_web/templates/layout/live.html.heex:40 #, elixir-autogen, elixir-format msgid "Reconnecting..." msgstr "" -#: lib/cannery_web/templates/layout/live.html.heex:37 -#, elixir-autogen, elixir-format -msgid "Loading..." -msgstr "" - #: lib/cannery_web/live/container_live/index.ex:32 #: lib/cannery_web/live/container_live/show.ex:113 #, elixir-autogen, elixir-format