Skip to content

Commit 9062029

Browse files
Consent cookies
1 parent c4e275c commit 9062029

1 file changed

Lines changed: 60 additions & 35 deletions

File tree

docs/index.html

Lines changed: 60 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@
4444
banner.id = 'consent-banner';
4545
banner.innerHTML = `
4646
<div class="consent-content">
47-
<h3>🍪 We use cookies</h3>
48-
<p>We use cookies and similar technologies to improve website functionality, analyze traffic, and personalize content. You can choose which types of cookies to allow.</p>
47+
<div class="consent-header">
48+
<h3>🍪 We use cookies</h3>
49+
<p>We use cookies and similar technologies to improve website functionality, analyze traffic, and personalize content.</p>
50+
</div>
4951
<div class="consent-options">
5052
<label>
5153
<input type="checkbox" id="consent-analytics" checked>
@@ -229,115 +231,138 @@ <h3>🍪 We use cookies</h3>
229231
/* Consent Banner Styles */
230232
#consent-banner {
231233
position: fixed;
232-
bottom: 0;
233-
left: 0;
234-
right: 0;
235-
background: rgba(0, 0, 0, 0.95);
234+
bottom: 20px;
235+
left: 50%;
236+
transform: translateX(-50%);
237+
width: 380px;
238+
max-width: 90vw;
239+
background: rgba(26, 26, 46, 0.85);
236240
backdrop-filter: blur(10px);
237-
border-top: 1px solid rgba(255, 255, 255, 0.1);
241+
border: 1px solid rgba(139, 92, 246, 0.2);
242+
border-radius: 12px;
238243
z-index: 10000;
239-
padding: 20px;
244+
padding: 14px;
240245
animation: slideInUp 0.5s ease-out;
246+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
241247
}
242248

243249
@keyframes slideInUp {
244250
from {
245-
transform: translateY(100%);
251+
transform: translate(-50%, 100%);
246252
opacity: 0;
247253
}
248254
to {
249-
transform: translateY(0);
255+
transform: translate(-50%, 0);
250256
opacity: 1;
251257
}
252258
}
253259

254260
.consent-content {
255-
max-width: 1200px;
256-
margin: 0 auto;
257261
color: #ffffff;
258262
}
259263

264+
.consent-header {
265+
margin-bottom: 12px;
266+
}
267+
260268
.consent-content h3 {
261-
font-size: 1.2rem;
262-
margin-bottom: 10px;
263-
color: #ffffff;
269+
font-size: 0.95rem;
270+
margin-bottom: 6px;
271+
color: rgba(255, 255, 255, 0.9);
264272
}
265273

266274
.consent-content p {
267-
margin-bottom: 15px;
268-
color: #cccccc;
269-
font-size: 0.9rem;
275+
margin-bottom: 0;
276+
color: rgba(255, 255, 255, 0.7);
277+
font-size: 0.75rem;
278+
line-height: 1.3;
270279
}
271280

272281
.consent-options {
273-
margin-bottom: 20px;
282+
margin-bottom: 12px;
274283
}
275284

276285
.consent-options label {
277286
display: flex;
278-
align-items: center;
279-
margin-bottom: 10px;
287+
align-items: flex-start;
288+
margin-bottom: 6px;
280289
cursor: pointer;
281-
color: #ffffff;
290+
color: rgba(255, 255, 255, 0.85);
291+
font-size: 0.8rem;
292+
line-height: 1.3;
282293
}
283294

284295
.consent-options input[type="checkbox"] {
285-
margin-right: 10px;
286-
width: 18px;
287-
height: 18px;
296+
margin-right: 8px;
297+
width: 16px;
298+
height: 16px;
288299
accent-color: #6366f1;
289300
}
290301

291302
.consent-buttons {
292303
display: flex;
293-
gap: 10px;
304+
gap: 8px;
294305
flex-wrap: wrap;
295306
}
296307

297308
.btn-primary, .btn-secondary {
298-
padding: 10px 20px;
309+
padding: 8px 16px;
299310
border: none;
300311
border-radius: 6px;
301-
font-size: 0.9rem;
312+
font-size: 0.8rem;
302313
font-weight: 500;
303314
cursor: pointer;
304315
transition: all 0.2s ease;
305316
}
306317

307318
.btn-primary {
308-
background: #6366f1;
319+
background: rgba(139, 92, 246, 0.8);
309320
color: white;
310321
}
311322

312323
.btn-primary:hover {
313-
background: #5855eb;
324+
background: rgba(139, 92, 246, 0.9);
314325
transform: translateY(-1px);
315326
}
316327

317328
.btn-secondary {
318-
background: rgba(255, 255, 255, 0.1);
319-
color: #ffffff;
320-
border: 1px solid rgba(255, 255, 255, 0.2);
329+
background: rgba(255, 255, 255, 0.08);
330+
color: rgba(255, 255, 255, 0.8);
331+
border: 1px solid rgba(255, 255, 255, 0.15);
321332
}
322333

323334
.btn-secondary:hover {
324-
background: rgba(255, 255, 255, 0.2);
335+
background: rgba(255, 255, 255, 0.15);
336+
color: rgba(255, 255, 255, 0.9);
325337
transform: translateY(-1px);
326338
}
327339

328340
/* Responsive design for consent banner */
329341
@media (max-width: 768px) {
330342
#consent-banner {
331-
padding: 15px;
343+
width: 95vw;
344+
padding: 12px;
345+
bottom: 10px;
332346
}
333347

334348
.consent-buttons {
335349
flex-direction: column;
350+
gap: 6px;
336351
}
337352

338353
.btn-primary, .btn-secondary {
339354
width: 100%;
340355
text-align: center;
356+
padding: 6px 12px;
357+
font-size: 0.75rem;
358+
}
359+
360+
.consent-content h3 {
361+
font-size: 0.85rem;
362+
}
363+
364+
.consent-content p {
365+
font-size: 0.7rem;
341366
}
342367
}
343368

0 commit comments

Comments
 (0)