1
1
<!DOCTYPE html>
2
2
< html lang ="en ">
3
+
3
4
< head >
4
5
< meta charset ="utf-8 " />
5
6
< link rel ="icon " href ="./favicon.ico " />
6
7
< meta name ="viewport " content ="width=device-width, initial-scale=1 " />
7
8
< link rel ="apple-touch-icon " href ="./logo192.png " />
8
9
< link rel ="manifest " href ="./manifest.json " />
9
10
< 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 ) ;
14
15
} ) ( window , document , "clarity" , "script" , "e9evt2zm9w" ) ;
15
16
</ 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 >
17
19
< 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 >
18
62
< title > Curated Content</ title >
19
63
</ head >
20
64
21
65
< body >
22
66
< 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 >
23
101
</ body >
24
102
25
103
</ html >
0 commit comments