mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-30 20:09:24 +03:00
great changes
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
{
|
{
|
||||||
"files": "Input.svelte",
|
"files": "Input.svelte",
|
||||||
"options": {
|
"options": {
|
||||||
"printWidth": 60
|
"printWidth": 600
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -270,19 +270,42 @@
|
|||||||
.cards-grid-inline {
|
.cards-grid-inline {
|
||||||
@apply grid grid-cols-1 justify-items-center;
|
@apply grid grid-cols-1 justify-items-center;
|
||||||
}
|
}
|
||||||
|
/*==================================================cards grid=====================================================*/
|
||||||
|
|
||||||
|
/*=============================================card and items inside===============================================*/
|
||||||
|
/* 1. paddig and style for card */
|
||||||
.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;
|
@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;
|
@apply text-center text-lg text-gray-500 font-bold pb-6;
|
||||||
}
|
}
|
||||||
/* md, lg, xl, 2xl, - по центру, sm и меньше - слева */
|
/* 3. card items positioning*/
|
||||||
.card-items {
|
.card-items-psn {
|
||||||
@apply items-start sm:items-start md:flex md:items-center lg:items-center xl:items-center 2xl:items-center mb-6;
|
@apply flex flex-col sm:flex-row lg:flex-row xl:flex-row 2xl:flex-row mb-6;
|
||||||
}
|
}
|
||||||
.widget-descr-gray {
|
.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;
|
@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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#menu__toggle {
|
#menu__toggle {
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h1 class="card-title-gray">{title}</h1>
|
<h1 class="card-header-gray">{title}</h1>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,61 +6,23 @@
|
|||||||
export let widget;
|
export let widget;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="card-items">
|
<div class="card-items-psn">
|
||||||
<div class="w-full md:w-2/3 lg:w-2/3 2xl:w-2/3">
|
<div class="widget-descr-width">
|
||||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
<!-- svelte-ignore a11y-label-has-associated-control -->
|
||||||
<label class="widget-descr-gray"
|
<label class="widget-descr-style">{!widget.descr ? "" : widget.descr}</label>
|
||||||
>{!widget.descr ? "" : widget.descr}</label>
|
|
||||||
</div>
|
</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"}
|
{#if widget.type == "number"}
|
||||||
<input
|
<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" />
|
||||||
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}
|
||||||
{#if widget.type == "text"}
|
{#if widget.type == "text"}
|
||||||
<input
|
<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" />
|
||||||
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}
|
||||||
{#if widget.type == "date"}
|
{#if widget.type == "date"}
|
||||||
<input
|
<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" />
|
||||||
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}
|
||||||
{#if widget.type == "time"}
|
{#if widget.type == "time"}
|
||||||
<input
|
<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" />
|
||||||
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}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,16 +6,16 @@
|
|||||||
export let widget;
|
export let widget;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="card-items">
|
<div class="card-items-psn-inline">
|
||||||
<div class="w-2/3">
|
<div class="widget-descr-width-2-3">
|
||||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
<!-- 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>
|
||||||
<div class="w-1/3">
|
<div class="widget-width-1-3">
|
||||||
<div class="flex items-center justify-center w-full">
|
<div class="flex items-center justify-center w-full">
|
||||||
<label for={widget.topic} class="items-center cursor-pointer">
|
<label for={widget.topic} class="items-center cursor-pointer">
|
||||||
<div class="relative">
|
<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="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 class="dot absolute left-1 top-1 bg-white w-6 h-6 rounded-full transition" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user