# CSS Challenge: Water Tank SVG Mask

**URL:** https://discourse.nodered.org/t/css-challenge-water-tank-svg-mask/90091
**Category:** Dashboard
**Tags:** dashboard-2
**Created:** [10 August 2024 10:25 UTC](https://discourse.nodered.org/t/css-challenge-water-tank-svg-mask/90091 "2024-08-10T10:25:53Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [10 August 2024 10:25 UTC](https://discourse.nodered.org/t/css-challenge-water-tank-svg-mask/90091/1 "2024-08-10T10:25:53Z")

</div>

Hey All, had a play this morning in adding a "Water Tank" to the `ui-gauge` in Dashboard 2.0 (having also recently added a [Battery Gauge](https://github.com/FlowFuse/node-red-dashboard/pull/1169)) - you can see the PR (and a little video demo) [here](https://github.com/FlowFuse/node-red-dashboard/pull/1194)

 ![Screenshot 2024-08-10 at 11.24.35](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/b/0b0b6d241dbb9fdf4aa1eb0bcde7bfca0113da6e.png)

The challenge I've got is applying an SVG `clip-path` to the text that considers both the waves _and_ the general fill. I've currently got them as two entities, thinking I may need to modify the SVG wave to animate in height as a single entity, rather than having the `<rect>` _and_ the `<path>`

 ![Screenshot 2024-08-10 at 11.26.16](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/d/fdeee3c222db79eb10db175ef775139aecaed8d2.png)

If anyone fancies a play before I come back to this on Tuesday, please feel free to fork/PR! All help is very much appreciated.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [10 August 2024 10:46 UTC](https://discourse.nodered.org/t/css-challenge-water-tank-svg-mask/90091/2 "2024-08-10T10:46:25Z")

</div>

How do we install these [future] gauge types?

```auto
npm install @flowfuse/node-red-dashboard@next
npm error code ETARGET
npm error notarget No matching version found for @flowfuse/node-red-dashboard@next.

```

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [10 August 2024 10:59 UTC](https://discourse.nodered.org/t/css-challenge-water-tank-svg-mask/90091/3 "2024-08-10T10:59:00Z")

</div>

> **[Contributing | Node-RED Dashboard 2.0](https://dashboard.flowfuse.com/contributing/#clone-build-the-repository)**
>
> Join the development of Node-RED Dashboard 2.0. Learn how you can contribute to making it better for everyone.

You need to clone/install the source from GitHub, as its not published to npm anywhere at the moment

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [10 August 2024 11:35 UTC](https://discourse.nodered.org/t/css-challenge-water-tank-svg-mask/90091/4 "2024-08-10T11:35:42Z")

</div>

Thanks for the link.

It looked complicated but I tried.  
Unfortunately `npm run build` died out of memory (a Pi 4 with 2GB).

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [10 August 2024 12:03 UTC](https://discourse.nodered.org/t/css-challenge-water-tank-svg-mask/90091/5 "2024-08-10T12:03:56Z")

</div>

I'd expect to not need _that_ much, but the development version is certainly more computationally expensive than our released builds

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [10 August 2024 12:28 UTC](https://discourse.nodered.org/t/css-challenge-water-tank-svg-mask/90091/6 "2024-08-10T12:28:13Z")

</div>

I uninstalled zram (which uses some memory as RAM based swap space), then it compiled.

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [10 August 2024 12:36 UTC](https://discourse.nodered.org/t/css-challenge-water-tank-svg-mask/90091/7 "2024-08-10T12:36:05Z")

</div>

To get the water tank you'll need to switch to the `1192-gauge-water-tank` branch linked to the PR, then `npm run build` and it'll be in there.

Anytime you're changing the source CSS/Vue, just need to re-build, and itll update on your Dashboard.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [10 August 2024 12:40 UTC](https://discourse.nodered.org/t/css-challenge-water-tank-svg-mask/90091/8 "2024-08-10T12:40:33Z")

</div>

> [@joepavitt](#):
>
> Anytime you're changing the source CSS/Vue, just need to re-build, and itll update on your Dashboard.

👍🏽

I am initially looking at the battery gauge with the aim of making the colour continuously variable

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [10 August 2024 13:33 UTC](https://discourse.nodered.org/t/css-challenge-water-tank-svg-mask/90091/9 "2024-08-10T13:33:25Z")

</div>

> [@joepavitt](#):
>
> If anyone fancies a play before I come back to this on Tuesday, please feel free to fork/PR! All help is very much appreciated.

It might be useful to mention @hotNipi, unless he is currently buried somewhere partially intoxicated with alcohol on a beach of some tropical island 🌴 🏖 🥂

---

<div class="post-metadata">

### Author: ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)
#### Post date: [10 August 2024 13:51 UTC](https://discourse.nodered.org/t/css-challenge-water-tank-svg-mask/90091/10 "2024-08-10T13:51:28Z")

</div>

I'm nearby. Vacation just started. This means grandchildren and that long list of activities which I refused to read to the end. So the CSS has currently priority order `Number.MIN_SAFE_INTEGER`

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [11 August 2024 07:43 UTC](https://discourse.nodered.org/t/css-challenge-water-tank-svg-mask/90091/11 "2024-08-11T07:43:57Z")

</div>

Spent another 6-7 hours on this, finally got it working, and the wave mask then makes the number very difficult to read - abandoning and just rendering in black 😃

---

<div class="post-metadata">

### Author: ![mellerbeck](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@mellerbeck](https://discourse.nodered.org/u/mellerbeck)
#### Post date: [15 August 2024 22:45 UTC](https://discourse.nodered.org/t/css-challenge-water-tank-svg-mask/90091/12 "2024-08-15T22:45:05Z")

</div>

the wave mask was cool looking..... but visibility trumps cool

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [29 August 2024 22:45 UTC](https://discourse.nodered.org/t/css-challenge-water-tank-svg-mask/90091/13 "2024-08-29T22:45:41Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
