Skip to content

Commit

Permalink
Persists last played custom frequency in localStorage.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoluteur committed Feb 13, 2024
1 parent 3ee2fdd commit 4e69a8f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
if (frequency === "cf") {
frequency = parseFloat("0" + $("cf").value);
if (!frequency) return;
localStorage.setItem("hfreq-cf", frequency);
}
stop();
toggleStop(true, frequency);
Expand Down Expand Up @@ -89,6 +90,10 @@
duration = parseInt(d);
$("duration").value = d;
}
const cf = localStorage.getItem("hfreq-cf");
if (cf) {
$("cf").value = cf;
}
};
</script>
<style>
Expand Down Expand Up @@ -438,7 +443,6 @@ <h2>Mineral nutrients</h2>
>
</p>
<h3>Special mineral nutrients</h3>

<button onclick="playFreq(316)"><span>316 Hz</span> Gold</button>
<button onclick="playFreq(376)"><span>376 Hz</span> Silver</button>
<button onclick="playFreq(312)"><span>312 Hz</span> Platinum</button>
Expand Down

0 comments on commit 4e69a8f

Please sign in to comment.