Update styling

This commit is contained in:
Edward Shen 2022-07-27 19:53:32 -07:00
parent 7b7d119831
commit 170e23cba7
Signed by: edward
GPG key ID: 19182661E818369F
2 changed files with 48 additions and 20 deletions

View file

@ -29,7 +29,7 @@ body {
} }
.unselectable { .unselectable {
user-select: none; user-select: none;
} }
hr { hr {
@ -88,7 +88,9 @@ th {
cursor: pointer; cursor: pointer;
} }
img, audio, video { img,
audio,
video {
border-radius: $padding; border-radius: $padding;
margin-bottom: $padding; margin-bottom: $padding;
max-height: 75vh; max-height: 75vh;
@ -96,11 +98,9 @@ img, audio, video {
} }
textarea { textarea {
width: 100%; @extend .paste;
height: 100%; height: 75vh;
min-width: 75vw; border-color: white;
min-height: 75vh;
box-sizing: border-box;
} }
.primary { .primary {
@ -117,3 +117,29 @@ textarea {
padding-left: $padding; 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

@ -34,9 +34,12 @@ const FileForm = () => {
fr.readAsArrayBuffer(file); fr.readAsArrayBuffer(file);
} }
return ( return <>
<input type="file" onChange={handleChange} /> <label className="file-upload" >
) Select a file
<input type="file" onChange={handleChange} />
</label>
</>
} }
const PasteForm = () => { const PasteForm = () => {
@ -48,22 +51,21 @@ const PasteForm = () => {
} }
return ( return (
<pre className='paste'> <form className='hljs centered' onSubmit={handleSubmit}>
<form className='hljs centered' onSubmit={handleSubmit}> <textarea
<textarea placeholder="Sample text"
placeholder="Sample text" value={value}
value={value} onChange={(e) => setValue(e.target.value)}
onChange={(e) => setValue(e.target.value)} />
/> <input className="text-upload" type="submit" value="submit" />
<input type="submit" value="submit" /> </form>
</form>
</pre>
) )
} }
function createUploadUi() { function createUploadUi() {
const html = <main className='hljs centered fullscreen'> const html = <main className='hljs centered fullscreen'>
<FileForm /> <FileForm />
<p>or paste your data below</p>
<PasteForm /> <PasteForm />
</main>; </main>;