1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-22 01:44:25 +04:00
Files
tabler/pages/_includes/layout/debug-footer.html
2019-04-10 23:50:53 +02:00

108 lines
2.5 KiB
HTML

<div class="debug">
<a href="#" data-debug="dark">Dark mode</a>
<a href="#" data-debug="rtl">RTL mode</a>
<a href="#" data-debug="code">Show cards code</a>
<a href="#" data-debug="folded">Folded sidebar</a>
<a href="#" data-debug="fullscreen">Fullscreen</a>
<a href="#" data-debug="header-sticky">Sticky header</a>
</div>
<style>
.debug {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: #222;
color: #fff;
padding: .5rem .75rem;
font-size: 12px;
direction: ltr;
text-align: left;
z-index: 1000;
}
.debug a {
color: inherit;
margin-right: 1rem;
}
.debug a[data-debug]:after {
content: '';
margin: 0 0 1px .25rem;
width: 6px;
height: 6px;
display: inline-block;
background: rgba(255, 255, 255, .3);
border-radius: 50%;
}
body.show-debug-code .card-debug {
display: block;
}
@media (max-width: 991.98px) {
.debug {
display: none;
}
}
body.show-debug-code a[data-debug="code"]:after,
html[dir="rtl"] a[data-debug="rtl"]:after,
body.theme-dark a[data-debug="dark"]:after,
:fullscreen a[data-debug="fullscreen"]:after,
body.header-sticky a[data-debug="header-sticky"]:after,
body.sidebar-folded a[data-debug="folded"]:after {
background: #5eba00;
}
</style>
<script>
$(document).ready(function () {
var $body = $('body'),
$html = $('html');
$body
.on('click', '[data-debug="dark"]', function (e) {
$body.toggleClass('theme-dark');
e.preventDefault();
return false;
})
.on('click', '[data-debug="code"]', function (e) {
$body.toggleClass('show-debug-code');
e.preventDefault();
return false;
})
.on('click', '[data-debug="folded"]', function (e) {
$body.toggleClass('sidebar-folded');
e.preventDefault();
return false;
})
.on('click', '[data-debug="fullscreen"]', function (e) {
tabler.toggleFullscreen();
e.preventDefault();
return false;
})
.on('click', '[data-debug="header-sticky"]', function (e) {
$body.toggleClass('header-sticky');
e.preventDefault();
return false;
})
.on('click', '[data-debug="rtl"]', function (e) {
if ($html.attr('dir') === 'rtl') {
$html.attr('dir', 'ltr');
} else {
$html.attr('dir', 'rtl');
}
e.preventDefault();
return false;
});
});
</script>