Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="HandheldFriendly" content="true" />
<link rel="apple-touch-icon" sizes="180x180" href="%sveltekit.assets%/icons/logo_180.png?v=1">
<link rel="icon" type="image/png" sizes="32x32" href="%sveltekit.assets%/icons/logo_32.png?v=1">
<link rel="icon" type="image/png" sizes="16x16" href="%sveltekit.assets%/icons/logo_16.png?v=1">
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/rules/Rules.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<TextField label={$_('rules.ruleName')} id="name" name="name" required bind:value={ruleGroup.ruleName} />
</div>

<div class="m-4">
<div class="m-2">
<p class="text-surface-100">{$_('rules.rule_criteria')}:</p>
{#await dataItem}
loading data items
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ui/DarkCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
}
</script>
<div class="bg-[#34393f] bg-opacity-50 rounded-xl py-5 px-6 text-surface-100 my-3">
<div class="bg-[#34393f] bg-opacity-50 rounded-xl py-5 px-2 text-surface-100 my-3">
{#if title}
<div class="flex justify-between items-center">
<p class="text-lg">{title}</p>
Expand Down
20 changes: 10 additions & 10 deletions src/lib/components/ui/TestCompas.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import { onMount, afterUpdate } from 'svelte';
import * as d3 from 'd3';

export let temperature;
export let humidity;
export let temperature: number;
export let humidity: number;
export let windDirection = 'N';
export let windSpeed = 0;
export let arrowRotation = 0;

let svgContainer;
let arrow;
let svgContainer: SVGSVGElement;
let arrow: SVGSVGElement;

onMount(() => {
drawGauge();
Expand Down Expand Up @@ -77,7 +77,7 @@
.attr('y', y)
.attr('text-anchor', 'middle')
.attr('dominant-baseline', 'middle')
.attr('font-size', '14px')
.attr('font-size', '16px')
.attr('font-weight', 'bold')
.attr('fill', i % 2 === 0 ? '#555' : '#999') // Darker for cardinal directions
.text(dir);
Expand Down Expand Up @@ -132,26 +132,26 @@

// Draw the wind speed text
svg.append('text')
.attr('y', -5)
.attr('y', 8)
.attr('text-anchor', 'middle')
.attr('font-size', '20px')
.attr('font-size', '30px')
.attr('font-weight', 'bold')
.text(`${(windSpeed * 3.6).toFixed(2)} km/h`);

// Draw the wind direction text
svg.append('text')
.attr('y', -35)
.attr('text-anchor', 'middle')
.attr('font-size', '16px')
.attr('font-size', '25px')
.attr('font-weight', 'bold')
.html(`<tspan fill="green">${windDirection}</tspan>`);
// .text(windDirection);

// Draw the temperature and humidity text
svg.append('text')
.attr('y', 25)
.attr('y', 50)
.attr('text-anchor', 'middle')
.attr('font-size', '17px')
.attr('font-size', '20px')
.attr('font-weight', 'bold')
.html(`<tspan fill="coral">${temperature}°C</tspan> / <tspan fill="teal">${humidity}% RH</tspan>`);

Expand Down
22 changes: 7 additions & 15 deletions src/lib/components/ui/sensors/SEEED_S2103.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -307,20 +307,20 @@
{/if}
</div>
</DarkCard2>
<DarkCard2>
<DarkCard title="Wind Speed/Direction">
<TestCompas {temperature} {windSpeed} {windDirection} {arrowRotation} {humidity} />
</DarkCard2>
<DarkCard2>
</DarkCard>
<DarkCard title="UV/LUX">
<div class="grid grid-flow-col grid-cols-2 gap-5 lg:items-center">
<UvIndex {uvIndex} uvLevel={uvIndexText} />
<LuxGuage {luxValue} />
</div>
</DarkCard2>
<DarkCard2>
</DarkCard>
<DarkCard title="Rainfall/Pressure">
<div class="flex flex-row w-full justify-center">
<RainPerHourGuage {rainValue} {pressureValue} />
</div>
</DarkCard2>
</DarkCard>
<DarkCard title={$_('temp_humidity')}>
<div class="chart" use:Highcharts={config} />
<DarkCard
Expand All @@ -341,16 +341,8 @@
unit="ºC"
/>
</DarkCard>
<DarkCard title="{$_('rainfall')} mm/h" value={null} optimalValue={null} unit={null}>
<DarkCard title="{$_('rainfall')} mm/h" value={data.reduce((sum, item) => sum + item.rainfall, 0).toFixed(2)} optimalValue={null} unit={'mm/day'}>
<div class="chart" use:Highcharts={rainBarChartConfig} />
<h2 class="text-lg">
Total: {data.reduce((sum, item) => sum + item.rainfall, 0).toFixed(2)} mm
</h2>
<DarkCard
title="Total Rainfall:"
value={data.reduce((sum, item) => sum + item.rainfall, 0).toFixed(2)}
unit=" mm/day"
/>
<DarkCard
title="Max Rainfall:"
value={Math.max(...data.map((periodData) => periodData.rainfall)).toFixed(2)}
Expand Down