mirror of
https://github.com/kittywitch/dork.dev.git
synced 2026-02-09 23:29:17 -08:00
deploy: 3b1c786fd6
This commit is contained in:
parent
98c6d1e2ba
commit
50d2f16b35
11 changed files with 169 additions and 99 deletions
30
templates/nonoscript.html
Normal file
30
templates/nonoscript.html
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<!-- Component for no-noscript; Showing an item only if you have Javascript -->
|
||||
|
||||
<!--
|
||||
Motivation:
|
||||
* Provide things with script tag related behaviour only if the user has Javascript
|
||||
* If the user does not have Javascript, just don't display those elements to them
|
||||
|
||||
Other parts of the implementation:
|
||||
* Components with scripted behaviour should be given the "nonoscript" class.
|
||||
|
||||
```scss
|
||||
/* A kindness to those of you who don't use Javascript */
|
||||
.nonoscript {
|
||||
display: none;
|
||||
}
|
||||
```
|
||||
-->
|
||||
|
||||
<script>
|
||||
function nonoscriptImplementer() {
|
||||
var nonoscript = document.getElementsByClassName("nonoscript");
|
||||
console.log(nonoscript);
|
||||
for (let item of nonoscript) {
|
||||
console.log("meep!");
|
||||
item.classList.remove("nonoscript");
|
||||
}
|
||||
}
|
||||
window.onload = nonoscriptImplementer();
|
||||
</script>
|
||||
<!-- End of component for no-noscript -->
|
||||
Loading…
Add table
Add a link
Reference in a new issue