feat: ✨ add nsfw barrier component
This commit is contained in:
parent
76473e5a78
commit
7280829591
4 changed files with 65 additions and 2 deletions
44
src/components/nsfw-barrier.webc
Normal file
44
src/components/nsfw-barrier.webc
Normal file
|
@ -0,0 +1,44 @@
|
|||
<script>
|
||||
const nsfwButton = document.querySelector('#nsfw-toggle');
|
||||
|
||||
nsfwButton.addEventListener('click', () => {
|
||||
const isInHornyJail = storeProxy.getItem('isInHornyJail') === 'true';
|
||||
const isHorny = storeProxy.getItem('isHorny') === 'true';
|
||||
|
||||
if (isInHornyJail) {
|
||||
storeProxy.setItem('isHorny', !isHorny);
|
||||
} else {
|
||||
open();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div webc:root="override">
|
||||
<div class="message">
|
||||
<div webc:type="11ty" 11ty:type="md">
|
||||
<slot name="message"></slot>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ref-button id="nsfw-toggle" command="show-modal" commandfor="nsfw-warning">
|
||||
Reveal/Hide
|
||||
</ref-button>
|
||||
|
||||
<div class="nsfw-content">
|
||||
<div webc:type="11ty" 11ty:type="md">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style webc:scoped="nsfw-barrier">
|
||||
:host {
|
||||
.nsfw & .nsfw-content {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
:host .nsfw-content {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue