mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-12 22:00:02 -04:00
update visuals of <Proxy/>
This commit is contained in:
parent
bc80f9171c
commit
ec58ef0e37
3 changed files with 85 additions and 15 deletions
|
@ -404,8 +404,4 @@
|
||||||
background-color: rgb(var(--m3-scheme-background));
|
background-color: rgb(var(--m3-scheme-background));
|
||||||
color: rgb(var(--m3-scheme-on-background));
|
color: rgb(var(--m3-scheme-on-background));
|
||||||
}
|
}
|
||||||
iframe {
|
|
||||||
outline: none;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,12 +1,20 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { BareClient } from "bare-client-custom";
|
import { BareClient } from "bare-client-custom";
|
||||||
import { SegmentedButtonContainer, SegmentedButtonItem } from "m3-svelte";
|
import {
|
||||||
|
Card,
|
||||||
|
SegmentedButtonContainer,
|
||||||
|
SegmentedButtonItem,
|
||||||
|
} from "m3-svelte";
|
||||||
import { Win, openWindow } from "../../corium";
|
import { Win, openWindow } from "../../corium";
|
||||||
|
import Icon from "@iconify/svelte";
|
||||||
|
|
||||||
let selectedProxy = "ultraviolet";
|
let selectedProxy = "ultraviolet";
|
||||||
|
|
||||||
let url: string = "http://google.com";
|
let url: string = "http://google.com";
|
||||||
|
|
||||||
|
import iconBack from "@iconify-icons/ic/outline-arrowback";
|
||||||
|
import { onMount } from "svelte";
|
||||||
|
|
||||||
let proxyIframe: HTMLIFrameElement;
|
let proxyIframe: HTMLIFrameElement;
|
||||||
|
|
||||||
function frameLoad() {
|
function frameLoad() {
|
||||||
|
@ -39,15 +47,52 @@
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
onMount(() => {
|
||||||
|
visitURL(url);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="container h-full w-full">
|
<div class="h-full w-full flex flex-col">
|
||||||
<div class="flex">
|
<div class="flex p-2">
|
||||||
<div class="container">
|
<div class="flex text-xl items-center w-full">
|
||||||
<input bind:value={url} type="text" />
|
<button>
|
||||||
<button on:click={() => visitURL(url)}>Go!</button>
|
<Icon icon="fluent-mdl2:back" />
|
||||||
|
</button>
|
||||||
|
<div class="p-2" />
|
||||||
|
<button>
|
||||||
|
<Icon icon="fluent-mdl2:forward" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="text-2xl px-4"
|
||||||
|
on:click={() => {
|
||||||
|
console.log("a");
|
||||||
|
visitURL(url);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Icon icon="tabler:reload" />
|
||||||
|
</button>
|
||||||
|
<div id="urlbar" class="flex items-center flex-1">
|
||||||
|
<div class="text-2xl px-2">
|
||||||
|
<Icon icon="ic:round-search" />
|
||||||
|
</div>
|
||||||
|
<input
|
||||||
|
bind:value={url}
|
||||||
|
type="text"
|
||||||
|
class="flex-1"
|
||||||
|
on:keydown={(e) => {
|
||||||
|
console.log(e);
|
||||||
|
if (e.key === "Enter") {
|
||||||
|
visitURL(url);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="text-2xl pl-3">
|
||||||
|
<Icon icon="ic:round-settings" />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{#if !import.meta.env.VITE_ADRIFT_SINGLEFILE}
|
<!-- {#if !import.meta.env.VITE_ADRIFT_SINGLEFILE}
|
||||||
<div>
|
<div>
|
||||||
<SegmentedButtonContainer>
|
<SegmentedButtonContainer>
|
||||||
<input
|
<input
|
||||||
|
@ -70,7 +115,24 @@
|
||||||
<SegmentedButtonItem input="dynamic">Dynamic</SegmentedButtonItem>
|
<SegmentedButtonItem input="dynamic">Dynamic</SegmentedButtonItem>
|
||||||
</SegmentedButtonContainer>
|
</SegmentedButtonContainer>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if} -->
|
||||||
</div>
|
</div>
|
||||||
<iframe class="h-full w-full" bind:this={proxyIframe} on:load={frameLoad} />
|
<iframe class="flex-1" bind:this={proxyIframe} on:load={frameLoad} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#urlbar {
|
||||||
|
border: solid 0.0625rem rgb(var(--m3-scheme-outline));
|
||||||
|
padding: 0.5rem;
|
||||||
|
border-radius: 0.75rem;
|
||||||
|
}
|
||||||
|
input {
|
||||||
|
background-color: transparent;
|
||||||
|
outline: none;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
iframe {
|
||||||
|
outline: none;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -88,8 +88,20 @@ async function login(credentials: any) {
|
||||||
|
|
||||||
console.log(chalk.blue("Starting server!"));
|
console.log(chalk.blue("Starting server!"));
|
||||||
if (conf.type == "swarm") {
|
if (conf.type == "swarm") {
|
||||||
let trackerws = new WebSocket(tracker.tracker + "/join");
|
let connect = () => {
|
||||||
connectTracker(trackerws);
|
let trackerws = new WebSocket(tracker.tracker + "/join");
|
||||||
|
trackerws.onclose = () => {
|
||||||
|
console.log(`Disconnected from tracker. Retrying...`)
|
||||||
|
setTimeout(() => {
|
||||||
|
connect();
|
||||||
|
}, 10000);
|
||||||
|
};
|
||||||
|
trackerws.onopen = () => {
|
||||||
|
console.log(`Connected to tracker ${tracker.tracker}`)
|
||||||
|
}
|
||||||
|
connectTracker(trackerws);
|
||||||
|
};
|
||||||
|
connect();
|
||||||
} else {
|
} else {
|
||||||
initializeApp(tracker.firebase);
|
initializeApp(tracker.firebase);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue