diff --git a/src/App.vue b/src/App.vue index 7929b08..91ae147 100644 --- a/src/App.vue +++ b/src/App.vue @@ -334,7 +334,9 @@ function onReceive() {

{{ shared!.name }}

- +
+ +

{{ status!.text }} @@ -402,7 +404,9 @@ function onReceive() {

- +
+ +

{{ status!.text }} diff --git a/src/core.ts b/src/core.ts index 617f839..e88082b 100644 --- a/src/core.ts +++ b/src/core.ts @@ -980,7 +980,7 @@ export async function sendViaTracker(file: File, events: Events, signal: AbortSi const waitForReceiver = () => failure ? events.status('retry', `${failure}. Waiting for the receiver to try again`) - : events.status('wait', 'Waiting for the receiver, give them the code'); + : events.status('wait', 'Waiting for the receiver'); // Without a tracker no further receiver can find the share. const stranded = () => !shared && !busy && !trackers.some((tracker) => tracker.alive()); diff --git a/src/style.css b/src/style.css index e49de53..9886584 100644 --- a/src/style.css +++ b/src/style.css @@ -381,10 +381,9 @@ label strong, overflow-wrap: anywhere; } -/* How the session is doing, below the file on its side. The bar shows it by color and movement: - a sweep while it sets something up or connects, a slow pulse while someone has to act, a slower - sweep in the secondary color while it tries again after a failure. Then the transfer's progress, - green once done, muted once stopped, the secondary color for an error. The line below says what. */ +/* How the session is doing, below the file on its side. Until the transfer starts a pill passes + through the bar, blue, or pink while it tries again after a failure. Then the transfer's progress, + green once done, muted once stopped, pink for an error. The line below says what. */ [data-phase] { --bar: var(--color-primary); @@ -434,18 +433,25 @@ label strong, text-transform: uppercase; } -progress { - width: 100%; +/* The track, the progress inside it fills it or, without a value, is the pill */ +[data-phase] > div { height: 0.5rem; - appearance: none; - border: none; border-radius: 999px; background: var(--color-input); overflow: hidden; } +progress { + display: block; + width: 100%; + height: 100%; + appearance: none; + border: none; + background: none; +} + progress::-webkit-progress-bar { - background: var(--color-input); + background: none; } progress::-webkit-progress-value { @@ -456,52 +462,31 @@ progress::-moz-progress-bar { background: var(--bar); } -/* Without a value only the element's own background shows, the phase draws on it */ - -progress:indeterminate::-webkit-progress-bar { - background: transparent; +progress:indeterminate { + width: 25%; + border-radius: 999px; + background: var(--bar); + animation: pass 2584ms linear infinite; } progress:indeterminate::-moz-progress-bar { - background: transparent; + background: none; } -[data-phase='start'] progress:indeterminate, -[data-phase='retry'] progress:indeterminate { - background: - linear-gradient(90deg, transparent, var(--bar), transparent) -70% 0 / 40% 100% no-repeat var(--color-input); - animation: sweep 1.2s ease-in-out infinite; -} - -[data-phase='retry'] progress:indeterminate { - animation-duration: 2.4s; -} - -[data-phase='wait'] progress:indeterminate { - background: var(--bar); - animation: pulse 1.6s ease-in-out infinite alternate; -} - -@keyframes sweep { - to { - background-position-x: 170%; - } -} - -@keyframes pulse { +/* Its own width is a quarter of the track's: from just before it to just past it */ +@keyframes pass { from { - opacity: 0.25; + translate: -100%; } to { - opacity: 0.7; + translate: 400%; } } -/* Still apart by color, the line below tells the rest */ @media (prefers-reduced-motion: reduce) { - [data-phase] progress:indeterminate { - background: color-mix(in srgb, var(--bar) 50%, var(--color-input)); + progress:indeterminate { + translate: 150%; animation: none; } }