Skip to content

Commit a97c4b7

Browse files
committed
Updates
1 parent 0917c5e commit a97c4b7

File tree

1 file changed

+83
-5
lines changed

1 file changed

+83
-5
lines changed

index.html

Lines changed: 83 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,103 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
34
<head>
45
<meta charset="utf-8" />
56
<link rel="icon" href="./favicon.ico" />
67
<meta name="viewport" content="width=device-width, initial-scale=1" />
78
<link rel="apple-touch-icon" href="./logo192.png" />
89
<link rel="manifest" href="./manifest.json" />
910
<script type="text/javascript">
10-
(function(c,l,a,r,i,t,y){
11-
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
12-
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
13-
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
11+
(function (c, l, a, r, i, t, y) {
12+
c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) };
13+
t = l.createElement(r); t.async = 1; t.src = "https://www.clarity.ms/tag/" + i;
14+
y = l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t, y);
1415
})(window, document, "clarity", "script", "e9evt2zm9w");
1516
</script>
16-
<script defer="defer" src="https://cdn.jsdelivr.net/gh/danwahlin/Featured-Content@gh-pages/dist/main-0.9.min.js"></script>
17+
<script defer="defer"
18+
src="https://cdn.jsdelivr.net/gh/danwahlin/Featured-Content@gh-pages/dist/main-0.9.min.js"></script>
1719
<link href="https://cdn.jsdelivr.net/gh/danwahlin/Featured-Content@gh-pages/dist/main-0.9.min.css" rel="stylesheet">
20+
<style>
21+
/* Basic styling for the cookie banner */
22+
.cookie-banner {
23+
position: fixed;
24+
bottom: 0;
25+
left: 0;
26+
right: 0;
27+
background: #222;
28+
color: #fff;
29+
padding: 15px;
30+
font-family: Arial, sans-serif;
31+
display: flex;
32+
align-items: center;
33+
justify-content: space-between;
34+
z-index: 9999;
35+
opacity: 0.9;
36+
}
37+
38+
.cookie-banner p {
39+
margin: 0;
40+
font-size: 14px;
41+
max-width: 70%;
42+
}
43+
44+
.cookie-banner .buttons {
45+
display: flex;
46+
gap: 10px;
47+
}
48+
49+
.cookie-banner button {
50+
background: #444;
51+
border: none;
52+
color: #fff;
53+
padding: 8px 12px;
54+
font-size: 14px;
55+
cursor: pointer;
56+
}
57+
58+
.cookie-banner button:hover {
59+
background: #555;
60+
}
61+
</style>
1862
<title>Curated Content</title>
1963
</head>
2064

2165
<body>
2266
<div id="root" data-feed-url="./data/siteContent.json"></div>
67+
68+
<!-- Cookie Banner -->
69+
<div class="cookie-banner" id="cookieBanner" style="display: none;">
70+
<p>We use cookies to personalize content, measure performance, and provide you with a better browsing experience. By clicking 'Accept' you agree to our use of cookies.</p>
71+
<div class="buttons">
72+
<button id="acceptCookies">Accept</button>
73+
<button id="denyCookies">Deny</button>
74+
</div>
75+
</div>
76+
77+
<script>
78+
// Check localStorage to see if user already made a choice
79+
document.addEventListener('DOMContentLoaded', function () {
80+
const userChoice = localStorage.getItem('cookiesAccepted');
81+
82+
if (userChoice === null) {
83+
// Show the banner if no choice has been made
84+
document.getElementById('cookieBanner').style.display = 'flex';
85+
}
86+
87+
document.getElementById('acceptCookies').addEventListener('click', function () {
88+
localStorage.setItem('cookiesAccepted', 'true');
89+
window.clarity('consent');
90+
document.getElementById('cookieBanner').style.display = 'none';
91+
// Here you could initialize analytics or any other script that requires cookies
92+
});
93+
94+
document.getElementById('denyCookies').addEventListener('click', function () {
95+
localStorage.setItem('cookiesAccepted', 'false');
96+
window.clarity('consent', false)
97+
document.getElementById('cookieBanner').style.display = 'none';
98+
});
99+
});
100+
</script>
23101
</body>
24102

25103
</html>

0 commit comments

Comments
 (0)