Add shareable invitation links II
This commit is contained in:
1 parent
43ee7f119f
commit
019267cc34
4 files changed
+92
-37
No files matched your search
@@ -54,7 +54,7 @@ defineExpose({ refreshIdentity });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<details v-if="supported">
|
||||
<details v-if="supported" class="config-details">
|
||||
<summary>Remembered device</summary>
|
||||
<p class="status">Optionally remember the device on this connection, so later sessions verify it automatically. This uses a device identity stored in this browser and shared by all connections. Clearing site data loses it. Trusted app code is required: it can use this identity.</p>
|
||||
<fieldset class="device-settings" :disabled="disabled || working || !loaded">
|
||||
|
||||
@@ -467,7 +467,7 @@ onBeforeUnmount(() => { dispose(); revokeDownload(); clearTimeout(copyTimer); })
|
||||
<div v-if="outgoing" class="progress" role="progressbar" :aria-valuenow="progress" aria-valuemin="0" aria-valuemax="100" aria-label="Sending progress"><div :style="{ width: progress + '%' }"></div></div>
|
||||
</section>
|
||||
<DeviceSettings ref="devices" :paired="connection.peerKey" :remember="connection.rememberDevice" :disabled="busy || connected" @update="emit('update', $event)" />
|
||||
<details class="network-details">
|
||||
<details class="config-details">
|
||||
<summary>Network settings</summary>
|
||||
<NetworkSettings v-model="settings" :disabled="busy || connected" :managed-credentials="managedCredentials" />
|
||||
</details>
|
||||
@@ -487,15 +487,19 @@ onBeforeUnmount(() => { dispose(); revokeDownload(); clearTimeout(copyTimer); })
|
||||
<p class="status">A link is as sensitive as a code: send it privately. It may stay in browser history and only works while this page stays open, for up to 5 minutes.</p>
|
||||
<details class="code-details">
|
||||
<summary>Show code instead</summary>
|
||||
<label class="step" for="output-code">{{ sending ? 'Connection code' : 'Answer code' }}</label>
|
||||
<textarea id="output-code" :value="outputCode" readonly @focus="selectCode" />
|
||||
<button @click="copy('code')">{{ copied === 'code' ? 'Copied!' : 'Copy code' }}</button>
|
||||
<div class="code-entry">
|
||||
<label class="step" for="output-code">{{ sending ? 'Connection code' : 'Answer code' }}</label>
|
||||
<textarea id="output-code" :value="outputCode" readonly @focus="selectCode" />
|
||||
<button @click="copy('code')">{{ copied === 'code' ? 'Copied!' : 'Copy code' }}</button>
|
||||
</div>
|
||||
</details>
|
||||
</template>
|
||||
<template v-if="sending && outputCode">
|
||||
<label class="step" for="answer-input">Paste the receiver’s answer or answer link</label>
|
||||
<textarea id="answer-input" v-model="inputCode" :maxlength="MAX_INPUT_LENGTH" :disabled="step !== 'offer-ready'" />
|
||||
<button class="primary" :disabled="step !== 'offer-ready' || !inputCode.trim()" @click="useAnswer">Connect</button>
|
||||
<div class="code-entry">
|
||||
<label class="step" for="answer-input">Paste the receiver’s answer or answer link</label>
|
||||
<textarea id="answer-input" v-model="inputCode" :maxlength="MAX_INPUT_LENGTH" :disabled="step !== 'offer-ready'" />
|
||||
<button class="primary" :disabled="step !== 'offer-ready' || !inputCode.trim()" @click="useAnswer">Connect</button>
|
||||
</div>
|
||||
</template>
|
||||
<p v-if="identityStatus" class="status" role="status">{{ identityStatus }}</p>
|
||||
<div v-if="fps" class="fingerprint">
|
||||
@@ -532,8 +536,10 @@ onBeforeUnmount(() => { dispose(); revokeDownload(); clearTimeout(copyTimer); })
|
||||
</details>
|
||||
<p v-if="!connected && step === 'done'" class="status">Connection ended. Exchange fresh codes to send more files.</p>
|
||||
<p v-if="connected" class="status">Connection verified. Either person can add files. Keep both tabs open.</p>
|
||||
<button v-if="connected || busy" @click="disconnect">Disconnect</button>
|
||||
<button v-if="step !== 'idle'" @click="reset()">{{ busy ? 'Cancel connection' : 'Reset' }}</button>
|
||||
<div v-if="step !== 'idle'" class="session-actions">
|
||||
<button v-if="connected || busy" @click="disconnect">Disconnect</button>
|
||||
<button @click="reset()">{{ busy ? 'Cancel connection' : 'Reset' }}</button>
|
||||
</div>
|
||||
<p class="status">Before connecting, Send/Receive chooses who starts. Once connected, use either button to jump between sending and receiving without disconnecting. You can switch to your messenger to copy and paste codes; keep this page open until receipt is confirmed.</p>
|
||||
</div>
|
||||
</template>
|
||||
+37
-27
@@ -7,6 +7,11 @@
|
||||
--accent-soft: rgba(255, 155, 61, 0.15);
|
||||
--text: #e8eaf0;
|
||||
--muted: #a0a7b8;
|
||||
--space-sm: 0.6rem;
|
||||
--space-md: 0.9rem;
|
||||
--space-lg: 1.25rem;
|
||||
--space-xl: 1.5rem;
|
||||
--space-2xl: 2rem;
|
||||
}
|
||||
|
||||
* {
|
||||
@@ -44,10 +49,10 @@ body {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
padding: 1.25rem;
|
||||
padding: var(--space-lg);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.9rem;
|
||||
gap: var(--space-md);
|
||||
}
|
||||
|
||||
h1 {
|
||||
@@ -245,28 +250,31 @@ p.stun-hint {
|
||||
.network-settings {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.7rem;
|
||||
gap: var(--space-sm);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
min-width: 0;
|
||||
padding: var(--space-sm) var(--space-md) var(--space-md);
|
||||
}
|
||||
.network-settings legend { color: var(--muted); }
|
||||
.checkbox { display: flex; align-items: start; gap: 0.6rem; }
|
||||
.checkbox { display: flex; align-items: start; gap: var(--space-sm); }
|
||||
.fp-row { flex-direction: column; align-items: start; }
|
||||
.fp-row code { overflow-wrap: anywhere; line-height: 1.7; font-size: 0.8rem; }
|
||||
.file-chip span { overflow-wrap: anywhere; min-width: 0; }
|
||||
.incoming { display: flex; flex-direction: column; gap: 0.7rem; overflow-wrap: anywhere; }
|
||||
|
||||
.transfer-section { display: flex; flex-direction: column; gap: 0.9rem; scroll-margin-top: 1rem; min-width: 0; }
|
||||
.transfer-section { display: flex; flex-direction: column; gap: var(--space-md); scroll-margin-top: 1rem; min-width: 0; }
|
||||
.transfer-section:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 4px; }
|
||||
|
||||
.device-settings { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; border: 1px solid var(--border); border-radius: 8px; }
|
||||
.device-settings { display: flex; flex-direction: column; gap: var(--space-sm); min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: var(--space-sm) var(--space-md) var(--space-md); }
|
||||
.config-details > :not(summary) { margin-block: var(--space-sm) 0; }
|
||||
.config-details fieldset .status { margin-block: 0; line-height: 1.5; }
|
||||
.device-settings input:not([type=checkbox]) { box-sizing: border-box; max-width: 100%; padding: 0.6rem; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; }
|
||||
|
||||
/* The connection shell stays in place while each workspace scrolls. */
|
||||
.app-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); height: 100%; }
|
||||
.sidebar { display: flex; flex-direction: column; gap: 1.25rem; background: #13161e; border-right: 1px solid var(--border); padding: 1.6rem 1rem 1rem; min-height: 0; overflow-y: auto; }
|
||||
.brand { display: flex; align-items: center; gap: 0.8rem; padding: 0 0.5rem 1.25rem; }
|
||||
.sidebar { display: flex; flex-direction: column; gap: var(--space-lg); background: #13161e; border-right: 1px solid var(--border); padding: 1.6rem 1rem 1rem; min-height: 0; overflow-y: auto; }
|
||||
.brand { display: flex; align-items: center; gap: 0.8rem; padding: 0 0.5rem var(--space-lg); }
|
||||
.brand img { object-fit: contain; }
|
||||
.brand-name { display: block; font-family: ui-monospace, monospace; font-weight: 700; font-size: 1.45rem; letter-spacing: -0.05em; }
|
||||
.brand p { font-size: 0.75rem; color: var(--muted); margin: 0.25rem 0 0; }
|
||||
@@ -286,7 +294,7 @@ p.stun-hint {
|
||||
.connection-dot.connecting { background: var(--accent); }
|
||||
.add-connection { display: flex; align-items: center; justify-content: center; gap: 0.5rem; font-size: 0.82rem; background: transparent; border-style: dashed; }
|
||||
.add-connection > span { font-size: 1.1rem; }
|
||||
.sidebar-footer { margin-top: auto; padding: 1.5rem 0.65rem 0.25rem; color: var(--muted); font-size: 0.72rem; line-height: 1.65; }
|
||||
.sidebar-footer { margin-top: auto; padding: var(--space-xl) 0.65rem 0.25rem; color: var(--muted); font-size: 0.72rem; line-height: 1.65; }
|
||||
.sidebar-tag { font-weight: 600; color: var(--text); }
|
||||
.sidebar-footer p { margin: 0.5rem 0 1rem; }
|
||||
summary { cursor: pointer; color: var(--muted); font-size: 0.83rem; padding: 0.4rem 0; }
|
||||
@@ -294,7 +302,7 @@ summary:hover { color: var(--text); }
|
||||
summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
|
||||
.privacy-details summary { font-size: 0.72rem; }
|
||||
.main-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
|
||||
.connection-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 80px; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); background: #141720; }
|
||||
.connection-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 80px; padding: 1rem var(--space-xl); border-bottom: 1px solid var(--border); background: #141720; }
|
||||
.connection-title { min-width: 0; flex: 1; }
|
||||
.title-line { display: flex; align-items: center; gap: 1rem; margin-top: 0.4rem; }
|
||||
.title-line h1 { margin: 0; font-size: 1.35rem; font-weight: 600; font-family: inherit; overflow-wrap: anywhere; }
|
||||
@@ -304,14 +312,14 @@ summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
|
||||
.header-action:hover:not(:disabled) .header-action-icon, .header-action:focus-visible .header-action-icon { opacity: 1; }
|
||||
.session-badge { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.74rem; white-space: nowrap; border: 1px solid var(--border); border-radius: 20px; padding: 0.45rem 0.7rem; }
|
||||
.session-badge.connected { color: #8ddbb6; border-color: #315344; }
|
||||
.workspace-scroll { flex: 1; overflow-y: auto; padding: 2rem 2.25rem; }
|
||||
.connection-workspace { display: grid; grid-template-columns: minmax(0, 720px) minmax(240px, 320px); gap: 2rem; max-width: 1200px; margin-inline: auto; align-items: start; }
|
||||
.workspace-scroll { flex: 1; overflow-y: auto; padding: var(--space-2xl) 2.25rem; }
|
||||
.connection-workspace { display: grid; grid-template-columns: minmax(0, 720px) minmax(240px, 320px); gap: var(--space-2xl); max-width: 1200px; margin-inline: auto; align-items: start; }
|
||||
.session-column { min-width: 0; }
|
||||
.workspace-intro { margin-bottom: 1.4rem; }
|
||||
.workspace-intro h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.4rem; }
|
||||
.workspace-intro p { font-size: 0.85rem; color: var(--muted); line-height: 1.6; margin: 0; }
|
||||
.tabs { width: fit-content; padding: 4px; gap: 4px; background: #1b1f2a; border: 1px solid var(--border); border-radius: 10px; }
|
||||
.tabs button { padding: 0.45rem 1.5rem; font-size: 0.85rem; border: none; background: transparent; }
|
||||
.tabs button { padding: 0.45rem var(--space-xl); font-size: 0.85rem; border: none; background: transparent; }
|
||||
.tabs button.active { background: #3e3025; color: #ffb575; }
|
||||
.panel { box-shadow: 0 6px 28px #00000012; }
|
||||
.panel > .status { line-height: 1.6; margin: 0.1rem 0; }
|
||||
@@ -320,12 +328,14 @@ summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
|
||||
.dropzone p { font-size: 0.85rem; line-height: 1.65; margin: 0 0 1rem; }
|
||||
input[type=file] { max-width: 100%; font-size: 0.8rem; }
|
||||
input[type=file]::file-selector-button { border: 1px solid #505667; border-radius: 6px; padding: 0.45rem 0.65rem; margin-right: 0.6rem; background: #242a36; color: var(--text); cursor: pointer; }
|
||||
.network-details > fieldset { margin-top: 0.65rem; }
|
||||
.share-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
|
||||
.share-actions button { font-size: 0.88rem; }
|
||||
.code-details[open] { display: flex; flex-direction: column; align-items: start; gap: 0.6rem; }
|
||||
.activity-panel { min-width: 0; border-left: 1px solid var(--border); padding-left: 1.5rem; }
|
||||
.activity-heading { display: flex; align-items: center; gap: 0.6rem; }
|
||||
.share-actions, .session-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
|
||||
.share-actions button, .session-actions button { font-size: 0.88rem; }
|
||||
.code-details { width: 100%; min-width: 0; }
|
||||
.code-details > .code-entry { margin-top: var(--space-md); }
|
||||
.code-entry { display: flex; flex-direction: column; gap: var(--space-md); min-width: 0; }
|
||||
.code-entry > button { align-self: start; font-size: 0.88rem; }
|
||||
.activity-panel { min-width: 0; border-left: 1px solid var(--border); padding-left: var(--space-xl); }
|
||||
.activity-heading { display: flex; align-items: center; gap: var(--space-sm); }
|
||||
.activity-heading h2 { font-size: 0.9rem; font-weight: 600; margin: 0; }
|
||||
.activity-heading > span { font-size: 0.68rem; color: var(--muted); border-radius: 5px; padding: 0.15rem 0.35rem; background: #242936; }
|
||||
.empty-activity { padding: 3.5rem 0.25rem; text-align: center; }
|
||||
@@ -333,8 +343,8 @@ input[type=file]::file-selector-button { border: 1px solid #505667; border-radiu
|
||||
.empty-activity h3 { font-size: 0.88rem; font-weight: 500; margin: 0 0 0.6rem; }
|
||||
.empty-activity p { font-size: 0.8rem; line-height: 1.7; color: var(--muted); }
|
||||
p.activity-note { font-size: 0.7rem; color: var(--muted); line-height: 1.6; }
|
||||
.empty-activity .activity-note { margin-top: 1.5rem; }
|
||||
.activity-list { list-style: none; padding: 0; margin: 1.25rem 0; }
|
||||
.empty-activity .activity-note { margin-top: var(--space-xl); }
|
||||
.activity-list { list-style: none; padding: 0; margin: var(--space-lg) 0; }
|
||||
.activity-item { display: flex; gap: 0.7rem; padding: 1rem 0; border-bottom: 1px solid var(--border); font-size: 0.78rem; }
|
||||
.activity-item > div { min-width: 0; }
|
||||
.activity-icon { color: var(--accent); padding-top: 0.1rem; font-size: 1rem; }
|
||||
@@ -346,11 +356,11 @@ p.activity-note { font-size: 0.7rem; color: var(--muted); line-height: 1.6; }
|
||||
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
|
||||
@media (max-width: 1150px) {
|
||||
.app-shell { grid-template-columns: 230px minmax(0, 1fr); }
|
||||
.connection-workspace { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
|
||||
.activity-panel { border-left: 0; border-top: 1px solid var(--border); padding: 1.5rem 0 0; }
|
||||
.empty-activity { padding: 1.5rem 0; }
|
||||
.connection-header { padding-inline: 1.5rem; }
|
||||
.workspace-scroll { padding: 1.5rem; }
|
||||
.connection-workspace { grid-template-columns: minmax(0, 1fr); gap: var(--space-2xl); }
|
||||
.activity-panel { border-left: 0; border-top: 1px solid var(--border); padding: var(--space-xl) 0 0; }
|
||||
.empty-activity { padding: var(--space-xl) 0; }
|
||||
.connection-header { padding-inline: var(--space-xl); }
|
||||
.workspace-scroll { padding: var(--space-xl); }
|
||||
}
|
||||
@media (max-width: 700px) {
|
||||
#app { height: auto; min-height: 100dvh; }
|
||||
@@ -361,7 +371,7 @@ p.activity-note { font-size: 0.7rem; color: var(--muted); line-height: 1.6; }
|
||||
.sidebar-footer { padding-top: 0; }
|
||||
.connection-header { flex-wrap: wrap; padding: 1rem; min-height: 0; gap: 0.75rem; }
|
||||
.sidebar-toggle { display: block; flex-basis: 100%; font-size: 0.8rem; text-align: left; background: transparent; padding: 0.5rem; }
|
||||
.workspace-scroll { padding: 1.25rem 1rem; overflow: visible; }
|
||||
.workspace-scroll { padding: var(--space-lg) 1rem; overflow: visible; }
|
||||
.title-line { gap: 0.4rem; }
|
||||
.title-line h1 { font-size: 1.15rem; }
|
||||
.panel { padding: 1rem; }
|
||||
|
||||
Reference in new issue
Block a user