Entropy, not bubble!

This commit is contained in:
Jorge Manrubia
2025-06-05 10:33:02 +02:00
parent 22ed605884
commit 76119b17bd
2 changed files with 7 additions and 7 deletions
@@ -4,7 +4,7 @@ import { signedDifferenceInDays } from "helpers/date_helpers"
const REFRESH_INTERVAL = 3_600_000 // 1 hour (in milliseconds)
export default class extends Controller {
static targets = [ "bubbleTop", "bubbleDays", "bubbleBottom" ]
static targets = [ "entropy", "entropyTop", "entropyDays", "entropyBottom" ]
static values = { entropy: Object }
#timer
@@ -26,9 +26,9 @@ export default class extends Controller {
return
}
this.bubbleTopTarget.innerHTML = closesInDays < 1 ? this.entropyValue.action : `${this.entropyValue.action} in`
this.bubbleDaysTarget.innerHTML = closesInDays < 1 ? "!" : closesInDays
this.bubbleBottomTarget.innerHTML = closesInDays < 1 ? "Today" : (closesInDays === 1 ? "day" : "days")
this.entropyTopTarget.innerHTML = closesInDays < 1 ? this.entropyValue.action : `${this.entropyValue.action} in`
this.entropyDaysTarget.innerHTML = closesInDays < 1 ? "!" : closesInDays
this.entropyBottomTarget.innerHTML = closesInDays < 1 ? "Today" : (closesInDays === 1 ? "day" : "days")
this.#show()
}