Skip to content

Commit 554e192

Browse files
author
Aleksander Grygier
committed
feat: UI improvements
1 parent b7f8495 commit 554e192

File tree

3 files changed

+94
-30
lines changed

3 files changed

+94
-30
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<script>
2+
import { fade } from 'svelte/transition';
3+
4+
export let delay = 600;
5+
</script>
6+
7+
<div class="loading-spinner" in:fade={{ duration: 100, delay }} out:fade={{ duration: 100 }}>
8+
<div />
9+
<div />
10+
</div>
11+
12+
<style>
13+
@keyframes rotate {
14+
0% {
15+
transform: rotate(0deg);
16+
}
17+
100% {
18+
transform: rotate(360deg);
19+
}
20+
}
21+
22+
.loading-spinner {
23+
--loading-spinner-border-width: 3px;
24+
display: inline-block;
25+
position: relative;
26+
width: var(--size, 2rem);
27+
height: var(--size, 2rem);
28+
}
29+
30+
.loading-spinner div {
31+
box-sizing: border-box;
32+
display: block;
33+
position: absolute;
34+
width: var(--size);
35+
height: var(--size);
36+
border: var(--loading-spinner-border-width) solid var(--c-text);
37+
border-radius: 50%;
38+
animation: rotate 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
39+
border-color: var(--c-text) transparent transparent transparent;
40+
}
41+
42+
.loading-spinner:nth-child(1) {
43+
animation-delay: -0.375s;
44+
}
45+
</style>

apps/web/src/lib/components/RecordingTile.svelte

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import Button from './Button.svelte';
55
import { browser } from '$app/environment';
66
import transcribeRecording from '$lib/methods/transcribe-recording';
7+
import LoadingSpinner from './LoadingSpinner.svelte';
78
89
interface RecordingTileProps {
910
blob: Blob;
@@ -25,6 +26,7 @@
2526
url
2627
}: RecordingTileProps = $props();
2728
let isPlaying = $state(false);
29+
let isTranscribing = $state(false);
2830
let waveformContainer: HTMLElement;
2931
let wavesurfer: WaveSurfer;
3032
let progressColor = $state(
@@ -86,28 +88,39 @@
8688
</div>
8789
{:else}
8890
<div class="transcribe-cta">
89-
<span> You haven't transcribed this recording yet. </span>
90-
91-
<Button
92-
kind="secondary"
93-
label="Transcribe"
94-
onclick={async () => {
95-
if (!savedRecordings) {
96-
return;
97-
}
98-
99-
const transcriptionResult = await transcribeRecording(blob);
100-
transcription = transcriptionResult ? transcriptionResult.text : '';
101-
102-
savedRecordings = savedRecordings.map((rec) => {
103-
if (rec.id === id) {
104-
rec.transcription = transcription;
91+
{#if isTranscribing}
92+
<LoadingSpinner --size="1.5rem" />
93+
94+
<span> Transcription in progress... </span>
95+
{:else}
96+
<span> You haven't transcribed this recording yet. </span>
97+
98+
<Button
99+
kind="secondary"
100+
label="Transcribe"
101+
onclick={async () => {
102+
if (!savedRecordings) {
103+
return;
105104
}
106105

107-
return rec;
108-
});
109-
}}
110-
/>
106+
isTranscribing = true;
107+
108+
const transcriptionResult = await transcribeRecording(blob);
109+
110+
transcription = transcriptionResult ? transcriptionResult.text : '';
111+
112+
isTranscribing = false;
113+
114+
savedRecordings = savedRecordings.map((rec) => {
115+
if (rec.id === id) {
116+
rec.transcription = transcription;
117+
}
118+
119+
return rec;
120+
});
121+
}}
122+
/>
123+
{/if}
111124
</div>
112125
{/if}
113126

@@ -164,6 +177,7 @@
164177
165178
.transcription {
166179
padding: 1rem;
180+
display: inline-grid;
167181
168182
.inner {
169183
padding: 1rem;
@@ -179,7 +193,7 @@
179193
.transcribe-cta {
180194
display: grid;
181195
padding: 1rem;
182-
gap: 1rem;
196+
gap: 1.25rem;
183197
place-items: center;
184198
}
185199
</style>

apps/web/src/routes/+page.svelte

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,26 +90,26 @@
9090
</script>
9191

9292
<svelte:head>
93-
<title>Memvo — Share or publish recordings with transcriptions</title>
93+
<title>Memvo — Easily share recordings with transcriptions</title>
9494

9595
<meta
9696
name="description"
97-
content="Instant recordings 🔴 with transcriptions 📝 that you can publish 📤 to Google Docs."
97+
content="Instant recordings 🔴 with transcriptions 📝 that you can share 📤."
9898
/>
9999
</svelte:head>
100100

101101
<main>
102102
<div class="hero">
103103
<div class="text">
104104
<h1>
105-
Record, transcribe and publish.
105+
Record, transcribe and share.
106106
<br />
107107
<strong>It's that simple.</strong>
108108
</h1>
109109

110-
<p>
110+
<!-- <p>
111111
The easiest way to instantly get your ideas, interviews and conversations to Google Docs.
112-
</p>
112+
</p> -->
113113
</div>
114114

115115
<Recorder {discardRecording} bind:recordingUrl {saveRecording} />
@@ -139,7 +139,7 @@
139139
<style>
140140
.hero {
141141
display: grid;
142-
gap: 2.5rem;
142+
gap: 4rem;
143143
padding-block: 2.5rem;
144144
text-align: center;
145145
@@ -150,10 +150,15 @@
150150
151151
.hero .text {
152152
display: grid;
153-
gap: 1rem;
154-
padding: 1.5rem;
155-
margin-bottom: 3rem;
153+
padding: 0 1rem;
154+
gap: 0.5rem;
156155
place-self: center;
156+
157+
@media (width >= 768px) {
158+
gap: 1rem;
159+
margin-bottom: 3rem;
160+
padding: 1.5rem;
161+
}
157162
}
158163
159164
.hero p {

0 commit comments

Comments
 (0)