Compare commits

..

No commits in common. "170e23cba7ac2dab48bd25d44932328879659ca2" and "253fccaf7879f5dfa2ca34694513e851fec9096b" have entirely different histories.

2 changed files with 27 additions and 53 deletions

View file

@ -88,9 +88,7 @@ th {
cursor: pointer;
}
img,
audio,
video {
img, audio, video {
border-radius: $padding;
margin-bottom: $padding;
max-height: 75vh;
@ -98,9 +96,11 @@ video {
}
textarea {
@extend .paste;
height: 75vh;
border-color: white;
width: 100%;
height: 100%;
min-width: 75vw;
min-height: 75vh;
box-sizing: border-box;
}
.primary {
@ -117,29 +117,3 @@ textarea {
padding-left: $padding;
}
}
.button {
@extend .hljs;
border: 1px solid white;
border-radius: $padding;
padding: $padding;
margin: $padding;
font-size: 16px;
&:hover {
cursor: pointer;
}
}
.file-upload {
@extend .button;
input {
display: none;
}
}
.text-upload {
@extend .button;
}

View file

@ -25,21 +25,20 @@ require('highlightjs-line-numbers.js');
const FileForm = () => {
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
let file = event.target.files![0];
const fr = new FileReader();
fr.onload = (_e) => {
let data = new Uint8Array(fr.result as ArrayBuffer);
fr.onload = (e) => {
const { result } = e.target;
if (result instanceof ArrayBuffer) {
let data = new Uint8Array(result);
encrypt_array_buffer(data);
}
fr.readAsArrayBuffer(file);
}
fr.readAsArrayBuffer((event.target as HTMLInputElement).files[0]);
}
return <>
<label className="file-upload" >
Select a file
return (
<input type="file" onChange={handleChange} />
</label>
</>
)
}
const PasteForm = () => {
@ -51,21 +50,22 @@ const PasteForm = () => {
}
return (
<pre className='paste'>
<form className='hljs centered' onSubmit={handleSubmit}>
<textarea
placeholder="Sample text"
value={value}
onChange={(e) => setValue(e.target.value)}
/>
<input className="text-upload" type="submit" value="submit" />
<input type="submit" value="submit" />
</form>
</pre>
)
}
function createUploadUi() {
const html = <main className='hljs centered fullscreen'>
<FileForm />
<p>or paste your data below</p>
<PasteForm />
</main>;