Skip to content

Commit

Permalink
add reload button
Browse files Browse the repository at this point in the history
  • Loading branch information
wearrrrr committed Nov 21, 2024
1 parent a4efd90 commit b0760dd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
3 changes: 3 additions & 0 deletions public/img/nav/reload.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions src/components/ProxyRegistrar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@

const iframe = document.getElementById("proxy-frame") as HTMLIFrameElement;
const topbar = document.getElementById("top-bar") as HTMLDivElement;
const closeButton = document.getElementById("close-button") as HTMLButtonElement;
const backwardsButton = document.getElementById("nav-backwards") as HTMLImageElement;
const forwardsButton = document.getElementById("nav-forwards") as HTMLImageElement;
const shareButton = document.getElementById("nav-share") as HTMLImageElement;
const closeButton = document.getElementById("close-button")!;
const backwardsButton = document.getElementById("nav-backwards")!;
const forwardsButton = document.getElementById("nav-forwards")!;
const reloadButton = document.getElementById("nav-reload")!;
const shareButton = document.getElementById("nav-share")!;
const preference = Alu.store.get("proxy").value;
if (preference === "ultraviolet") {
iframe.src = window.__uv$config.prefix + window.__uv$config.encodeUrl(url);
Expand Down Expand Up @@ -150,6 +151,11 @@
iframe.contentWindow.history.back();
}
};
reloadButton.onclick = () => {
if (iframe.contentWindow) {
iframe.contentWindow.location.reload();
}
};
shareButton.onclick = () => {
const proxyFrame = document.getElementById("proxy-frame") as HTMLIFrameElement;
if (proxy.value === "rammerhead") {
Expand Down
7 changes: 4 additions & 3 deletions src/pages/[lang]/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ export function getStaticPaths() {
</div>
<div class="top-bar-right">
<div class="nav-container">
<img width="32px" height="32px" id="nav-backwards" src="/img/nav/backwards.svg" alt="Backwards Arrow" />
<img width="32px" height="32px" id="nav-forwards" src="/img/nav/forwards.svg" alt="Forwards Arrow" />
<img width="32px" height="32px" id="nav-share" src="/img/nav/share.svg" alt="Share Page" />
<img width="32px" height="32px" id="nav-backwards" src="/img/nav/backwards.svg" alt="Backward" />
<img width="32px" height="32px" id="nav-forwards" src="/img/nav/forwards.svg" alt="Forward" />
<img width="28px" height="32px" id="nav-reload" src="/img/nav/reload.svg" alt="Reload Page" />
<img width="28px" height="32px" id="nav-share" src="/img/nav/share.svg" alt="Share Page" />
</div>
<button id="close-button">Close</button>
</div>
Expand Down

0 comments on commit b0760dd

Please sign in to comment.