mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-26 15:02:21 +03:00
great changes
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
{
|
||||
"files": "Input.svelte",
|
||||
"options": {
|
||||
"printWidth": 60
|
||||
"printWidth": 600
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -270,18 +270,41 @@
|
||||
.cards-grid-inline {
|
||||
@apply grid grid-cols-1 justify-items-center;
|
||||
}
|
||||
/*==================================================cards grid=====================================================*/
|
||||
|
||||
/*=============================================card and items inside===============================================*/
|
||||
/* 1. paddig and style for card */
|
||||
.card {
|
||||
@apply w-full p-2 sm:p-2 md:p-2 lg:p-2 xl:px-8 xl:py-4 2xl:px-8 2xl:py-4 bg-white rounded-lg shadow-md lg:shadow-lg;
|
||||
}
|
||||
.card-title-gray {
|
||||
/* 2. style for card header */
|
||||
.card-header-gray {
|
||||
@apply text-center text-lg text-gray-500 font-bold pb-6;
|
||||
}
|
||||
/* md, lg, xl, 2xl, - по центру, sm и меньше - слева */
|
||||
.card-items {
|
||||
@apply items-start sm:items-start md:flex md:items-center lg:items-center xl:items-center 2xl:items-center mb-6;
|
||||
/* 3. card items positioning*/
|
||||
.card-items-psn {
|
||||
@apply flex flex-col sm:flex-row lg:flex-row xl:flex-row 2xl:flex-row mb-6;
|
||||
}
|
||||
.widget-descr-gray {
|
||||
@apply pr-4 text-gray-500 font-bold;
|
||||
.card-items-psn-inline {
|
||||
@apply flex mb-6;
|
||||
}
|
||||
/* 4. widget description width*/
|
||||
.widget-descr-width {
|
||||
@apply w-full sm:w-2/3 lg:w-2/3 xl:w-2/3 2xl:w-2/3;
|
||||
}
|
||||
.widget-descr-width-2-3 {
|
||||
@apply w-2/3;
|
||||
}
|
||||
/* 5. widget descr style*/
|
||||
.widget-descr-style {
|
||||
@apply pr-4 text-gray-500 font-bold;
|
||||
}
|
||||
/* 6. widget width*/
|
||||
.widget-width {
|
||||
@apply w-full sm:w-1/3 lg:w-1/3 xl:w-1/3 2xl:w-1/3;
|
||||
}
|
||||
.widget-width-1-3 {
|
||||
@apply w-1/3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
</script>
|
||||
|
||||
<div class="card">
|
||||
<h1 class="card-title-gray">{title}</h1>
|
||||
<h1 class="card-header-gray">{title}</h1>
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
@@ -6,61 +6,23 @@
|
||||
export let widget;
|
||||
</script>
|
||||
|
||||
<div class="card-items">
|
||||
<div class="w-full md:w-2/3 lg:w-2/3 2xl:w-2/3">
|
||||
<div class="card-items-psn">
|
||||
<div class="widget-descr-width">
|
||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
||||
<label class="widget-descr-gray"
|
||||
>{!widget.descr ? "" : widget.descr}</label>
|
||||
<label class="widget-descr-style">{!widget.descr ? "" : widget.descr}</label>
|
||||
</div>
|
||||
<div class="w-full md:w-1/3 lg:w-1/3 2xl:w-1/3">
|
||||
<div class="widget-width">
|
||||
{#if widget.type == "number"}
|
||||
<input
|
||||
class={widget["send"] == true
|
||||
? "widget-input border-red-500"
|
||||
: "widget-input focus:border-indigo-500"}
|
||||
on:change={() => (
|
||||
(widget["send"] = true),
|
||||
WSpush(widget.ws, widget.topic, widget.status)
|
||||
)}
|
||||
bind:value={widget.status}
|
||||
step="0.1"
|
||||
type="number" />
|
||||
<input class={widget["send"] == true ? "widget-input border-red-500" : "widget-input focus:border-indigo-500"} on:change={() => ((widget["send"] = true), WSpush(widget.ws, widget.topic, widget.status))} bind:value={widget.status} step="0.1" type="number" />
|
||||
{/if}
|
||||
{#if widget.type == "text"}
|
||||
<input
|
||||
class={widget["send"] == true
|
||||
? "widget-input border-red-500"
|
||||
: "widget-input focus:border-indigo-500"}
|
||||
on:change={() => (
|
||||
(widget["send"] = true),
|
||||
WSpush(widget.ws, widget.topic, widget.status)
|
||||
)}
|
||||
bind:value={widget.status}
|
||||
type="text" />
|
||||
<input class={widget["send"] == true ? "widget-input border-red-500" : "widget-input focus:border-indigo-500"} on:change={() => ((widget["send"] = true), WSpush(widget.ws, widget.topic, widget.status))} bind:value={widget.status} type="text" />
|
||||
{/if}
|
||||
{#if widget.type == "date"}
|
||||
<input
|
||||
class={widget["send"] == true
|
||||
? "widget-input border-red-500"
|
||||
: "widget-input focus:border-indigo-500"}
|
||||
on:change={() => (
|
||||
(widget["send"] = true),
|
||||
WSpush(widget.ws, widget.topic, widget.status)
|
||||
)}
|
||||
bind:value={widget.status}
|
||||
type="date" />
|
||||
<input class={widget["send"] == true ? "widget-input border-red-500" : "widget-input focus:border-indigo-500"} on:change={() => ((widget["send"] = true), WSpush(widget.ws, widget.topic, widget.status))} bind:value={widget.status} type="date" />
|
||||
{/if}
|
||||
{#if widget.type == "time"}
|
||||
<input
|
||||
class={widget["send"] == true
|
||||
? "widget-input border-red-500"
|
||||
: "widget-input focus:border-indigo-500"}
|
||||
on:change={() => (
|
||||
(widget["send"] = true),
|
||||
WSpush(widget.ws, widget.topic, widget.status)
|
||||
)}
|
||||
bind:value={widget.status}
|
||||
type="time" />
|
||||
<input class={widget["send"] == true ? "widget-input border-red-500" : "widget-input focus:border-indigo-500"} on:change={() => ((widget["send"] = true), WSpush(widget.ws, widget.topic, widget.status))} bind:value={widget.status} type="time" />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,16 +6,16 @@
|
||||
export let widget;
|
||||
</script>
|
||||
|
||||
<div class="card-items">
|
||||
<div class="w-2/3">
|
||||
<div class="card-items-psn-inline">
|
||||
<div class="widget-descr-width-2-3">
|
||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
||||
<label class="widget-descr-gray">{!widget.descr ? "" : widget.descr}</label>
|
||||
<label class="widget-descr-style">{!widget.descr ? "" : widget.descr}</label>
|
||||
</div>
|
||||
<div class="w-1/3">
|
||||
<div class="widget-width-1-3">
|
||||
<div class="flex items-center justify-center w-full">
|
||||
<label for={widget.topic} class="items-center cursor-pointer">
|
||||
<div class="relative">
|
||||
<input id={widget.topic} type="checkbox" class="sr-only" />
|
||||
<input on:change={() => ((widget["send"] = true), WSpush(widget.ws, widget.topic, widget.status))} bind:value={widget.status} id={widget.topic} 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>
|
||||
|
||||
Reference in New Issue
Block a user