-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
V6.0.0 - Add basic logic for assets, use tsconfig aliases, fix name o…
…f type
- Loading branch information
1 parent
7761c91
commit f39db70
Showing
12 changed files
with
126 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { Asset } from "@/lib/asset"; | ||
document.addEventListener("astro:page-load", () => { | ||
const buttons = document.querySelectorAll( | ||
"[data-asset]", | ||
) as NodeListOf<HTMLButtonElement>; | ||
for (const button of buttons) { | ||
button.addEventListener("click", () => { | ||
const asset: Asset = JSON.parse(button.dataset.asset!); | ||
if (asset.say) alert(asset.say); | ||
if (asset.link) { | ||
sessionStorage.setItem("goUrl", asset.link); | ||
return location.replace("/tb"); | ||
} | ||
if (asset.links) { | ||
const selection = prompt( | ||
`Select a link to go to: ${asset.links.map(({ name }, idx) => `\n${name}: ${idx + 1}`).join("")}`, | ||
); | ||
if (!selection) return; | ||
const link = asset.links[Number.parseInt(selection) - 1]; | ||
if (!link) return alert("Invalid selection"); | ||
sessionStorage.setItem("goUrl", link.url); | ||
return location.replace("/tb"); | ||
} | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,57 @@ | ||
--- | ||
import Layout from "../layouts/Main.astro"; | ||
import Layout from "@/layouts/Main.astro"; | ||
const splashText = [ | ||
"Over 8 Million Users since 2023", | ||
"Fastest growing proxy server", | ||
"Made by xBubbo", | ||
"Check out discord.gg/interstellar :)", | ||
"Thanks for using the site", | ||
"Follow us on Tiktok (@useinterstellar)", | ||
"Subscribe to us on YouTube (@unblocking)", | ||
"Subscribe to my Youtube (@xbubbo)", | ||
"Check out the settings page", | ||
"Check out our Patreon (https://www.patreon.com/gointerstellar)", | ||
]; | ||
--- | ||
|
||
<script src="../lib/cloak.ts"></script> | ||
<script src="@/lib/cloak.ts"></script> | ||
<Layout> | ||
<h3 class="flex text-8xl font-black uppercase place-content-center mt-40">Interstellar</h3> | ||
<div class="flex place-content-center mt-4"> | ||
<input | ||
class="h-16 rounded-md w-1/2 py-3 px-4 placeholder-text-secondary leading-tight focus:outline-none bg-interactive border-border" | ||
placeholder="Search" | ||
onkeydown="inputDown" | ||
id="search" | ||
/> | ||
<div class="flex h-full flex-col"> | ||
<h3 class="flex text-8xl font-black uppercase place-content-center mt-40 hover:scale-105 hover:-translate-y-1 duration-150">Interstellar</h3> | ||
<div id="form" class="flex mt-4 flex-col items-center justify-center gap-4"> | ||
<span class="text-accent">{splashText[Math.floor(Math.random() * splashText.length)]}</span> | ||
<input | ||
class="h-16 rounded-md w-1/2 py-3 px-4 placeholder-text-secondary leading-tight focus:outline-none bg-interactive border-border" | ||
placeholder="Search" | ||
id="search" | ||
/> | ||
</div> | ||
</div> | ||
</Layout> | ||
<script> | ||
const searchUrl = localStorage.getItem("engine") || "https://www.google.com/search?q="; | ||
const input = document.getElementById("search") as HTMLInputElement; | ||
const input = document.getElementById("search") as HTMLInputElement | null; | ||
function isUrl(val = "") { | ||
if (/^http(s?):\/\//.test(val) || (val.includes(".") && !val.includes(" "))) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
input.addEventListener("keydown", (e) => { | ||
if (e.key === "Enter") { | ||
let url = input.value; | ||
if (!isUrl(url)) { | ||
url = searchUrl + url; | ||
} else if (!(url.startsWith("https://") || url.startsWith("http://"))) { | ||
url = `https://${url}`; | ||
} | ||
// TODO: change this logic | ||
window.location.href = `/jquery/${window.__uv$config.encodeUrl(url)}`; | ||
document.addEventListener("astro:page-load", () => { | ||
if (input) { | ||
input.focus(); | ||
input.addEventListener("keydown", (e) => { | ||
if (e.key === "Enter") { | ||
let url = input.value; | ||
if (!isUrl(url)) { | ||
url = searchUrl + url; | ||
} else if (!(url.startsWith("https://") || url.startsWith("http://"))) { | ||
url = `https://${url}`; | ||
} | ||
sessionStorage.setItem("goUrl", url); | ||
location.replace("/tb"); | ||
} | ||
}); | ||
} | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
import Layout from "@/layouts/Main.astro"; | ||
--- | ||
|
||
<Layout> | ||
<main>settings</main> | ||
</Layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
--- | ||
import Layout from "../layouts/Layout.astro"; | ||
export const prerender = true; | ||
import Layout from "@/layouts/Layout.astro"; | ||
--- | ||
|
||
<Layout> | ||
<div>tabs</div> | ||
<a href="/">home</a> | ||
<iframe id="frame__1" class="w-full h-screen"></iframe> | ||
</Layout> | ||
<script> | ||
const frame = document.getElementById("frame__1") as HTMLIFrameElement; | ||
frame.src = | ||
window.__uv$config.prefix + window.__uv$config.encodeUrl(sessionStorage.getItem("goUrl") || localStorage.getItem("engine") || "https://www.google.com"); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
{ | ||
"extends": "astro/tsconfigs/strict", | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"paths": { | ||
"@/*": ["src/*"] | ||
}, | ||
}, | ||
"exclude": ["node_modules", "dist", "public/assets/bundled/**"] | ||
} |