refactored css, including some markup changes

This commit is contained in:
Danny Coates 2018-02-13 11:32:59 -08:00
parent 3163edcbe4
commit 8d41111cd6
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
62 changed files with 5731 additions and 4078 deletions

View file

@ -0,0 +1,34 @@
const html = require('choo/html');
module.exports = function(placeholder, action, submit) {
return html`
<form
class="passwordInput passwordInput--hidden"
onsubmit=${submit}
data-no-csrf>
<input id="password-input"
class="input input--noBtn"
maxlength="32"
autocomplete="off"
type="password"
oninput=${inputChanged}
placeholder="${placeholder}">
<input type="submit"
id="password-btn"
class="inputBtn inputBtn--hidden"
value="${action}"/>
</form>
`;
function inputChanged() {
const resetInput = document.getElementById('password-input');
const resetBtn = document.getElementById('password-btn');
if (resetInput.value.length > 0) {
resetBtn.classList.remove('inputBtn--hidden');
resetInput.classList.remove('input--noBtn');
} else {
resetBtn.classList.add('inputBtn--hidden');
resetInput.classList.add('input--noBtn');
}
}
};