Skip to content
This repository was archived by the owner on Jul 18, 2023. It is now read-only.

Commit 1176084

Browse files
authored
Add GDPR Banner (#12)
1 parent b0a72f7 commit 1176084

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

‎assets/app.css

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,36 @@ hr {
351351
.grid-item.history { border-left: 4px solid #5270f5; color: #5270f5;}
352352
.grid-item.debug { border-left: 4px solid #9c0000; color: #9c0000;}
353353

354+
/* ---- GDPR BANNER ---- */
355+
.gdpr-wrapper {
356+
display: none;
357+
font-family: Arial, Helvetica, sans-serif;
358+
position: fixed;
359+
bottom: 0px;
360+
left:0px;
361+
right:0px;
362+
height: 45px;
363+
text-align: center;
364+
color: #fff;
365+
font-size: 14px;
366+
background-color: #21252b;
367+
border-top: 2px solid #ff5252;
368+
-webkit-touch-callout: none;
369+
-webkit-user-select: none;
370+
-khtml-user-select: none;
371+
-moz-user-select: none;
372+
-ms-user-select: none;
373+
user-select: none;
374+
}
375+
376+
.gdpr-close {
377+
font-size:25px;
378+
position: fixed;
379+
right: 15px;
380+
bottom: 5px;
381+
color: #fff;
382+
}
383+
354384
/* ---- OCTOCAT! ---- */
355385
.github-corner:hover .octo-arm {
356386
animation: octocat-wave 560ms ease-in-out

‎assets/app.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
let isAdvanced = false;
22
let lang = "en";
3+
let showGDPR = true;
4+
let gdprBanner;
35

6+
//Cookies.remove("showGDPR")
47
// Cookies
58
if (Cookies.get("showAdvanced")) {
69
isAdvanced = Cookies.get("showAdvanced") == "true" ? true : false;
@@ -11,6 +14,14 @@ if (Cookies.get("language")) {
1114
lang = Cookies.get("language");
1215
}
1316

17+
if (Cookies.get("showGDPR")) {
18+
showGDPR = Cookies.get("showGDPR");
19+
}
20+
21+
$(document).ready(function() {
22+
toggleGDPR(showGDPR);
23+
});
24+
1425
// init isotope
1526
let qsRegex;
1627
const $grid = $(".grid").isotope({
@@ -224,6 +235,21 @@ $("#ShowAdvanced").change(function() {
224235
refreshList();
225236
});
226237

238+
function toggleGDPR(isShow) {
239+
console.log("ShowGDPR: " + isShow);
240+
241+
if (isShow === true)
242+
$(".gdpr-wrapper").show();
243+
// else
244+
// $(".gdpr-wrapper").hide();
245+
//
246+
}
247+
248+
$(".gdpr-close").click(function() {
249+
Cookies.set("showGDPR", false);
250+
$(".gdpr-wrapper").hide();
251+
});
252+
227253
function getURLParameter(sParam) {
228254
const sPageURL = window.location.search.substring(1);
229255
const sURLVariables = sPageURL.split("&");

‎index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@
8686
<div class="grid">
8787
</div>
8888

89+
<!-- GDPR BANNER -->
90+
<div class="gdpr-wrapper">
91+
<p>We use cookies to store only your app related settings to your machine. By using our site, you consent to cookies.</p>
92+
<a href="#"><div class="gdpr-close"></div></a>
93+
</div>
94+
8995
<script src="assets/app.js"></script>
9096
</body>
9197

0 commit comments

Comments
 (0)