feat: call to action banner

This commit is contained in:
Mirus
2024-07-30 14:37:30 +03:00
parent f7c9337b3f
commit 74f38a9b52
9 changed files with 76 additions and 3 deletions

23
assets/css/banner.scss Normal file
View File

@@ -0,0 +1,23 @@
#banner {
width: 100%;
height: 2rem;
display: grid;
grid-template-columns: 1fr auto;
background: $accent;
& span {
display: flex;
align-items: center;
justify-content: center;
}
& a {
color: #1d212c;
display: inline;
}
& > button {
padding: 0 5px 0 0;
margin: 0;
}
}

View File

@@ -11,9 +11,10 @@
@import "post";
@import "pagination";
@import "footer";
@import "banner";
@import "prism";
@import "syntax";
@import "code";
@import "terms";
@import "gist";
@import "gist";

12
assets/js/banner.js Normal file
View File

@@ -0,0 +1,12 @@
const banner = document.getElementById("banner");
const buttons = banner.getElementsByTagName("button");
if (buttons?.[0]) {
const listener = buttons[0].addEventListener("click", () => {
banner.remove();
});
if (!document.getElementById("banner")) {
removeEventListener("click", listener);
}
}