<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>{{ title }} | Fortified</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="A fully featured admin theme which can be used to build CRM, CMS, etc." name="description" />
<meta content="Coderthemes" name="author" />
<!-- App favicon -->
<link rel="shortcut icon" href="{{ asset('assets/images/favicon.ico') }}">
{{ pageCss|raw }}
<script>
function setTheme(themeName) {
localStorage.setItem('theme', themeName);
console.log(document.querySelector('body'));
document.querySelector('body').setAttribute('data-layout-color', themeName);
}
// function to toggle between light and dark theme
function toggleTheme() {
if (localStorage.getItem('theme') === 'dark'){
setTheme('light');
} else {
setTheme('dark');
}
}
function initTheme() {
if (localStorage.getItem('theme') === 'light') {
setTheme('light');
} else {
setTheme('dark');
}
document.querySelector(".theme-icon").addEventListener("click", () => {
toggleTheme();
});
}
// Immediately invoked function to set the theme on initial load
(function () {
window.onload = (event) => {
initTheme();
};
})();
</script>
<style>
.theme-icon i {
font-size: 32px;
vertical-align: middle;
line-height: 70px;
}
body:not([data-layout-color=light]) .theme-icon .fa-sun {
display: none;
}
body:not([data-layout-color=light]) .theme-icon .fa-moon {
display: inline-block;
color: var(--ct-body-color);
}
body[data-layout-color=light] .theme-icon .fa-sun {
display: inline-block;
}
body[data-layout-color=light] .theme-icon .fa-moon {
display: none;
}
</style>
</head>