38 lines
1.6 KiB
HTML
38 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Ulož.to Rychle</title>
|
|
<style>
|
|
body {display: flex; justify-content: center; align-items: center; height: 100vh; font-family: sans-serif; text-align: center; font-size: 20px; background: #4a0f4d; color: #fff;}
|
|
.page {max-width: 550px; width: 100%;}
|
|
.input {display: flex; gap: 5px; flex-flow: row; justify-content: space-between; width: 100%; margin-top: 30px;}
|
|
.input * {background-color: #702673; border: 2px solid #330a35; border-radius: 5px; padding: 10px 15px; font-size: 17px; outline: 0; color: #fff;}
|
|
.input input {width: 100%;}
|
|
.input button {background: #702673;}
|
|
.input button:hover {background-color: #4a0f4d; cursor: pointer;}
|
|
.result {justify-content: center; margin-top: 20px; font-size: 17px; display: block; display: flex; gap: 10px;}
|
|
.result a {color: #fff5;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="page">
|
|
<h1>Ulož.to Rychle</h1>
|
|
<p>Stahujte z Ulož.to vysokou rychlostí</p>
|
|
<div class="input">
|
|
<input placeholder="Vložte odkaz z Ulož.to" /> <button onclick="download();">Získat</button>
|
|
</div>
|
|
<div class="result"></div>
|
|
</div>
|
|
<script>
|
|
function download() {
|
|
let url = document.querySelector("input").value;
|
|
let regex = new RegExp(/https:\/\/.*(ulozto\.cz|uloz\.to)\/file\/(.*?)\/.*/gm);
|
|
let res = regex.exec(url);
|
|
if(!res) return alert("Neplatná URL!");
|
|
let id = res[2];
|
|
let new_url = new URL(`/u/${id}`, location.origin);
|
|
document.querySelector(".result").innerHTML = `<code>${new_url}</code> <a href="${new_url}" download>Stáhnout</a>`;
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |