initial commit
This commit is contained in:
24
static/script.js
Executable file
24
static/script.js
Executable file
@@ -0,0 +1,24 @@
|
||||
document.getElementById("myfile").addEventListener("change", (event) => {
|
||||
btn = event.target;
|
||||
filename = btn.files[0].name;
|
||||
btn.parentNode.children[1].innerHTML = filename
|
||||
})
|
||||
try {
|
||||
document.getElementById("copy-btn").addEventListener("click", copy_text);
|
||||
} catch (e) {
|
||||
if (e instanceof TypeError)
|
||||
e = 0;
|
||||
else alert(e);
|
||||
}
|
||||
|
||||
function copy_text(){
|
||||
const copyText = document.getElementById("myInput").textContent.trim();
|
||||
const textArea = document.createElement('textarea');
|
||||
textArea.textContent = copyText;
|
||||
document.body.append(textArea);
|
||||
textArea.select();
|
||||
document.execCommand("copy");
|
||||
textArea.style.display = "none";
|
||||
|
||||
// console.log("Hello World!");
|
||||
}
|
||||
42
static/style.css
Executable file
42
static/style.css
Executable file
@@ -0,0 +1,42 @@
|
||||
*{
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
main{
|
||||
display: flex;
|
||||
width: 90vw;
|
||||
height: 50vh;
|
||||
margin: 0 5vw;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
|
||||
main div{
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
textarea{
|
||||
width: 90%;
|
||||
height: 20vh;
|
||||
margin: 20px 0;
|
||||
min-height: fit-content;
|
||||
}
|
||||
|
||||
/* button{
|
||||
border: 1px solid black;
|
||||
padding: 5px;
|
||||
border-radius: 2.5px;
|
||||
} */
|
||||
|
||||
input[type="file"] {
|
||||
display: none;
|
||||
}
|
||||
.custom-file-upload, button {
|
||||
border: 1px solid #313131;
|
||||
background-color: lightgray;
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
cursor: pointer;
|
||||
font-size: 1rem;
|
||||
border-radius: .2rem;
|
||||
}
|
||||
Reference in New Issue
Block a user