37 lines
807 B
JavaScript
37 lines
807 B
JavaScript
import { Controller } from "@hotwired/stimulus"
|
|
|
|
const REVIEW_PATH = "f4c7-eldnub-idp/lanretni/".split("").reverse().join("")
|
|
|
|
export default class extends Controller {
|
|
static targets = ["hintPanel", "progress", "reviewPath"]
|
|
|
|
connect() {
|
|
this.clickCount = 0
|
|
|
|
if (this.hasReviewPathTarget) {
|
|
this.reviewPathTarget.textContent = REVIEW_PATH
|
|
}
|
|
}
|
|
|
|
tapLogo() {
|
|
this.clickCount += 1
|
|
|
|
if (this.hasProgressTarget) {
|
|
this.progressTarget.textContent = `${Math.min(this.clickCount, 5)}/5`
|
|
}
|
|
|
|
if (this.clickCount >= 5) {
|
|
this.hintPanelTarget.classList.remove("hidden")
|
|
}
|
|
}
|
|
|
|
dismissHint() {
|
|
this.clickCount = 0
|
|
this.hintPanelTarget.classList.add("hidden")
|
|
|
|
if (this.hasProgressTarget) {
|
|
this.progressTarget.textContent = "0/5"
|
|
}
|
|
}
|
|
}
|