Compare commits

..

No commits in common. "01d9d4f28f19a4f32619625bf9e35b9cde803206" and "6d6297c3d7fdce850da53eabc397f99707a34be5" have entirely different histories.

2 changed files with 16 additions and 20 deletions

View file

@ -6,24 +6,8 @@ const qr_code = document.getElementById("qr-code");
const error_message = document.getElementById("error"); const error_message = document.getElementById("error");
const copy_message = document.getElementById("copied"); const copy_message = document.getElementById("copied");
to_shorten_btn.addEventListener("click", shorten); to_shorten_btn.addEventListener("click", async () => {
addEventListener("keydown", (event) => {if(event.key == "Enter") shorten;}); const original_url = url_input.value
short_url.addEventListener("click", event => {
// copy the short url to clipboard
navigator.clipboard.writeText(event.target.innerText)
.then(() => {
// show a message
copy_message.style.opacity = "1";
setTimeout(() => copy_message.style.opacity = "0", 3000);
})
.catch(error => {
alert("An error has occurred...\n" + error);
});
});
const shorten = async () => {
const original_url = url_input.value
// check if the url input is empty // check if the url input is empty
if (original_url.length === 0) { if (original_url.length === 0) {
return; return;
@ -68,7 +52,20 @@ const shorten = async () => {
// get the qr code of the short url and show it // get the qr code of the short url and show it
qr_code.src = `https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=${result}`; qr_code.src = `https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=${result}`;
qr_code.alt = result; qr_code.alt = result;
} });
short_url.addEventListener("click", event => {
// copy the short url to clipboard
navigator.clipboard.writeText(event.target.innerText)
.then(() => {
// show a message
copy_message.style.opacity = "1";
setTimeout(() => copy_message.style.opacity = "0", 3000);
})
.catch(error => {
alert("An error has occurred...\n" + error);
});
});
const rickroll = { const rickroll = {
check: (url)=>{ check: (url)=>{

View file

@ -11,7 +11,6 @@
<section> <section>
<h2>About Krll</h2> <h2>About Krll</h2>
<p>Krll은 개인정보 수집 없이 URL을 단축하는 서비스입니다. 방해꾼 없이 빠르게 URL을 단축하고 공유하세요.</p> <p>Krll은 개인정보 수집 없이 URL을 단축하는 서비스입니다. 방해꾼 없이 빠르게 URL을 단축하고 공유하세요.</p>
<p>repository: <a href="https://git.worldc.one/sunwoo1524/krll">https://git.worldc.one/sunwoo1524/krll</a></p>
<h2>특징</h2> <h2>특징</h2>
<ul> <ul>