From 53d5673df954d77cf29627e809baf57f5741baec Mon Sep 17 00:00:00 2001 From: supercolbat Date: Sat, 5 Aug 2023 01:17:39 -0500 Subject: [PATCH 01/15] Add NixOS flake --- flake.lock | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 26 +++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8e20e32 --- /dev/null +++ b/flake.lock @@ -0,0 +1,76 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1691209513, + "narHash": "sha256-V8e6wywJ34DgwP4sDSWpHMPx3OC+k1l/xPSQTfdPj5U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "cc0e47cd36a2d6815eba5abf3317e519abd35571", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "systems": "systems_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..890d4aa --- /dev/null +++ b/flake.nix @@ -0,0 +1,26 @@ +{ + inputs.nixpkgs.url = "github:NixOS/nixpkgs/master"; + inputs.systems.url = "github:nix-systems/default"; + + outputs = { + self, + nixpkgs, + flake-utils, + systems, + }: + flake-utils.lib.eachSystem (import systems) + (system: let + pkgs = import nixpkgs { + inherit system; + }; + in { + devShells.default = pkgs.mkShell { + buildInputs = [ + pkgs.nodejs + + # Package manager + pkgs.nodePackages.pnpm + ]; + }; + }); +} From 5814f14c71d9bc55538eb994f4548d490694774b Mon Sep 17 00:00:00 2001 From: supercolbat Date: Sat, 5 Aug 2023 01:57:08 -0500 Subject: [PATCH 02/15] Change short URL toggle and No-JS support --- src/routes/instances/+page.server.ts | 12 +- src/routes/instances/+page.svelte | 157 +++++++++++++++------------ 2 files changed, 97 insertions(+), 72 deletions(-) diff --git a/src/routes/instances/+page.server.ts b/src/routes/instances/+page.server.ts index e32e8aa..05dff70 100644 --- a/src/routes/instances/+page.server.ts +++ b/src/routes/instances/+page.server.ts @@ -1,10 +1,18 @@ import instances from "./instances"; import type { PageServerLoad } from "./$types"; -export const load = (() => { +export const load = (({ url }) => { const meta = { title: "Instances" }; - return { instances, ...meta }; + // If the ?short url query exists, then longUrl is false + // Every other case is true + const queryLongUrl = !url.searchParams.has("short"); + + return { + instances, + queryLongUrl, + ...meta + }; }) satisfies PageServerLoad; diff --git a/src/routes/instances/+page.svelte b/src/routes/instances/+page.svelte index d628a77..bad8e74 100644 --- a/src/routes/instances/+page.svelte +++ b/src/routes/instances/+page.svelte @@ -3,95 +3,112 @@ export let data: PageData; - let insturl: "short" | "long"; + $: longUrl = data.queryLongUrl; + let toggle = () => { - insturl = insturl === "long" ? "short" : "long"; + longUrl = !longUrl; }; - insturl = "long";
{data.title} + +
Advanced - - - + + +