Compare commits

..

2 Commits

Author SHA1 Message Date
0a56b32b17 make loading/reconnection less intrusive
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-22 23:39:54 -05:00
5f214ab7f9 show topbar in more situations 2023-01-22 23:16:36 -05:00
11 changed files with 23 additions and 58 deletions

View File

@ -1,3 +1,8 @@
# v0.8.1
- Update dependencies
- Show topbar on form submit/page refresh
- Make loading/reconnection less intrusive
# v0.8.0 # v0.8.0
- Add search to catalog, ammo, container, tag and range index pages - Add search to catalog, ammo, container, tag and range index pages
- Tweak urls for catalog, ammo, containers, tags and shot records - Tweak urls for catalog, ammo, containers, tags and shot records

View File

@ -25,12 +25,12 @@ $fa-font-path: "@fortawesome/fontawesome-free/webfonts";
100% { scale: 1.0; opacity: 1; } 100% { scale: 1.0; opacity: 1; }
} }
.phx-connected > #disconnect, #loading { .phx-connected > #disconnect {
opacity: 0 !important; opacity: 0 !important;
pointer-events: none; pointer-events: none;
} }
.phx-loading:not(.phx-error) > #loading, .phx-error > #disconnect { .phx-error > #disconnect {
opacity: 0.95 !important; opacity: 0.95 !important;
} }

View File

@ -48,6 +48,8 @@ Alpine.start()
topbar.config({ barColors: { 0: '#29d' }, shadowColor: 'rgba(0, 0, 0, .3)' }) topbar.config({ barColors: { 0: '#29d' }, shadowColor: 'rgba(0, 0, 0, .3)' })
window.addEventListener('phx:page-loading-start', info => topbar.show()) window.addEventListener('phx:page-loading-start', info => topbar.show())
window.addEventListener('phx:page-loading-stop', info => topbar.hide()) window.addEventListener('phx:page-loading-stop', info => topbar.hide())
window.addEventListener('submit', info => topbar.show())
window.addEventListener('beforeunload', info => topbar.show())
// connect if there are any LiveViews on the page // connect if there are any LiveViews on the page
liveSocket.connect() liveSocket.connect()

View File

@ -27,28 +27,16 @@
</div> </div>
</main> </main>
<div
id="loading"
class="fixed opacity-0 top-0 left-0 w-screen h-screen bg-white z-50
flex flex-col justify-center items-center space-y-4
transition-opacity ease-in-out duration-500"
>
<h1 class="title text-2xl title-primary-500">
<%= gettext("Loading...") %>
</h1>
<i class="fas fa-3x fa-spin fa-gear"></i>
</div>
<div <div
id="disconnect" id="disconnect"
class="fixed opacity-0 top-0 left-0 w-screen h-screen bg-white z-50 class="z-50 fixed opacity-0 bottom-12 right-12 px-8 py-4 w-max h-max
flex flex-col justify-center items-center space-y-4 border border-primary-200 shadow-lg rounded-lg bg-white
transition-opacity ease-in-out duration-500" flex justify-center items-center space-x-4
transition-opacity ease-in-out duration-500 delay-[2000ms]"
> >
<h1 class="title text-2xl title-primary-500"> <i class="fas fa-fade text-md fa-satellite-dish"></i>
<h1 class="title text-md title-primary-500">
<%= gettext("Reconnecting...") %> <%= gettext("Reconnecting...") %>
</h1> </h1>
<i class="fas fa-3x fa-fade fa-satellite-dish"></i>
</div> </div>

View File

@ -4,7 +4,7 @@ defmodule Cannery.MixProject do
def project do def project do
[ [
app: :cannery, app: :cannery,
version: "0.8.0", version: "0.8.1",
elixir: "1.14.1", elixir: "1.14.1",
elixirc_paths: elixirc_paths(Mix.env()), elixirc_paths: elixirc_paths(Mix.env()),
compilers: Mix.compilers(), compilers: Mix.compilers(),

View File

@ -632,16 +632,11 @@ msgstr "Demarkiert"
msgid "Firing type" msgid "Firing type"
msgstr "Patronenhülsenform" 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 #, elixir-autogen, elixir-format
msgid "Reconnecting..." msgid "Reconnecting..."
msgstr "Neu verbinden..." 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/index.ex:32
#: lib/cannery_web/live/container_live/show.ex:113 #: lib/cannery_web/live/container_live/show.ex:113
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -615,16 +615,11 @@ msgstr ""
msgid "Firing type" msgid "Firing type"
msgstr "" msgstr ""
#: lib/cannery_web/templates/layout/live.html.heex:50 #: lib/cannery_web/templates/layout/live.html.heex:40
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Reconnecting..." msgid "Reconnecting..."
msgstr "" 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/index.ex:32
#: lib/cannery_web/live/container_live/show.ex:113 #: lib/cannery_web/live/container_live/show.ex:113
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -615,16 +615,11 @@ msgstr ""
msgid "Firing type" msgid "Firing type"
msgstr "" msgstr ""
#: lib/cannery_web/templates/layout/live.html.heex:50 #: lib/cannery_web/templates/layout/live.html.heex:40
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Reconnecting..." msgid "Reconnecting..."
msgstr "" 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/index.ex:32
#: lib/cannery_web/live/container_live/show.ex:113 #: lib/cannery_web/live/container_live/show.ex:113
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -633,16 +633,11 @@ msgstr "Retirar"
msgid "Firing type" msgid "Firing type"
msgstr "Tipo de fuego" 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 #, elixir-autogen, elixir-format
msgid "Reconnecting..." msgid "Reconnecting..."
msgstr "Reconectando..." 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/index.ex:32
#: lib/cannery_web/live/container_live/show.ex:113 #: lib/cannery_web/live/container_live/show.ex:113
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -634,16 +634,11 @@ msgstr "Désélectionner"
msgid "Firing type" msgid "Firing type"
msgstr "Type dallumage" msgstr "Type dallumage"
#: lib/cannery_web/templates/layout/live.html.heex:50 #: lib/cannery_web/templates/layout/live.html.heex:40
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Reconnecting..." msgid "Reconnecting..."
msgstr "Reconnexion en cours…" 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/index.ex:32
#: lib/cannery_web/live/container_live/show.ex:113 #: lib/cannery_web/live/container_live/show.ex:113
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -626,16 +626,11 @@ msgstr ""
msgid "Firing type" msgid "Firing type"
msgstr "" msgstr ""
#: lib/cannery_web/templates/layout/live.html.heex:50 #: lib/cannery_web/templates/layout/live.html.heex:40
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Reconnecting..." msgid "Reconnecting..."
msgstr "" 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/index.ex:32
#: lib/cannery_web/live/container_live/show.ex:113 #: lib/cannery_web/live/container_live/show.ex:113
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format