diff options
Diffstat (limited to 'public/javascripts/frontpage.js')
-rw-r--r-- | public/javascripts/frontpage.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/public/javascripts/frontpage.js b/public/javascripts/frontpage.js new file mode 100644 index 0000000..3c9093e --- /dev/null +++ b/public/javascripts/frontpage.js @@ -0,0 +1,22 @@ +const frontpage = {} +const self = frontpage + +self._nodes = { + input: document.querySelector('input[type="search"]') +} + +self.isShown = false + +self.show = function () { + document.body.classList.add('no-input') + self.isShown = true +} + +self.hide = function () { + document.body.classList.remove('no-input') + self.isShown = false +} + +self._nodes.input.addEventListener('input', self.hide) + +module.exports = frontpage |