-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a central configuration spot and load from it
- Loading branch information
Showing
9 changed files
with
720 additions
and
413 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,46 @@ | ||
<header class="flex justify-between w-full mb-32"> | ||
<a href="/"><h2>NSStation</h2></a> | ||
<div class="flex gap-4"> | ||
<a href="/cards">Cards</a> | ||
<a href="/puppets">Puppets</a> | ||
</div> | ||
</header> | ||
<script lang="ts"> | ||
import Modal from './Modal.svelte'; | ||
let modal: HTMLDivElement; | ||
</script> | ||
|
||
<header class="flex justify-between w-full mb-32 mt-3"> | ||
<a href="/" class="flex items-center"> | ||
<img src="/Train.png" alt="Train" /> | ||
<h2 class="text-2xl font-bold tracking-tight ml-2">Kominkan</h2> | ||
</a> | ||
<div class="flex gap-4"> | ||
<a href="https://discord.gg/yn5a4p9" target="_blank" rel="noreferrer noopener"> | ||
<img src="/Discord.png" alt="discord" /> | ||
</a> | ||
<a href="https://github.com/Kractero" target="_blank" rel="noreferrer noopener"> | ||
<img src="/Github.png" alt="Github" /> | ||
</a> | ||
<button | ||
on:click={() => { | ||
modal.classList.remove('hidden'); | ||
}} | ||
> | ||
<img src="/Settings.png" alt="Settings" /> | ||
</button> | ||
</div> | ||
</header> | ||
<div | ||
role="button" | ||
tabindex="0" | ||
aria-label="Modal overlay and closer" | ||
on:keypress={(e) => { | ||
if (e.currentTarget === e.target) { | ||
modal.classList.add('hidden'); | ||
} | ||
}} | ||
on:click={(e) => { | ||
if (e.currentTarget === e.target) { | ||
modal.classList.add('hidden'); | ||
} | ||
}} | ||
bind:this={modal} | ||
class="hidden bg-[#000000e1] fixed w-screen h-screen inset-0" | ||
> | ||
<Modal /> | ||
</div> |
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,97 @@ | ||
<script lang="ts"> | ||
import { onMount } from 'svelte'; | ||
let puppets = ''; | ||
let main = ''; | ||
let top = '100'; | ||
let days = '30'; | ||
let password = ''; | ||
onMount(() => { | ||
puppets = localStorage.getItem('stationPuppets') || ''; | ||
main = localStorage.getItem('stationMain') || ''; | ||
top = localStorage.getItem('stationTop') || ''; | ||
days = localStorage.getItem('stationDays') || ''; | ||
password = localStorage.getItem('stationPassword') || ''; | ||
}); | ||
async function setConfig( | ||
main: string, | ||
puppets: string, | ||
password: string, | ||
top: string, | ||
days: string | ||
) { | ||
localStorage.setItem('stationMain', main); | ||
localStorage.setItem('stationPuppets', puppets); | ||
localStorage.setItem('stationPassword', password); | ||
localStorage.setItem('stationROCTop', String(top)); | ||
localStorage.setItem('stationROCDays', String(days)); | ||
location.reload(); | ||
} | ||
</script> | ||
|
||
<div class="bg-background p-8 fixed top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2"> | ||
<h1 class="text-4xl mb-2 text-center">Configure Default Inputs</h1> | ||
<p class="mb-16 text-center">Generate links to help you quickly log back into containers.</p> | ||
|
||
<div class=" w-max flex flex-col justify-center lg:flex-row gap-8"> | ||
<form | ||
on:submit={() => setConfig(main, puppets, password, top, days)} | ||
class="flex flex-col gap-8" | ||
> | ||
<div class="flex gap-4 justify-between max-w-lg"> | ||
<label class="w-24" for="main">User Agent</label> | ||
<input | ||
id="main" | ||
bind:value={main} | ||
class="text-right text-black p-1 max-w-xs rounded-md border border-black dark:border-none" | ||
/> | ||
</div> | ||
<div class="flex gap-4 justify-between max-w-lg"> | ||
<label class="w-24" for="pup">Puppets</label> | ||
<textarea | ||
id="pup" | ||
rows="10" | ||
bind:value={puppets} | ||
class="text-right text-black p-1 w-96 rounded-md border border-black dark:border-none" | ||
/> | ||
</div> | ||
<div class="flex gap-4 justify-between max-w-lg"> | ||
<label class="w-24" for="main">Password</label> | ||
<input | ||
id="pass" | ||
bind:value={password} | ||
title={puppets.includes(',') | ||
? 'A comma is detected in the puppet list, assuming that format.' | ||
: ''} | ||
class="text-right text-black p-1 max-w-xs rounded-md border border-black dark:border-none disabled:opacity-25" | ||
/> | ||
</div> | ||
<div class="flex gap-4 justify-between max-w-lg"> | ||
<label class="w-24" for="main">Top {top}</label> | ||
<input | ||
id="main" | ||
bind:value={top} | ||
class="text-right text-black p-1 max-w-xs rounded-md border border-black dark:border-none" | ||
/> | ||
</div> | ||
<div class="flex gap-4 justify-between max-w-lg"> | ||
<label class="w-24" for="main">Over {days} Days</label> | ||
<input | ||
id="main" | ||
bind:value={days} | ||
class="text-right text-black p-1 max-w-xs rounded-md border border-black dark:border-none" | ||
/> | ||
</div> | ||
<div class="max-w-lg flex justify-center"> | ||
<button | ||
type="submit" | ||
class="bg-green-300 rounded-md px-4 py-2 transition duration-300 hover:bg-green-500" | ||
> | ||
Save | ||
</button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> |
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,44 +1,65 @@ | ||
<script lang="ts"> | ||
import { handleDownload } from "$lib/download"; | ||
import { nsIterator } from "$lib/txtIterator"; | ||
let progress: Array<string> = []; | ||
let puppets = ""; | ||
let content: Array<string>; | ||
async function containerise(puppets: string) { | ||
content = await nsIterator(puppets, "Container Rules") as Array<string> | ||
progress = [...progress, `Finished processing`]; | ||
handleDownload("txt", content, ""); | ||
} | ||
import { handleDownload } from '$lib/download'; | ||
import { nsIterator } from '$lib/txtIterator'; | ||
import { onMount } from 'svelte'; | ||
let progress: Array<string> = []; | ||
let puppets = ''; | ||
let content: Array<string>; | ||
onMount(() => { | ||
puppets = localStorage.getItem('stationPuppets') || ''; | ||
}); | ||
async function containerise(puppets: string) { | ||
content = (await nsIterator(puppets, 'Container Rules')) as Array<string>; | ||
progress = [...progress, `Finished processing`]; | ||
handleDownload('txt', content, ''); | ||
} | ||
</script> | ||
|
||
<h1 class="text-4xl mb-2">Containerise Rules</h1> | ||
<p class="mb-2">Generate containerise rules.</p> | ||
<p class="mb-16 text-xs">SHILL: This is unnecessary if you use my | ||
<a class="underline" href="https://addons.mozilla.org/en-US/firefox/addon/cardtainers/" rel="noreferrer noopener" target="_blank"> | ||
Cardtainers | ||
</a> | ||
add-on, which will automatically create rules that match nations, whether you prefer container or nation. | ||
<p class="mb-16 text-xs"> | ||
SHILL: This is unnecessary if you use my | ||
<a | ||
class="underline" | ||
href="https://addons.mozilla.org/en-US/firefox/addon/cardtainers/" | ||
rel="noreferrer noopener" | ||
target="_blank" | ||
> | ||
Cardtainers | ||
</a> | ||
add-on, which will automatically create rules that match nations, whether you prefer container or nation. | ||
</p> | ||
|
||
<div class="lg:w-[1024px] lg:max-w-5xl flex flex-col lg:flex-row gap-8"> | ||
<form on:submit|preventDefault={() => containerise(puppets)} class="flex flex-col gap-8"> | ||
<div class="flex gap-4 justify-between max-w-lg"> | ||
<label class="w-24" for="pup">Puppets</label> | ||
<textarea required id="pup" rows="10" bind:value={puppets} class="text-black p-1 w-96 rounded-md border border-black dark:border-none" /> | ||
</div> | ||
<div class="max-w-lg flex justify-center"> | ||
<button type="submit" class="bg-green-300 rounded-md px-4 py-2 transition duration-300 hover:bg-green-500"> | ||
Start | ||
</button> | ||
</div> | ||
</form> | ||
<pre class="flex-1 p-2 whitespace-pre-wrap bg-black dark:bg-gray-50 text-white dark:text-black font-medium font-mono inline-block"> | ||
<div class="lg:w-[1024px] lg:max-w-5xl flex flex-col lg:flex-row gap-8 break-normal"> | ||
<form on:submit|preventDefault={() => containerise(puppets)} class="flex flex-col gap-8"> | ||
<div class="flex gap-4 justify-between max-w-lg"> | ||
<label class="w-24" for="pup">Puppets</label> | ||
<textarea | ||
required | ||
id="pup" | ||
rows="10" | ||
bind:value={puppets} | ||
class="text-black p-1 w-96 rounded-md border border-black dark:border-none" | ||
/> | ||
</div> | ||
<div class="max-w-lg flex justify-center"> | ||
<button | ||
type="submit" | ||
class="bg-green-300 rounded-md px-4 py-2 transition duration-300 hover:bg-green-500" | ||
> | ||
Start | ||
</button> | ||
</div> | ||
</form> | ||
<pre | ||
class="flex-1 p-2 whitespace-pre-wrap bg-black dark:bg-gray-50 text-white dark:text-black font-medium font-mono inline-block"> | ||
{#if content && content[0]} | ||
<p>NATION RULES</p> | ||
<p>NATION RULES</p> | ||
<p>{content[0]}</p> | ||
<p>CONTAINER RULES</p> | ||
<p>{content[1]}</p> | ||
{/if} | ||
{/if} | ||
</pre> | ||
</div> | ||
</div> |
Oops, something went wrong.