This commit is contained in:
Dmitry Borisenko
2021-10-19 21:59:48 +08:00
parent 2f7c9f58e4
commit 566b8729c1
4 changed files with 56 additions and 17 deletions

View File

@@ -7,12 +7,12 @@
</script>
<div class="card-items">
<div class="md:w-2/3 lg:w-2/3 2xl:w-2/3">
<div class="w-full md:w-2/3 lg:w-2/3 2xl:w-2/3">
<!-- svelte-ignore a11y-label-has-associated-control -->
<label class="widget-descr-gray-left"
<label class="widget-descr-gray"
>{!widget.descr ? "" : widget.descr}</label>
</div>
<div class="md:w-1/3 lg:w-1/3 2xl:w-1/3">
<div class="w-full md:w-1/3 lg:w-1/3 2xl:w-1/3">
{#if widget.type == "number"}
<input
class={widget["send"] == true

25
src/widgets/Toggle.svelte Normal file
View File

@@ -0,0 +1,25 @@
<script context="module">
import { WSpush } from "../App.svelte";
</script>
<script>
export let widget;
</script>
<div class="card-items">
<div class="w-2/3">
<!-- svelte-ignore a11y-label-has-associated-control -->
<label class="widget-descr-gray">{!widget.descr ? "" : widget.descr}</label>
</div>
<div class="w-1/3">
<div class="flex items-center justify-center w-full">
<label for="toggleB" class="items-center cursor-pointer">
<div class="relative">
<input id="toggleB" type="checkbox" class="sr-only" />
<div class="block bg-gray-600 w-14 h-8 rounded-full" />
<div class="dot absolute left-1 top-1 bg-white w-6 h-6 rounded-full transition" />
</div>
</label>
</div>
</div>
</div>