Privacywonk / MMM-Surf

MagicMirror module that pulls in tide, water temp, and Magicseaweed data to show an at-a-glance surf report for your favorite spot.
Other
5 stars 2 forks source link

Animate current tide status with icons #32

Closed Privacywonk closed 6 years ago

Privacywonk commented 6 years ago

Based on the this.deltaPerc variable which calculates where the tide is in its ebb or flow, show a specific tide icon. Works for both Low and High tide.

                if (this.DeltaPerc >= 0 && this.DeltaPerc <= 33) {
                        TideIcon.innerHTML = "<img src='./modules/MMM-Surf/img/" + this.TideTypeCurrent + "Tide1.png" + "'>";}
                if (this.DeltaPerc >= 34 && this.DeltaPerc <= 66) {
                        TideIcon.innerHTML = "<img src='./modules/MMM-Surf/img/" + this.TideTypeCurrent + "Tide2.png" + "'>";}
                if (this.DeltaPerc >= 67) {
                        TideIcon.innerHTML = "<img src='./modules/MMM-Surf/img/" + this.TideTypeCurrent + "Tide3.png" + "'>";}