1
0
Fork 0
nyazoom/dist/link.html

46 lines
1.2 KiB
HTML
Raw Normal View History

2023-04-09 17:26:39 +00:00
<!DOCTYPE html>
<html lang="en">
2023-04-11 10:29:21 +00:00
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/link.css" rel="stylesheet">
<script>
document.addEventListener("DOMContentLoaded", () => {
const params = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams, prop) => searchParams.get(prop),
});
if (params.link !== null) {
let link = `${window.location.origin}/download/${params.link}`;
let link_el = document.getElementById("link");
link_el.href = link;
link_el.innerHTML = link;
}
});
2023-04-13 20:51:14 +00:00
function clipboard() {
let copyText = document.getElementById("link");
2023-04-13 20:55:22 +00:00
navigator.clipboard.writeText(copyText.href).then(() => alert("Copied: " + copyText.href));
2023-04-13 20:51:14 +00:00
}
2023-04-11 10:29:21 +00:00
</script>
</head>
<body>
<div class="link-wrapper">
<a id="link" href=""></a>
</div>
2023-04-13 20:51:14 +00:00
<button class="return-button" onclick="clipboard()">Copy to Clipboard</button>
2023-04-11 10:29:21 +00:00
<a href="/" class="return-button">Return to home</a>
</body>
2023-04-09 17:26:39 +00:00
</html>