Skip to content

Commit

Permalink
Auto add https
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicell committed Jul 17, 2022
1 parent 67b3c48 commit 3f6fdb2
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ import Layout from "../layouts/Layout.astro";
try {
new URL(website);
} catch {
Toastify({
text: "Input is not a URL.",
gravity: "top",
position: "center",
style: {
background: "linear-gradient(to right, #d50000, #ff1744)",
}
}).showToast();
return;
try {
website = "https://" + website;
new URL(website);
} catch {
Toastify({
text: "Input is not a URL.",
gravity: "top",
position: "center",
style: {
background: "linear-gradient(to right, #d50000, #ff1744)",
}
}).showToast();
return;
}
}
var base64 = btoa(website);
var base64arr = base64.split("");
Expand Down

0 comments on commit 3f6fdb2

Please sign in to comment.