mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-12 22:00:02 -04:00
add dynamic
This commit is contained in:
parent
ebe1f18b68
commit
f5e0c4202e
20 changed files with 1782 additions and 252 deletions
|
@ -28,6 +28,8 @@
|
|||
|
||||
let ready = false;
|
||||
|
||||
let dynamic = false;
|
||||
|
||||
let url: string;
|
||||
let proxyIframe: HTMLIFrameElement;
|
||||
|
||||
|
@ -126,7 +128,9 @@
|
|||
|
||||
function visitURL(url: string) {
|
||||
if (!import.meta.env.VITE_ADRIFT_SINGLEFILE) {
|
||||
let path = `${__uv$config.prefix}${__uv$config.encodeUrl(url)}`;
|
||||
let path =
|
||||
(dynamic && `/service/route?url=${url}`) ||
|
||||
`${__uv$config.prefix}${__uv$config.encodeUrl(url)}`;
|
||||
proxyIframe.src = path;
|
||||
} else {
|
||||
let bare = new BareClient();
|
||||
|
@ -152,9 +156,15 @@
|
|||
|
||||
{#if ready}
|
||||
<div class="container h-full w-full">
|
||||
<div class="container">
|
||||
<input bind:value={url} type="text" />
|
||||
<button on:click={() => visitURL(url)}>Go!</button>
|
||||
<div class="flex">
|
||||
<div class="container">
|
||||
<input bind:value={url} type="text" />
|
||||
<button on:click={() => visitURL(url)}>Go!</button>
|
||||
</div>
|
||||
<div class="container">
|
||||
<label>use dynamic?</label>
|
||||
<input type="checkbox" bind:value={dynamic} />
|
||||
</div>
|
||||
</div>
|
||||
<iframe class="h-full w-full" bind:this={proxyIframe} on:load={frameLoad} />
|
||||
</div>
|
||||
|
@ -180,6 +190,9 @@
|
|||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
iframe {
|
||||
outline: none;
|
||||
border: none;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue