Skip to content

Commit

Permalink
Small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicell committed Jul 17, 2022
1 parent 3f6fdb2 commit 557d039
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const { title } = Astro.props as Props;
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<title>{title}</title>
<meta name="description" content="Make your links less readable and more fun at loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo.ng" />
</head>
<body>
<slot />
Expand Down
3 changes: 1 addition & 2 deletions src/pages/404.astro
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ import Layout from "../layouts/Layout.astro";
pieces[i] = bases[parseInt(pieces[i], 2)];
}

var decoded = atob(pieces.join(''));

try {
var decoded = atob(pieces.join(''));
new URL(decoded);
window.location.href = decoded;
} catch {}
Expand Down
5 changes: 2 additions & 3 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,14 @@ import Layout from "../layouts/Layout.astro";
<main>
<h1>Make your links <a href="/" class="text-gradient">loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo.ng</a>er</h1>
<div class="input">
<input id="website" type="url" autofocus />
<button onclick="longer()">lo.nger</button>
<input tabindex="0" id="website" placeholder="https://example.com" aria-label="URL to lengthen" type="url" autofocus />
<button type="submit" onclick="longer()">lo.nger</button>
</div>
<div id="stats" style="visibility: hidden">Original: <span id="original"></span>, New: <span id="new"></span>, +<span id="percent"></span>%</div>
<a id="result" target="_blank"></a>
</main>
<script is:inline>
document.getElementById("website").addEventListener("keypress", function(event) {
console.log(event);
if (event.key === "Enter") {
event.preventDefault();
longer();
Expand Down

0 comments on commit 557d039

Please sign in to comment.