2 import { coordinateLength } from '$lib/config';
3 import { sensor } from '$lib/stores/widgets';
4 import { maxSize } from '$lib/config';
6 const isActive = function isActive($s, x, y) {
7 const isXActive = $s.left > x * maxSize && $s.left < (x + 1) * maxSize;
8 const isYActive = $s.top > y * maxSize && $s.top < (y + 1) * maxSize;
9 return isXActive || isYActive;
16 <td class="{isActive($sensor, -1,-1) ? 'active' : ''}"></td>
17 <td class="{isActive($sensor, 0,-1) ? 'active' : ''}"></td>
18 <td class="{isActive($sensor, 1,-1) ? 'active' : ''}"></td>
21 <td class="{isActive($sensor, -1,0) ? 'active' : ''}"></td>
22 <td class="{isActive($sensor, 0,0) ? 'active' : ''}"></td>
23 <td class="{isActive($sensor, 1,0) ? 'active' : ''}"></td>
26 <td class="{isActive($sensor, -1,1) ? 'active' : ''}"></td>
27 <td class="{isActive($sensor, 0,1) ? 'active' : ''}"></td>
28 <td class="{isActive($sensor, 1,1) ? 'active' : ''}"></td>
35 background-color: #fff;
41 -webkit-font-smoothing : none;
47 border: 1px solid black;
51 background-color: magenta;