gdpr/AGENTS.md
Ole-Morten Duesund 54e9712a63 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.
2025-09-25 13:55:12 +02:00

1.3 KiB

Development Guidelines

Build/Test Commands

python3 -m http.server 8000  # Test: http://localhost:8000
# No build system - pure HTML/JS project

Code Style

  • JS: ES6+ vanilla, 2-space indent, semicolons, camelCase methods, PascalCase classes
  • Quotes: Single for JS strings, double for HTML attributes
  • DOM: Cache element refs, check existence before manipulation
  • Globals: Minimize - use class instances for state (e.g., window.trackingConsent)
  • Errors: Use console.log for debug, alert/confirm for user interaction

Project Structure

  • index.html - Complete demo with all JS/CSS inline
  • integration-example.js - Framework integration examples
  • translations object - i18n with 'en'/'no' ISO codes, localStorage persistence

Key APIs

localStorage.getItem('gdpr-tracking-consent') // 'true' or 'false'
localStorage.getItem('gdpr-language') // 'en' or 'no'
window.trackingConsent.enableTracking() // Programmatic control
document.addEventListener('trackingModeChanged', handler) // Events

Integration Notes

  • Google Analytics: Update consent via gtag('consent', 'update', {...})
  • Cookies: Auto-cleanup of _ga, _gid, _gat, _fbp, _fbc when disabled
  • GDPR compliant by default - minimal tracking until explicit consent