mirror of
https://github.com/Ellpeck/TinyLifeWeb.git
synced 2024-11-17 17:23:12 +01:00
added a cookie notification to the website
This commit is contained in:
parent
685233c73e
commit
88de317ee2
3 changed files with 29 additions and 0 deletions
17
web/_includes/cookie.html
Normal file
17
web/_includes/cookie.html
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<div id="cookieinfo"></div>
|
||||||
|
<script>
|
||||||
|
if (localStorage.getItem("notification") !== "true") {
|
||||||
|
$("#cookieinfo").html( /*html*/ `
|
||||||
|
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||||
|
This site uses your browser's local storage to store information about your browsing activity.
|
||||||
|
<br>For more information, please check out the <a href="https://ellpeck.de/privacy">privacy policy</a>.
|
||||||
|
<button type="button" class="close" data-dismiss="alert" id="notif-close">
|
||||||
|
<span>×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
`);
|
||||||
|
$("#notif-close").on("click", function () {
|
||||||
|
localStorage.setItem("notification", "true");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -50,6 +50,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% include navbar.html %}
|
{% include navbar.html %}
|
||||||
|
{% include cookie.html %}
|
||||||
|
|
||||||
{{ content }}
|
{{ content }}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,17 @@ a:visited.wide-link {
|
||||||
padding-top: 70px;
|
padding-top: 70px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#cookieinfo {
|
||||||
|
position: fixed;
|
||||||
|
top: 80px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
max-width: 700px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
z-index: 500;
|
||||||
|
}
|
||||||
|
|
||||||
.section {
|
.section {
|
||||||
width: 95%;
|
width: 95%;
|
||||||
max-width: 850px;
|
max-width: 850px;
|
||||||
|
|
Loading…
Reference in a new issue