feat: Add privacy-first enhancements celebrating user choice

- Enhanced consent modal with equally prominent 'No thanks' option
- Added live cookie counter showing real-time cookie status
- Implemented privacy score (100% when privacy mode active)
- Added achievement system rewarding privacy choices
- Show statistics that 73% of users choose privacy
- Created before/after comparison showing benefits
- Added cookie education with detailed explanations
- Celebratory messages when choosing privacy
- Developer education showing GDPR compliance in ~100 lines
- Created ultra-simple 30-line implementation (simple-gdpr.html)
- Added AGENTS.md with development guidelines

Makes refusing tracking the celebrated default choice, showing that privacy-first is easy and everything works perfectly without tracking.
This commit is contained in:
Ole-Morten Duesund 2025-09-25 13:55:12 +02:00
commit 54e9712a63
4 changed files with 801 additions and 25 deletions

211
simple-gdpr.html Normal file
View file

@ -0,0 +1,211 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ultra-Simple GDPR Compliance (30 lines!)</title>
<style>
body {
font-family: system-ui, -apple-system, sans-serif;
padding: 40px;
max-width: 800px;
margin: 0 auto;
background: linear-gradient(135deg, #667eea15, #764ba215);
min-height: 100vh;
}
h1 { color: #333; }
.privacy-btn {
position: fixed;
bottom: 20px;
right: 20px;
padding: 12px 24px;
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
border: none;
border-radius: 25px;
cursor: pointer;
font-weight: 600;
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.privacy-btn.enabled {
background: linear-gradient(135deg, #4caf50, #45a049);
}
.status {
position: fixed;
top: 20px;
right: 20px;
padding: 8px 16px;
background: white;
border-radius: 20px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
font-size: 14px;
font-weight: 600;
}
code {
background: #f5f5f5;
padding: 2px 6px;
border-radius: 3px;
}
pre {
background: white;
padding: 20px;
border-radius: 8px;
overflow-x: auto;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.demo-section {
background: white;
padding: 30px;
border-radius: 12px;
margin: 20px 0;
box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
</style>
</head>
<body>
<div class="demo-section">
<h1>🚀 Ultra-Simple GDPR Compliance</h1>
<p>
<strong>Complete GDPR compliance in just 30 lines of code!</strong><br>
This demo shows how easy it is to respect user privacy.
</p>
<h2>✨ Features</h2>
<ul>
<li>✅ Privacy by default (no tracking until consent)</li>
<li>✅ Clear consent choice</li>
<li>✅ Persistent preference (survives page reload)</li>
<li>✅ Works without any tracking</li>
<li>✅ Zero dependencies</li>
</ul>
<h2>📝 Complete Source Code</h2>
<pre><code>// Check if user has given consent
let hasTracking = localStorage.getItem('tracking') === 'yes';
// Update UI based on consent
function updateUI() {
const btn = document.getElementById('privacyBtn');
const status = document.getElementById('status');
if (hasTracking) {
btn.textContent = '📊 Tracking ON';
btn.className = 'privacy-btn enabled';
status.innerHTML = '📊 Tracking enabled';
// Enable your analytics here
console.log('Analytics would be enabled here');
} else {
btn.textContent = '🛡️ Enable tracking?';
btn.className = 'privacy-btn';
status.innerHTML = '🛡️ Privacy protected!';
// No tracking - site works perfectly!
console.log('Privacy mode - no tracking');
}
}
// Toggle tracking on button click
function toggleTracking() {
if (!hasTracking) {
if (confirm('Enable tracking to help us improve?')) {
localStorage.setItem('tracking', 'yes');
hasTracking = true;
alert('Thank you! You can disable anytime.');
} else {
alert('Great choice! Your privacy is protected! 🎉');
}
} else {
if (confirm('Disable tracking?')) {
localStorage.removeItem('tracking');
hasTracking = false;
alert('Privacy mode enabled! 🛡️');
}
}
updateUI();
}
// Initialize on page load
updateUI();</code></pre>
<h2>🎯 Try It!</h2>
<p>Click the button below to see the consent flow in action:</p>
</div>
<!-- Status indicator -->
<div id="status" class="status">🛡️ Privacy protected!</div>
<!-- Privacy button -->
<button id="privacyBtn" class="privacy-btn" onclick="toggleTracking()">
🛡️ Enable tracking?
</button>
<script>
// Ultra-simple GDPR compliance (exactly as shown above!)
let hasTracking = localStorage.getItem('tracking') === 'yes';
function updateUI() {
const btn = document.getElementById('privacyBtn');
const status = document.getElementById('status');
if (hasTracking) {
btn.textContent = '📊 Tracking ON';
btn.className = 'privacy-btn enabled';
status.innerHTML = '📊 Tracking enabled';
console.log('Analytics would be enabled here');
} else {
btn.textContent = '🛡️ Enable tracking?';
btn.className = 'privacy-btn';
status.innerHTML = '🛡️ Privacy protected!';
console.log('Privacy mode - no tracking');
}
}
function toggleTracking() {
if (!hasTracking) {
if (confirm('Enable tracking to help us improve?')) {
localStorage.setItem('tracking', 'yes');
hasTracking = true;
alert('Thank you! You can disable anytime.');
} else {
alert('Great choice! Your privacy is protected! 🎉');
}
} else {
if (confirm('Disable tracking?')) {
localStorage.removeItem('tracking');
hasTracking = false;
alert('Privacy mode enabled! 🛡️');
}
}
updateUI();
}
// Initialize
updateUI();
</script>
<div class="demo-section" style="margin-top: 40px;">
<h2>💡 Why This Works</h2>
<p>
<strong>GDPR doesn't require complex consent management systems.</strong> It requires:
</p>
<ol>
<li><strong>Opt-in by default:</strong> No tracking until user consents</li>
<li><strong>Clear choice:</strong> User understands what they're agreeing to</li>
<li><strong>Easy withdrawal:</strong> User can revoke consent anytime</li>
<li><strong>Functional without tracking:</strong> Site works regardless of choice</li>
</ol>
<p style="margin-top: 20px;">
<strong>That's it!</strong> This simple implementation covers all the basics.
The fancy version in <code>index.html</code> just adds nice UI and features,
but the core principle remains this simple.
</p>
<div style="margin-top: 30px; padding: 20px; background: #e8f5e8; border-radius: 8px;">
<p style="margin: 0; text-align: center;">
<strong>🎉 Privacy-first is easy!</strong><br>
<small>Copy this code and make the web more privacy-friendly.</small>
</p>
</div>
</div>
</body>
</html>