mirror of
https://github.com/imfing/hextra.git
synced 2025-09-14 13:36:37 -04:00
chore(scripts): generic way to build scripts (#829)
* chore: move core scripts * chore: extract head scripts
This commit is contained in:

committed by
GitHub

parent
ccb63d60f1
commit
1c06ae5580
15
assets/js/core/banner.js
Normal file
15
assets/js/core/banner.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// {{- if site.Params.banner }}
|
||||
(function () {
|
||||
const banner = document.querySelector(".hextra-banner")
|
||||
document.documentElement.style.setProperty("--hextra-banner-height", banner.clientHeight+"px");
|
||||
|
||||
const closeBtn = banner.querySelector(".hextra-banner-close-button");
|
||||
|
||||
closeBtn.addEventListener("click", () => {
|
||||
document.documentElement.classList.add("hextra-banner-hidden");
|
||||
document.documentElement.style.setProperty("--hextra-banner-height", "0px");
|
||||
|
||||
localStorage.setItem('{{ site.Params.banner.key | default `banner-closed` }}', "0");
|
||||
});
|
||||
})();
|
||||
// {{- end -}}
|
Reference in New Issue
Block a user