v0.7.4 - removed redundant code
This commit is contained in:
parent
e8278b7125
commit
1e4d55ef26
|
@ -45,43 +45,3 @@
|
||||||
@endif
|
@endif
|
||||||
</main>
|
</main>
|
||||||
@endsection
|
@endsection
|
||||||
@section("scripts")
|
|
||||||
@if(request()->cookie("mode") == "dark")
|
|
||||||
<script type="text/javascript">
|
|
||||||
function toggleMenu(menu) {
|
|
||||||
let menuElement = document.getElementById(menu);
|
|
||||||
let logoElement = document.getElementById("sdeLogo");
|
|
||||||
let htmlElement = document.getElementsByTagName('html')[0];
|
|
||||||
let bodyElement = document.getElementsByTagName('body')[0];
|
|
||||||
let mainElement = document.getElementsByTagName('main')[0];
|
|
||||||
let iconElement = document.getElementById("icon");
|
|
||||||
let headerElement = document.getElementById("header");
|
|
||||||
|
|
||||||
if(menuElement.classList.contains("hide")) {
|
|
||||||
menuElement.classList.remove("hide");
|
|
||||||
mainElement.classList.remove("d-none");
|
|
||||||
htmlElement.style.backgroundColor = '';
|
|
||||||
bodyElement.style.backgroundColor = '#666666';
|
|
||||||
logoElement.src = '/images/logos/Logo-hvid.svg';
|
|
||||||
iconElement.classList.remove("fa-times");
|
|
||||||
iconElement.classList.add("fa-bars");
|
|
||||||
headerElement.style.backgroundColor = '';
|
|
||||||
} else {
|
|
||||||
menuElement.classList.add("hide");
|
|
||||||
mainElement.classList.add("d-none");
|
|
||||||
htmlElement.style.backgroundColor = 'rgb(0, 120, 138)';
|
|
||||||
bodyElement.style.backgroundColor = 'rgb(0, 120, 138)';
|
|
||||||
logoElement.src = '/images/logos/Logo-hvid.svg';
|
|
||||||
iconElement.classList.remove("fa-bars");
|
|
||||||
iconElement.classList.add("fa-times");
|
|
||||||
headerElement.style.backgroundColor = 'rgb(0, 120, 138)';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(document.getElementById("toggle"))
|
|
||||||
document.getElementById("toggle").onclick = function () {
|
|
||||||
toggleMenu('menu');
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@endif
|
|
||||||
@endsection
|
|
||||||
|
|
Loading…
Reference in New Issue