Build a content moderation law tracker: jurisdiction mapping, takedown timelines,…
- User
Build a content moderation law tracker: jurisdiction mapping, takedown timelines, appeals, transparency, and LE requests.
Assistant
Build a content moderation law tracker: jurisdiction mapping, takedown timelines, appeals, transparency, and LE requests.
The user wants a "content moderation law tracker" with specific features:
This is a complex, data-heavy request. It requires structuring information about various international internet regulations (like the DSA in EU, NetzDG in Germany, Online Safety Bill in UK, etc.).
Strategy:
Step-by-Step Construction:
name, jurisdiction, region, effectiveDate, takedownTime, appealsProcess, transparencyReq, leRequests.renderCards(data): Loop through data and generate HTML.filterData(): Event listener on dropdowns to filter the array.showDetails(id): Function to populate and show the modal.Refining the Content (The Law Details):
Self-Correction/Review during thought process:
Final Output Structure:
Let's write the code.
Code structure:
<div id="app">
<header>
<div class="filters">
<div class="grid">
<card>
<h3>Name</h3>
<tags>
<btn View Details>
<div id="modal">
Data injection: Let's create 5 distinct laws to make the demo robust.
Refining the UI: The "Tracker" usually implies a table or a dashboard. Cards are more visual and modern. I will use Cards for the overview and a Modal for the deep dive (timelines, appeals, etc.).
Timeline Visualization: Maybe a progress bar or just bold text? Bold text is safer for a static template. e.g., 24 Hours.
Let's get coding. This is a comprehensive single-page application (SPA) prototype for a Content Moderation Law Tracker. It allows you to filter by jurisdiction, view specific legal requirements (takedown speeds, appeals), and track compliance status.
You can save the code below as an .html file (e.g., law_tracker.html) and open it in any browser.
<script> tag.<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Global Content Moderation Law Tracker</title>
<style>
:root {
--bg-color: #f4f7f6;
--card-bg: #ffffff;
--primary: #2c3e50;
--accent: #3498db;
--danger: #e74c3c;
--success: #27ae60;
--warning: #f39c12;
--text-main: #333;
--text-light: #7f8c8d;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: var(--bg-color);
color: var(--text-main);
margin: 0;
padding: 0;
line-height: 1.6;
}
/* Header & Controls */
header {
background-color: var(--primary);
color: white;
padding: 1.5rem 2rem;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.header-content {
max-width: 1400px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 1rem;
}
h1 { margin: 0; font-size: 1.5rem; }
.controls {
display: flex;
gap: 1rem;
align-items: center;
}
select, input {
padding: 0.6rem 1rem;
border-radius: 4px;
border: none;
font-size: 0.9rem;
}
/* Main Grid */
main {
max-width: 1400px;
margin: 2rem auto;
padding: 0 2rem;
}
.stats-bar {
display: flex;
gap: 1rem;
margin-bottom: 1.5rem;
}
.stat-box {
background: var(--card-bg);
padding: 1rem;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
font-size: 0.85rem;
color: var(--text-light);
}
.stat-box strong { display: block; font-size: 1.2rem; color: var(--primary); }
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
gap: 1.5rem;
}
/* Law Cards */
.card {
background: var(--card-bg);
border-radius: 8px;
padding: 1.5rem;
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
transition: transform 0.2s, box-shadow 0.2s;
border-left: 5px solid var(--accent);
cursor: pointer;
position: relative;
}
.card:hover {
transform: translateY(-3px);
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.card-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 1rem;
}
.jurisdiction-tag {
background: #eef2f5;
color: var(--text-main);
padding: 0.2rem 0.6rem;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
}
.card h2 { margin: 0; font-size: 1.1rem; color: var(--primary); }
.card-date { font-size: 0.8rem; color: var(--text-light); margin-bottom: 1rem; display: block;}
/* Visual Timeline Indicator */
.timeline-badge {
display: inline-block;
padding: 0.3rem 0.8rem;
border-radius: 15px;
color: white;
font-weight: bold;
font-size: 0.8rem;
margin-bottom: 1rem;
}
.bg-red { background-color: var(--danger); }
.bg-orange { background-color: var(--warning); }
.bg-green { background-color: var(--success); }
.bg-grey { background-color: #95a5a6; }
.quick-facts {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0.5rem;
font-size: 0.85rem;
}
.fact-label { color: var(--text-light); }
.fact-value { font-weight: 600; text-align: right; }
/* Modal */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.6);
z-index: 1000;
display: none;
align-items: center;
justify-content: center;
padding: 2rem;
}
.modal {
background: white;
width: 100%;
max-width: 700px;
max-height: 90vh;
overflow-y: auto;
border-radius: 8px;
position: relative;
padding: 2rem;
animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
from { transform: translateY(-50px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
.close-btn {
position: absolute;
top: 1rem;
right: 1rem;
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
color: var(--text-light);
}
.section-block {
margin-bottom: 1.5rem;
border-bottom: 1px solid #eee;
padding-bottom: 1rem;
}
.section-block:last-child { border-bottom: none; }
.section-block h3 { color: var(--accent); margin-top: 0; }
.tag-container span {
display: inline-block;
background: #e8f4fc;
color: var(--accent);
padding: 0.2rem 0.5rem;
border-radius: 4px;
font-size: 0.8rem;
margin-right: 0.3rem;
margin-bottom: 0.3rem;
}
</style>
</head>
<body>
<header>
<div class="header-content">
<div>
<h1>Global Content Moderation Tracker</h1>
<p style="margin:5px 0; opacity: 0.8; font-size: 0.9rem;">Monitoring takedown timelines, appeals, and transparency obligations.</p>
</div>
<div class="controls">
<select id="regionFilter">
<option value="all">All Jurisdictions</option>
<option value="EU">Europe (EU)</option>
<option value="APAC">Asia Pacific (APAC)</option>
<option value="Americas">Americas</option>
<option value="UK">United Kingdom</option>
</select>
<input type="text" id="searchInput" placeholder="Search law or country...">
</div>
</div>
</header>
<main>
<div class="stats-bar">
<div class="stat-box">
<strong id="statCount">0</strong>
Active Instruments Tracked
</div>
<div class="stat-box">
<strong style="color:var(--danger)">24h</strong>
Strictest Takedown Standard
</div>
<div class="stat-box">
<strong style="color:var(--accent)">DSA</strong>
Current Major Focus
</div>
</div>
<div class="grid" id="lawGrid">
<!-- Cards will be injected here -->
</div>
</main>
<!-- Detail Modal -->
<div class="modal-overlay" id="modalOverlay">
<div class="modal">
<button class="close-btn" onclick="closeModal()">×</button>
<div id="modalContent">
<!-- Content injected here -->
</div>
</div>
</div>
<script>
// --- DATA SOURCE ---
// Extend this array to add more laws
const lawsData = [
{
id: 1,
name: "Digital Services Act (DSA)",
region: "EU",
country: "European Union",
effectiveDate: "Feb 2024 (Full Application)",
type: "Regulation",
color: "#3498db",
summary: "Landmark regulation setting a new global standard for platform accountability, transparency, and illegal content moderation.",
takedown: {
timeline: "Act 'expeditiously'. Strict deadlines for crisis mechanisms.",
specifics: "Must remove illegal content upon notice. No blanket 24h rule, but 'diligent' action required."
},
appeals: {
process: "Mandatory internal complaint-handling system.",
extrajudicial: "Must allow users to choose an out-of-court dispute resolution body."
},
transparency: {
reporting: "Detailed transparency reports every 6 months (monthly during crises).",
ads: "Ad library required for all ads."
},
leRequests: {
mechanism: "Single Points of Contact (SPOC) for authorities.",
surveillance: "Restrictions on profiling for targeted ads based on sensitive data."
},
severity: "High"
},
{
id: 2,
name: "Network Enforcement Act (NetzDG)",
region: "EU",
country: "Germany",
effectiveDate: "Oct 2017 (Amended 2021)",
type: "Statute",
color: "#e74c3c",
summary: "One of the first strict laws penalizing platforms for failing to remove 'manifestly unlawful' content.",
takedown: {
timeline: "24 hours for manifestly unlawful content.",
specifics: "7 days for complex unlawful content. Fines up to €50M."
},
appeals: {
process: "User can object to deletion. Platform must inform user of decision reasons.",
extrajudicial: "Recognition of self-regulatory bodies."
},
transparency: {
reporting: "Biannual reports on complaint handling (every 6 months).",
ads: "Specific labeling requirements."
},
leRequests: {
mechanism: "Must have a designated contact person in Germany.",
surveillance: "N/A"
},
severity: "High"
},
{
id: 3,
name: "Online Safety Act",
region: "UK",
country: "United Kingdom",
effectiveDate: "Oct 2023",
type: "Statute",
color: "#9b59b6",
summary: "Broad framework requiring platforms to remove illegal content and content harmful to adults/children.",
takedown: {
timeline: "As soon as reasonably practicable.",
specifics: "Priority illegal content must be taken down expeditiously."
},
appeals: {
process: "User appeals mechanisms mandatory for Category 1 services.",
extrajudicial: "OFCOM oversight."
},
transparency: {
reporting: "Annual transparency reports required.",
ads: "Must prevent fraudulent ads."
},
leRequests: {
mechanism: "OFCOM powers to require information.",
surveillance: "Strict end-to-end encryption debates included."
},
severity: "High"
},
{
id: 4,
name: "Information Technology Rules (IT Rules)",
region: "APAC",
country: "India",
effectiveDate: "Feb 2021",
type: "Regulation",
color: "#f39c12",
summary: "Imposes strict due diligence requirements on intermediaries; requires compliance officers.",
takedown: {
timeline: "24 hours (for sensitive content).",
specifics: "36 hours for general content removal upon court/govt order."
},
appeals: {
process: "Grievance Appellate Committee (GAC) established by govt.",
extrajudicial: "Yes, GAC is a government-appointed body."
},
transparency: {
reporting: "Monthly compliance reports mandatory.",
ads: "Disclaimer required for synthetic media/ads."
},
leRequests: {
mechanism: "Must designate Grievance Officer and nodal contact for LEA.",
surveillance: "Pro-active monitoring encouraged in some interpretations."
},
severity: "High"
},
{
id: 5,
name: "Online Safety Act (Basic)",
region: "APAC",
country: "Australia",
effectiveDate: "Jan 2022",
type: "Statute",
color: "#1abc9c",
summary: "eSafety Commissioner has broad powers to demand removal of cyber abuse and illegal content.",
takedown: {
timeline: "24 hours (for Class 1 content after notice).",
specifics: "eSafety Commissioner can issue removal notices."
},
appeals: {
process: "Appeal to eSafety Commissioner, then Administrative Appeals Tribunal.",
extrajudicial: "Industry codes preferred, fallback to standards."
},
transparency: {
reporting: "Transparency reports encouraged/can be mandated.",
ads: "N/A"
},
leRequests: {
mechanism: "eSafety Commissioner acts as the central authority.",
surveillance: "N/A"
},
severity: "Medium"
},
{
id: 6,
name: "Section 230 (Communications Decency Act)",
region: "Americas",
country: "United States",
effectiveDate: "1996",
type: "Statute",
color: "#7f8c8d",
summary: "Provides immunity for platforms regarding user content. Currently under intense legislative review.",
takedown: {
timeline: "No mandatory timeline.",
specifics: "Voluntary moderation protected."
},
appeals: {
process: "No federal mandate (Private sector driven).",
extrajudicial: "N/A"
},
transparency: {
reporting: "Voluntary (e.g., Transparency Center).",
ads: "FTC guidelines apply."
},
leRequests: {
mechanism: "Standard legal processes (subpoenas/warrants).",
surveillance: "Various (FISA, etc)."
},
severity: "Low (Liability Shield)"
}
];
// --- LOGIC ---
const grid = document.getElementById('lawGrid');
const regionFilter = document.getElementById('regionFilter');
const searchInput = document.getElementById('searchInput');
const statCount = document.getElementById('statCount');
function getTimelineClass(timeline) {
if(timeline.includes("24 hours")) return "bg-red";
if(timeline.includes("expeditiously") || timeline.includes("days")) return "bg-orange";
return "bg-green";
}
function renderCards(data) {
grid.innerHTML = '';
statCount.innerText = data.length;
data.forEach(law => {
const timeClass = getTimelineClass(law.takedown.timeline);
const card = document.createElement('div');
card.className = 'card';
card.style.borderLeftColor = law.color;
card.onclick = () => openModal(law.id);
card.innerHTML = `
<div class="card-header">
<span class="jurisdiction-tag" style="background-color: ${law.color}22; color: ${law.color}">${law.country}</span>
<span style="font-size: 0.8rem; color: var(--text-light)">${law.type}</span>
</div>
<h2>${law.name}</h2>
<span class="card-date">Effective: ${law.effectiveDate}</span>
<div class="timeline-badge ${timeClass}">${law.takedown.timeline}</div>
<div class="quick-facts">
<div class="fact-label">Takedown:</div>
<div class="fact-value">${law.takedown.timeline.split('(')[0]}</div>
<div class="fact-label">Transparency:</div>
<div class="fact-value">${law.transparency.reporting.split('.')[0]}.</div>
<div class="fact-label">Appeals:</div>
<div class="fact-value">${law.appeals.process.split('.')[0]}.</div>
</div>
`;
grid.appendChild(card);
});
}
function filterData() {
const region = regionFilter.value;
const search = searchInput.value.toLowerCase();
const filtered = lawsData.filter(law => {
const matchRegion = (region === 'all' || law.region === region);
const matchSearch = (
law.name.toLowerCase().includes(search) ||
law.country.toLowerCase().includes(search) ||
law.summary.toLowerCase().includes(search)
);
return matchRegion && matchSearch;
});
renderCards(filtered);
}
function findLaw(id) {
return lawsData.find(l => l.id == id);
}
function openModal(id) {
const law = findLaw(id);
const overlay = document.getElementById('modalOverlay');
const content = document.getElementById('modalContent');
content.innerHTML = `
<h2 style="margin-top:0; color: ${law.color}">${law.name}</h2>
<div class="tag-container">
<span>${law.country}</span>
<span>${law.type}</span>
<span>Effective: ${law.effectiveDate}</span>
</div>
<p>${law.summary}</p>
<div class="section-block">
<h3>Takedown Timeline</h3>
<p><strong>Standard:</strong> ${law.takedown.timeline}</p>
<p><strong>Specifics:</strong> ${law.takedown.specifics}</p>
</div>
<div class="section-block">
<h3>Appeals Process</h3>
<p><strong>Internal:</strong> ${law.appeals.process}</p>
<p><strong>External/Extrajudicial:</strong> ${law.appeals.extrajudicial}</p>
</div>
<div class="section-block">
<h3>Transparency Requirements</h3>
<p><strong>Reporting:</strong> ${law.transparency.reporting}</p>
<p><strong>Advertising:</strong> ${law.transparency.ads}</p>
</div>
<div class="section-block">
<h3>Law Enforcement (LE) Requests</h3>
<p><strong>Mechanism:</strong> ${law.leRequests.mechanism}</p>
<p><strong>Surveillance/Data:</strong> ${law.leRequests.surveillance}</p>
</div>
`;
overlay.style.display = 'flex';
}
function closeModal() {
document.getElementById('modalOverlay').style.display = 'none';
}
// Close modal if clicking outside
window.onclick = function(event) {
if (event.target == document.getElementById('modalOverlay')) {
closeModal();
}
}
// Initialize
regionFilter.addEventListener('change', filterData);
searchInput.addEventListener('keyup', filterData);
renderCards(lawsData);
</script>
</body>
</html>