Let one pill pass through the bar until the transfer starts
Start, wait and retry used a gradient sweep and a pulse, which felt restless. Now a solid pill passes through the bar at an even speed for all three, pink while retrying, and the line below says the rest. The sender's waiting line is shorter, the code's label already says to give it to the receiver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f7e8999439
commit
d92c4b50cf
3 files changed
+32
-43
No files matched your search
@@ -334,7 +334,9 @@ function onReceive() {
|
|||||||
</label>
|
</label>
|
||||||
<div v-if="side === 'send' && phase" :data-phase="phase">
|
<div v-if="side === 'send' && phase" :data-phase="phase">
|
||||||
<p v-if="shared !== file" id="send-file">{{ shared!.name }}</p>
|
<p v-if="shared !== file" id="send-file">{{ shared!.name }}</p>
|
||||||
|
<div>
|
||||||
<progress id="send-progress" max="100" :value="barValue(sent)" aria-label="Sent"></progress>
|
<progress id="send-progress" max="100" :value="barValue(sent)" aria-label="Sent"></progress>
|
||||||
|
</div>
|
||||||
<p v-if="error" id="send-error" role="alert">{{ error }}</p>
|
<p v-if="error" id="send-error" role="alert">{{ error }}</p>
|
||||||
<p v-else role="status">
|
<p v-else role="status">
|
||||||
<span id="send-status">{{ status!.text }}</span>
|
<span id="send-status">{{ status!.text }}</span>
|
||||||
@@ -402,7 +404,9 @@ function onReceive() {
|
|||||||
<template v-else>The sender's file shows up here after the security check</template>
|
<template v-else>The sender's file shows up here after the security check</template>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="side === 'receive' && phase" :data-phase="phase">
|
<div v-if="side === 'receive' && phase" :data-phase="phase">
|
||||||
|
<div>
|
||||||
<progress id="receive-progress" max="100" :value="barValue(received)" aria-label="Received"></progress>
|
<progress id="receive-progress" max="100" :value="barValue(received)" aria-label="Received"></progress>
|
||||||
|
</div>
|
||||||
<p v-if="error" id="receive-error" role="alert">{{ error }}</p>
|
<p v-if="error" id="receive-error" role="alert">{{ error }}</p>
|
||||||
<p v-else role="status">
|
<p v-else role="status">
|
||||||
<span id="receive-status">{{ status!.text }}</span>
|
<span id="receive-status">{{ status!.text }}</span>
|
||||||
|
|||||||
+1
-1
@@ -980,7 +980,7 @@ export async function sendViaTracker(file: File, events: Events, signal: AbortSi
|
|||||||
const waitForReceiver = () =>
|
const waitForReceiver = () =>
|
||||||
failure
|
failure
|
||||||
? events.status('retry', `${failure}. Waiting for the receiver to try again`)
|
? 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.
|
// Without a tracker no further receiver can find the share.
|
||||||
const stranded = () => !shared && !busy && !trackers.some((tracker) => tracker.alive());
|
const stranded = () => !shared && !busy && !trackers.some((tracker) => tracker.alive());
|
||||||
|
|||||||
+27
-42
@@ -381,10 +381,9 @@ label strong,
|
|||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* How the session is doing, below the file on its side. The bar shows it by color and movement:
|
/* How the session is doing, below the file on its side. Until the transfer starts a pill passes
|
||||||
a sweep while it sets something up or connects, a slow pulse while someone has to act, a slower
|
through the bar, blue, or pink while it tries again after a failure. Then the transfer's progress,
|
||||||
sweep in the secondary color 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. */
|
||||||
green once done, muted once stopped, the secondary color for an error. The line below says what. */
|
|
||||||
|
|
||||||
[data-phase] {
|
[data-phase] {
|
||||||
--bar: var(--color-primary);
|
--bar: var(--color-primary);
|
||||||
@@ -434,18 +433,25 @@ label strong,
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
progress {
|
/* The track, the progress inside it fills it or, without a value, is the pill */
|
||||||
width: 100%;
|
[data-phase] > div {
|
||||||
height: 0.5rem;
|
height: 0.5rem;
|
||||||
appearance: none;
|
|
||||||
border: none;
|
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
background: var(--color-input);
|
background: var(--color-input);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
progress {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
appearance: none;
|
||||||
|
border: none;
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
progress::-webkit-progress-bar {
|
progress::-webkit-progress-bar {
|
||||||
background: var(--color-input);
|
background: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
progress::-webkit-progress-value {
|
progress::-webkit-progress-value {
|
||||||
@@ -456,52 +462,31 @@ progress::-moz-progress-bar {
|
|||||||
background: var(--bar);
|
background: var(--bar);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Without a value only the element's own background shows, the phase draws on it */
|
progress:indeterminate {
|
||||||
|
width: 25%;
|
||||||
progress:indeterminate::-webkit-progress-bar {
|
border-radius: 999px;
|
||||||
background: transparent;
|
background: var(--bar);
|
||||||
|
animation: pass 2584ms linear infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
progress:indeterminate::-moz-progress-bar {
|
progress:indeterminate::-moz-progress-bar {
|
||||||
background: transparent;
|
background: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-phase='start'] progress:indeterminate,
|
/* Its own width is a quarter of the track's: from just before it to just past it */
|
||||||
[data-phase='retry'] progress:indeterminate {
|
@keyframes pass {
|
||||||
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 {
|
|
||||||
from {
|
from {
|
||||||
opacity: 0.25;
|
translate: -100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
opacity: 0.7;
|
translate: 400%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Still apart by color, the line below tells the rest */
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
@media (prefers-reduced-motion: reduce) {
|
||||||
[data-phase] progress:indeterminate {
|
progress:indeterminate {
|
||||||
background: color-mix(in srgb, var(--bar) 50%, var(--color-input));
|
translate: 150%;
|
||||||
animation: none;
|
animation: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user