diff --git a/README.md b/README.md index 00354b9..c726a72 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # Grainy Makes grainy SVG textures + +https://finitelooper.github.io/grainy/ diff --git a/src/utils.js b/src/utils.js index 65b46bf..4f66072 100644 --- a/src/utils.js +++ b/src/utils.js @@ -7,10 +7,11 @@ function $$(multiElSelector) { function toggleDisplay($elements) { function t(el) { const currentDisplay = getComputedStyle(el).display; - if (currentDisplay === 'block') { + if (currentDisplay !== 'none') { + el.attributes['data-prev-display'] = currentDisplay; el.style.display = 'none'; } else if (currentDisplay === 'none') { - el.style.display = 'block'; + el.style.display = el.attributes['data-prev-display'] ?? 'block'; } }