<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DMA Obligations Tracker</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
body { font-family: Arial, sans-serif; margin: 0; padding: 20px; background: #f4f4f9; color: #333; }
.header { text-align: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 20px; border-radius: 10px; margin-bottom: 20px; }
.tabs { display: flex; justify-content: center; margin-bottom: 20px; }
.tab { padding: 10px 20px; background: #e0e0e0; border: none; cursor: pointer; margin: 0 5px; border-radius: 5px 5px 0 0; }
.tab.active { background: #667eea; color: white; }
.tab-content { display: none; background: white; padding: 20px; border-radius: 0 10px 10px 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.tab-content.active { display: block; }
.section { margin-bottom: 30px; }
.section h3 { color: #667eea; border-bottom: 2px solid #667eea; padding-bottom: 10px; }
.choice-screen-sim { background: #f9f9f9; padding: 20px; border-radius: 10px; text-align: center; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 20px; }
.choice-item { border: 2px solid #ddd; padding: 15px; border-radius: 8px; cursor: pointer; transition: all 0.3s; }
.choice-item:hover { border-color: #667eea; background: #e8f0fe; }
.choice-item.selected { border-color: #4caf50; background: #e8f5e8; }
.status-badge { padding: 5px 10px; border-radius: 20px; font-size: 0.9em; font-weight: bold; }
.compliant { background: #d4edda; color: #155724; }
.non-compliant { background: #f8d7da; color: #721c24; }
.partial { background: #fff3cd; color: #856404; }
.interoperability-checklist { list-style: none; padding: 0; }
.interoperability-checklist li { display: flex; align-items: center; padding: 10px; border-bottom: 1px solid #eee; }
.interoperability-checklist input[type="checkbox"] { margin-right: 10px; transform: scale(1.5); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.kpi-card { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 20px; border-radius: 10px; text-align: center; }
.kpi-value { font-size: 2.5em; font-weight: bold; margin: 10px 0; }
canvas { max-height: 400px; }
.input-group { margin: 10px 0; }
label { display: block; margin-bottom: 5px; font-weight: bold; }
input, select { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 5px; }
button { background: #667eea; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; margin: 5px; }
button:hover { background: #5a67d8; }
.update-btn { background: #4caf50; }
.reset-btn { background: #f44336; }
</style>
</head>
<body>
<div class="header">
<h1>🔍 DMA Obligations Tracker</h1>
<p>Sherlock-built tool for tracking Digital Markets Act compliance: Choice Screens, Interoperability, and KPIs.</p>
</div>
<div class="tabs">
<button class="tab active" onclick="switchTab('choice')">Choice Screens</button>
<button class="tab" onclick="switchTab('interop')">Interoperability</button>
<button class="tab" onclick="switchTab('kpis')">KPIs Dashboard</button>
</div>
<div id="choice" class="tab-content active">
<div class="section">
<h3>Choice Screens Simulator & Tracker</h3>
<p>Simulate DMA-mandated choice screens (e.g., browser/search engine defaults). Track user selections and compliance status.</p>
<div class="input-group">
<label>Platform (e.g., iOS, Android):</label>
<input type="text" id="platform" value="iOS" placeholder="Enter platform">
</div>
<button class="update-btn" onclick="generateChoiceScreen()">Generate Choice Screen</button>
<div id="choice-screen-sim" class="choice-screen-sim" style="display:none;">
<h4>Choose your default Browser/Search Engine</h4>
<div class="choice-grid" id="choice-grid"></div>
<p>Selections: <span id="selection-count">0</span> | Compliance Score: <span id="compliance-score" class="status-badge partial">Partial</span></p>
</div>
</div>
</div>
<div id="interop" class="tab-content">
<div class="section">
<h3>Interoperability Checklist</h3>
<p>Track gatekeeper obligations under DMA Art. 6-7 (e.g., API access, sideloading, data portability).</p>
<ul class="interoperability-checklist" id="interop-checklist">
<!-- Dynamically populated -->
</ul>
<button class="update-btn" onclick="calculateInteropStatus()">Calculate Status</button>
<div id="interop-status" style="margin-top:20px;"></div>
</div>
</div>
<div id="kpis" class="tab-content">
<div class="section">
<h3>KPIs Dashboard</h3>
<p>Key Performance Indicators for DMA compliance. Update metrics and visualize trends.</p>
<div class="input-group">
<label>Choice Screen Adoption (% non-default):</label>
<input type="number" id="kpi-adoption" value="25" min="0" max="100">
</div>
<div class="input-group">
<label>Interop API Uptime (%):</label>
<input type="number" id="kpi-uptime" value="98" min="0" max="100">
</div>
<div class="input-group">
<label>User Data Portability Requests (monthly):</label>
<input type="number" id="kpi-requests" value="1500">
</div>
<button class="update-btn" onclick="updateKPIs()">Update & Visualize</button>
<div class="kpi-grid" id="kpi-grid"></div>
<canvas id="kpi-chart" width="400" height="200"></canvas>
</div>
</div>
<script>
// Tab switching
function switchTab(tabName) {
document.querySelectorAll('.tab-content').forEach(tab => tab.classList.remove('active'));
document.querySelectorAll('.tab').forEach(tab => tab.classList.remove('active'));
document.getElementById(tabName).classList.add('active');
event.target.classList.add('active');
if (tabName === 'interop') initInteropChecklist();
if (tabName === 'kpis') updateKPIs();
}
// Choice Screens
const choiceOptions = [
{ name: 'Chrome', icon: '🔍', default: true },
{ name: 'Firefox', icon: '🦊' },
{ name: 'Safari', icon: '🧭', default: true },
{ name: 'Edge', icon: '📄' },
{ name: 'DuckDuckGo', icon: '🦆' },
{ name: 'Brave', icon: '🛡️' }
];
function generateChoiceScreen() {
const grid = document.getElementById('choice-grid');
const platform = document.getElementById('platform').value;
grid.innerHTML = '';
choiceOptions.forEach((option, index) => {
const item = document.createElement('div');
item.className = 'choice-item';
item.innerHTML = `${option.icon}<br><strong>${option.name}</strong>`;
if (option.default) item.classList.add('selected');
item.onclick = () => selectChoice(item, index);
grid.appendChild(item);
});
document.getElementById('choice-screen-sim').style.display = 'block';
document.getElementById('selection-count').textContent = '1 (default)';
updateComplianceScore();
}
let selections = new Set([0, 2]); // Defaults
function selectChoice(item, index) {
if (selections.has(index)) {
selections.delete(index);
item.classList.remove('selected');
} else {
selections.add(index);
item.classList.add('selected');
}
document.getElementById('selection-count').textContent = selections.size;
updateComplianceScore();
}
function updateComplianceScore() {
const score = Math.min(100, (selections.size / choiceOptions.length) * 100);
const badge = document.getElementById('compliance-score');
badge.textContent = `${Math.round(score)}%`;
badge.className = `status-badge ${score >= 80 ? 'compliant' : score >= 50 ? 'partial' : 'non-compliant'}`;
}
// Interoperability
const interopItems = [
'Provide fair, reasonable, non-discriminatory (FRAND) API access to third-party apps',
'Enable sideloading and alternative app stores (Art. 6(4))',
'Allow user choice of default voice assistants (Art. 6(8))',
'Ensure data portability without hindrance (Art. 6(9))',
'Interoperate with third-party messaging services (Art. 7)',
'Share ranking, pricing, and listing data with business users'
];
function initInteropChecklist() {
const list = document.getElementById('interop-checklist');
list.innerHTML = '';
interopItems.forEach((item, index) => {
const li = document.createElement('li');
li.innerHTML = `
<input type="checkbox" id="interop-${index}" ${localStorage.getItem(`interop-${index}`) === 'true' ? 'checked' : ''}>
<label for="interop-${index}">${item}</label>
`;
li.querySelector('input').onchange = (e) => {
localStorage.setItem(`interop-${index}`, e.target.checked);
};
list.appendChild(li);
});
}
function calculateInteropStatus() {
let compliantCount = 0;
interopItems.forEach((_, index) => {
if (localStorage.getItem(`interop-${index}`) === 'true') compliantCount++;
});
const percent = Math.round((compliantCount / interopItems.length) * 100);
const statusDiv = document.getElementById('interop-status');
const badgeClass = percent >= 80 ? 'compliant' : percent >= 50 ? 'partial' : 'non-compliant';
statusDiv.innerHTML = `
<p>Overall Interop Compliance: <span class="status-badge ${badgeClass}">${percent}% (${compliantCount}/${interopItems.length})</span></p>
<button class="reset-btn" onclick="resetInterop()">Reset All</button>
`;
}
function resetInterop() {
interopItems.forEach((_, index) => localStorage.removeItem(`interop-${index}`));
initInteropChecklist();
calculateInteropStatus();
}
// KPIs
let kpiChart;
function updateKPIs() {
const adoption = parseFloat(document.getElementById('kpi-adoption').value);
const uptime = parseFloat(document.getElementById('kpi-uptime').value);
const requests = parseInt(document.getElementById('kpi-requests').value);
document.getElementById('kpi-grid').innerHTML = `
<div class="kpi-card">
<div>Adoption Rate</div>
<div class="kpi-value">${adoption}%</div>
<div class="status-badge ${adoption >= 30 ? 'compliant' : 'non-compliant'}">${adoption >= 30 ? 'Target Met' : 'Improve'}</div>
</div>
<div class="kpi-card">
<div>API Uptime</div>
<div class="kpi-value">${uptime}%</div>
<div class="status-badge ${uptime >= 99 ? 'compliant' : 'partial'}">${uptime >= 99 ? 'Excellent' : 'Monitor'}</div>
</div>
<div class="kpi-card">
<div>Portability Requests</div>
<div class="kpi-value">${requests.toLocaleString()}</div>
<div class="status-badge ${requests > 1000 ? 'compliant' : 'partial'}">${requests > 1000 ? 'High Engagement' : 'Growing'}</div>
</div>
`;
const ctx = document.getElementById('kpi-chart').getContext('2d');
if (kpiChart) kpiChart.destroy();
kpiChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: ['Compliant', 'Partial', 'Non-Compliant'],
datasets: [{
data: [adoption >= 30 ? 1 : 0, uptime >= 99 ? 0 : 1, requests <= 1000 ? 1 : 0],
backgroundColor: ['#4caf50', '#ffc107', '#f44336']
}]
},
options: { responsive: true, plugins: { legend: { position: 'bottom' } } }
});
}
// Init on load
window.onload = () => {
generateChoiceScreen();
initInteropChecklist();
calculateInteropStatus();
updateKPIs();
};
</script>
</body>
</html>
How to Use This DMA Obligations Tracker
Copy-paste the code above into an HTML file (e.g., dma-tracker.html) and open in any browser. It's a fully functional, self-contained single-page app built with vanilla HTML/CSS/JS + Chart.js.
Features:
-
Choice Screens Tab:
- Interactive simulator for DMA choice screens (browser/search defaults).
- Tracks selections, calculates real-time compliance score (% options shown/selected).
- Customizable by platform.
-
Interoperability Tab:
- Checklist of key DMA obligations (Art. 6-7).
- Persistent storage (localStorage) for checkboxes.
- Auto-calculates overall % compliance with status badges.
-
KPIs Dashboard:
- Input metrics: adoption rate, API uptime, portability requests.
- KPI cards with thresholds (e.g., >30% adoption = compliant).
- Dynamic doughnut chart visualizing compliance status.
- Thresholds based on typical DMA benchmarks (customize as needed).
Customization & Extensions:
- Add Data Sources: Integrate APIs (e.g., Google Analytics for real choice data).
- Export: Add buttons to download CSV/PDF reports.
- Multi-Gatekeeper: Extend for Apple/Google/etc. with user selection.
- Alerts: Add email/Slack notifications for low KPIs.
This tracker ensures proactive DMA compliance—audit-ready! If you need backend (Node.js/Python), mobile app, or expansions, let me know. 🕵️♂️