tangled
alpha
login
or
join now
moth11.net
/
xcvr
2
fork
atom
frontend for xcvr appview
2
fork
atom
overview
issues
pulls
pipelines
file input button prototype
moth11.net
4 months ago
7d2d0529
b4860de1
+33
-2
2 changed files
expand all
collapse all
unified
split
src
lib
components
AutoGrowTextArea.svelte
Transmitter.svelte
+32
-2
src/lib/components/AutoGrowTextArea.svelte
···
193
193
};
194
194
</script>
195
195
196
196
-
<div class="autogrowwrapper">
196
196
+
<div class="autogrowwrapper" style:--fs={fs ?? "1rem"}>
197
197
<textarea
198
198
rows="1"
199
199
bind:value
···
205
205
onbeforeinput={bi}
206
206
style:font-weight={bold ? "700" : "inherit"}
207
207
style:--theme={color}
208
208
-
style:font-size={fs ?? "1rem"}
208
208
+
style:font-size="var(--fs)"
209
209
{placeholder}
210
210
></textarea>
211
211
+
{#if value === ""}
212
212
+
<label class="media-upload-button" for="media-upload"
213
213
+
>...or upload an image</label
214
214
+
>
215
215
+
<input
216
216
+
onchange={(event) => {
217
217
+
if (
218
218
+
event.currentTarget.files &&
219
219
+
event.currentTarget.files.length > 0
220
220
+
) {
221
221
+
imageHandler?.(event.currentTarget.files[0]);
222
222
+
}
223
223
+
}}
224
224
+
id="media-upload"
225
225
+
type="file"
226
226
+
accept="image/*"
227
227
+
/>
228
228
+
{/if}
211
229
{#if curemojiresults !== null && curemojinumber !== null}
212
230
<div bind:this={emojilist} class="emoji-selector">
213
231
{#each curemojiresults[0] as result, idx}
···
226
244
</div>
227
245
228
246
<style>
247
247
+
#media-upload {
248
248
+
display: none;
249
249
+
}
250
250
+
.media-upload-button {
251
251
+
position: absolute;
252
252
+
top: 0;
253
253
+
right: 0;
254
254
+
margin: 0;
255
255
+
font-size: var(--fs);
256
256
+
border: none;
257
257
+
}
258
258
+
229
259
.emoji-selector {
230
260
width: 100%;
231
261
position: absolute;
+1
src/lib/components/Transmitter.svelte
···
86
86
}
87
87
};
88
88
const convertFileToImageItem = (blob: File) => {
89
89
+
cancelimagepost();
89
90
const blobUrl = URL.createObjectURL(blob);
90
91
ctx.initImage(blob);
91
92
imageURL = blobUrl;