mirror of https://github.com/nealey/vail.git
Add WPM display
This commit is contained in:
parent
e0e90735b7
commit
4f33d7453c
|
@ -220,6 +220,8 @@
|
|||
<p>
|
||||
Dit length (iambic):
|
||||
<output id="iambic-duration-value"></output>ms
|
||||
/
|
||||
<output id="iambic-duration-wpm"></output> WPM
|
||||
<input
|
||||
id="iambic-duration"
|
||||
class="mdl-slider mdl-js-slider"
|
||||
|
|
|
@ -182,11 +182,15 @@ class VailClient {
|
|||
element.value = storedValue
|
||||
}
|
||||
let outputElement = document.querySelector(selector + "-value")
|
||||
let outputWpmElement = document.querySelector(selector + "-wpm")
|
||||
element.addEventListener("input", e => {
|
||||
localStorage[element.id] = element.value
|
||||
if (outputElement) {
|
||||
outputElement.value = element.value
|
||||
}
|
||||
if (outputWpmElement) {
|
||||
outputWpmElement.value = (1200 / element.value).toFixed(1)
|
||||
}
|
||||
if (callback) {
|
||||
callback(e)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue