|
| 1 | +# Algal Bloom Update Widget |
| 2 | +South Australia is experiencing a toxic algal bloom caused by Karenia species. While some blooms are harmless, this one can affect fish and other marine life. |
| 3 | + |
| 4 | +The bloom has been driven by a mix of factors, including river floodwaters adding nutrients, summer upwellings bringing nutrients to the surface, and warmer-than-normal ocean temperatures. Climate change has likely made these conditions more favourable. |
| 5 | + |
| 6 | +Algal blooms are complex and evolve over time. Scientists are studying this bloom to improve early detection and monitoring. |
| 7 | + |
| 8 | +This Glance` widget displays the latest algal bloom information for a selected beach using data from [Beachsafe](https://beachsafe.org.au). |
| 9 | + |
| 10 | +## Features |
| 11 | + |
| 12 | +- Shows whether the beach has been cleaned. |
| 13 | +- Indicates the presence of abnormal foam. |
| 14 | +- Indicates abnormal water colour in the water. |
| 15 | +- Last update timestamp displayed dynamically using relative time. |
| 16 | +- Colour-coded indicators for easy visual recognition: |
| 17 | + - **Positive (green)**: Good conditions |
| 18 | + - **Negative (red)**: Potential issues |
| 19 | + |
| 20 | +> [!NOTE] |
| 21 | +> Use the developer tools inside your browser of choice to get the api endpoint for your beach. |
| 22 | +
|
| 23 | +## Preview |
| 24 | + |
| 25 | + |
| 26 | +## Widget YAML |
| 27 | + |
| 28 | +```yaml |
| 29 | +- type: custom-api |
| 30 | + title: Algal Bloom Update |
| 31 | + url: https://beachsafe.org.au/api/v4/beach/brighton-3 |
| 32 | + method: GET |
| 33 | + headers: |
| 34 | + "User-Agent": Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 |
| 35 | + template: | |
| 36 | + {{ $b := .JSON }} |
| 37 | + <div class="size-h3">{{ $b.String "beach.title" }}</div> |
| 38 | + <div>Updated <span {{ $b.String "beach.algal_bloom.updated_at" | parseTime "rfc3339" | toRelativeTime }}></span> ago</div><br> |
| 39 | + <div class="size-h4 color-{{ if $b.Bool "beach.algal_bloom.clean_rating" }}positive{{ else }}negative{{ end }}"> |
| 40 | + Beach cleaned: {{ if $b.Bool "beach.algal_bloom.clean_rating" }}Yes{{ else }}No{{ end }} |
| 41 | + </div> |
| 42 | + <div class="size-h4 color-{{ if $b.Bool "beach.algal_bloom.beach_foam" }}negative{{ else }}positive{{ end }}"> |
| 43 | + Abnormal foam: {{ if $b.Bool "beach.algal_bloom.beach_foam" }}Yes{{ else }}No{{ end }} |
| 44 | + </div> |
| 45 | + <div class="size-h4 color-{{ if $b.Bool "beach.algal_bloom.water_discolour" }}negative{{ else }}positive{{ end }}"> |
| 46 | + Abnormal water colour: {{ if $b.Bool "beach.algal_bloom.water_discolour" }}Yes{{ else }}No{{ end }} |
| 47 | + </div> |
0 commit comments