parent
8ca3a6c051
commit
684e169b70
After Width: | Height: | Size: 572 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 345 B |
@ -0,0 +1,75 @@
|
||||
<style>
|
||||
#modals {
|
||||
display: flex;
|
||||
background: #00000091;
|
||||
position: absolute;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
z-index: 1000;
|
||||
}
|
||||
#modals > div {
|
||||
display: none;
|
||||
margin: auto;
|
||||
background: #fff;
|
||||
border-radius: 2px;
|
||||
padding: 1em;
|
||||
height: max-content;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="modals" onclick="MODAL.hide(this)"
|
||||
style="display: none">
|
||||
|
||||
<!-- MODAL : profile -->
|
||||
<style>
|
||||
#modals.profile { background: #ffffffc4 !important; }
|
||||
#modals > #profile {
|
||||
margin: 0 auto !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
#modals > #profile a {
|
||||
padding: 1.3em;
|
||||
}
|
||||
</style>
|
||||
<div id="profile">
|
||||
<div style="display:flex">
|
||||
<a class="btn-img" href="/settings">
|
||||
<div class="img"><img src="/img/sv-cog.svg"/></div>
|
||||
<span class="text"><?php l('modals.settings', 'Settings') ?></span>
|
||||
</a>
|
||||
<a class="btn-img" href="/content">
|
||||
<div class="img"><img src="/img/sv-diamond.svg"/></div>
|
||||
<span class="text"><?php l('modals.content', 'Content') ?></span>
|
||||
</a>
|
||||
<a class="btn-img" href="/profile">
|
||||
<div class="img"><img src="/img/sv-account-circle.svg"/></div>
|
||||
<span class="text"><?php l('modals.profile', 'Profile') ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const MODAL = {
|
||||
show: function(_id, hideOnClick) {
|
||||
hideOnClick = hideOnClick || true;
|
||||
document.querySelector('#modals').style = '';
|
||||
document.querySelector('#modals').className = _id;
|
||||
const nodes = document.querySelectorAll('#modals > div');
|
||||
for (var i = 0; i < nodes.length; i++)
|
||||
nodes[i].style = '';
|
||||
document.querySelector('#modals > #'+_id).style = 'display:initial';
|
||||
const anchors = document.querySelectorAll('#modals a');
|
||||
if (!hideOnClick) {
|
||||
for (var i = 0; i < anchors.length; i++)
|
||||
anchors[i].setAttribute('onclick', 'event.stopPropagation();');
|
||||
}
|
||||
},
|
||||
hide: function(el) {
|
||||
document.querySelector('#modals').style = 'display:none';
|
||||
document.querySelector('#modals').className = '';
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in new issue