From a8b44b09a404aee477e735501b828d1b14aad311 Mon Sep 17 00:00:00 2001
From: ivarlovlie <git@ivarlovlie.no>
Date: Tue, 7 Jun 2022 01:33:52 +0200
Subject: feat: Add inital translation support

---
 .../src/components/blowout-toolbelt.svelte         | 60 ++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 apps/web-shared/src/components/blowout-toolbelt.svelte

(limited to 'apps/web-shared/src/components/blowout-toolbelt.svelte')

diff --git a/apps/web-shared/src/components/blowout-toolbelt.svelte b/apps/web-shared/src/components/blowout-toolbelt.svelte
new file mode 100644
index 0000000..69e9902
--- /dev/null
+++ b/apps/web-shared/src/components/blowout-toolbelt.svelte
@@ -0,0 +1,60 @@
+<script>
+	import {createEventDispatcher} from "svelte";
+	import ThemeSwitcher from "./theme-switcher.svelte";
+	import ThemeSwitcherIcon from "./theme-switcher-icon.svelte";
+	import LocaleSwitcher from "./locale-switcher.svelte";
+	import LocaleSwitcherIcon from "./locale-switcher-icon.svelte";
+	import {ChevronsRightIcon, ChevronsLeftIcon} from "svelte-feather-icons";
+    
+	const dispatch = createEventDispatcher();
+	
+	function locale_change(event) {
+		dispatch("change", {name: "locale", value: event.detail})
+    }
+	
+	let expanded = false;
+	const localeSwitcher = {
+		show: false,
+		selection: "preffered"
+	};
+	
+	const themeSwitcher = {
+		show: false,
+		selection: "system"
+	};
+</script>
+<style>
+    .blowout {
+        right: -80px;
+    }
+
+    .expanded {
+        right: 0 !important;
+    }
+</style>
+<aside class="blowout position-fixed bg-light inner-glow shadow-xs padding-xxs bottom-50% right-0 z-index-2 {expanded ? 'expanded' : ''}">
+    <LocaleSwitcher bind:show="{localeSwitcher.show}"
+                    glow="{false}"
+                    on:change={locale_change}
+                    bind:selection="{localeSwitcher.selection}"/>
+    <ThemeSwitcher bind:show="{themeSwitcher.show}"
+                   glow="{false}"
+                   bind:selection="{themeSwitcher.selection}"/>
+    <div class="flex flex-row gap-sm justify-end">
+        {#if !expanded}
+            <div class="flex ld-switch-btn"
+                 on:click={() => expanded = true}>
+                <ChevronsLeftIcon/>
+            </div>
+        {:else}
+            <div class="flex ld-switch-btn"
+                 on:click={() => expanded = false}>
+                <ChevronsRightIcon/>
+            </div>
+        {/if}
+        <LocaleSwitcherIcon bind:show="{localeSwitcher.show}"
+                            bind:selection="{localeSwitcher.selection}"/>
+        <ThemeSwitcherIcon bind:show="{themeSwitcher.show}"
+                           bind:selection="{themeSwitcher.selection}"/>
+    </div>
+</aside>
-- 
cgit v1.3

