LAPD CAD Simulator
Here's a single-file web application that simulates a police Computer Aided Dispatch (CAD) system. It includes features like active calls management, BOLO (Be On the Lookout) alerts, unit status tracking, and incident logging - all saved to local storage.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LAPD CAD Simulator</title>
<style>
:root {
--primary-color: #003366;
--secondary-color: #0066cc;
--accent-color: #ff9900;
--light-color: #f0f5ff;
--dark-color: #001a33;
--danger-color: #cc0000;
--success-color: #006600;
--warning-color: #cc6600;
--gray-color: #cccccc;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
background-color: #f0f0f0;
color: #333;
height: 100vh;
display: flex;
flex-direction: column;
}
header {
background-color: var(--primary-color);
color: white;
padding: 10px 20px;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.logo {
display: flex;
align-items: center;
gap: 10px;
}
.logo h1 {
font-size: 1.5rem;
}
.badge {
width: 40px;
height: 40px;
background-color: gold;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
color: var(--primary-color);
font-weight: bold;
border: 2px solid white;
}
.header-controls {
display: flex;
gap: 15px;
align-items: center;
}
.clock {
background-color: rgba(255, 255, 255, 0.2);
padding: 5px 10px;
border-radius: 4px;
font-family: monospace;
font-size: 1.1rem;
}
.user-info {
display: flex;
align-items: center;
gap: 10px;
}
.user-avatar {
width: 35px;
height: 35px;
background-color: var(--light-color);
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
color: var(--primary-color);
font-weight: bold;
}
main {
display: flex;
flex: 1;
overflow: hidden;
}
nav {
width: 200px;
background-color: var(--dark-color);
color: white;
padding: 20px 0;
}
.nav-item {
padding: 12px 20px;
cursor: pointer;
transition: background-color 0.2s;
display: flex;
align-items: center;
gap: 10px;
}
.nav-item:hover {
background-color: rgba(255, 255, 255, 0.1);
}
.nav-item.active {
background-color: var(--secondary-color);
border-left: 4px solid var(--accent-color);
}
.content {
flex: 1;
padding: 20px;
overflow-y: auto;
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
.dashboard-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 20px;
margin-bottom: 20px;
}
.card {
background-color: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
padding: 15px;
height: 100%;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 1px solid #eee;
}
.card-title {
font-size: 1.1rem;
font-weight: 600;
color: var(--primary-color);
}
.card-body {
height: calc(100% - 50px);
overflow-y: auto;
}
.stat-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 15px;
}
.stat-item {
text-align: center;
padding: 10px;
background-color: var(--light-color);
border-radius: 6px;
}
.stat-value {
font-size: 1.8rem;
font-weight: bold;
color: var(--secondary-color);
}
.stat-label {
font-size: 0.9rem;
color: #666;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
padding: 10px;
text-align: left;
border-bottom: 1px solid #eee;
}
th {
background-color: var(--light-color);
color: var(--primary-color);
font-weight: 600;
}
tr:hover {
background-color: #f9f9f9;
}
.status-indicator {
width: 12px;
height: 12px;
border-radius: 50%;
display: inline-block;
margin-right: 5px;
}
.status-available {
background-color: var(--success-color);
}
.status-busy {
background-color: var(--danger-color);
}
.status-enroute {
background-color: var(--warning-color);
}
.status-onscene {
background-color: var(--accent-color);
}
.btn {
padding: 8px 15px;
border: none;
border-radius: 4px;
cursor: pointer;
font-weight: 500;
transition: background-color 0.2s;
}
.btn-primary {
background-color: var(--secondary-color);
color: white;
}
.btn-primary:hover {
background-color: var(--primary-color);
}
.btn-danger {
background-color: var(--danger-color);
color: white;
}
.btn-danger:hover {
background-color: #990000;
}
.btn-success {
background-color: var(--success-color);
color: white;
}
.btn-success:hover {
background-color: #004d00;
}
.btn-warning {
background-color: var(--warning-color);
color: white;
}
.btn-warning:hover {
background-color: #994d00;
}
.form-group {
margin-bottom: 15px;
}
label {
display: block;
margin-bottom: 5px;
font-weight: 500;
}
input, select, textarea {
width: 100%;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 1rem;
}
textarea {
min-height: 100px;
resize: vertical;
}
.priority-high {
color: var(--danger-color);
font-weight: bold;
}
.priority-medium {
color: var(--warning-color);
font-weight: bold;
}
.priority-low {
color: var(--success-color);
}
.call-list {
display: flex;
flex-direction: column;
gap: 10px;
}
.call-item {
background-color: white;
border-radius: 6px;
padding: 15px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
border-left: 4px solid var(--gray-color);
}
.call-item.priority-1 {
border-left-color: var(--danger-color);
}
.call-item.priority-2 {
border-left-color: var(--warning-color);
}
.call-item.priority-3 {
border-left-color: var(--success-color);
}
.call-header {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
}
.call-id {
font-weight: bold;
color: var(--primary-color);
}
.call-time {
color: #666;
font-size: 0.9rem;
}
.call-type {
font-weight: bold;
margin-bottom: 5px;
}
.call-location {
margin-bottom: 5px;
}
.call-description {
color: #333;
margin-bottom: 10px;
}
.call-units {
display: flex;
flex-wrap: wrap;
gap: 5px;
margin-top: 10px;
}
.unit-badge {
background-color: var(--light-color);
padding: 3px 8px;
border-radius: 12px;
font-size: 0.8rem;
color: var(--primary-color);
}
.actions {
display: flex;
gap: 10px;
margin-top: 10px;
}
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
display: none;
}
.modal {
background-color: white;
border-radius: 8px;
width: 90%;
max-width: 600px;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.modal-header {
padding: 15px 20px;
border-bottom: 1px solid #eee;
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-title {
font-size: 1.2rem;
font-weight: 600;
color: var(--primary-color);
}
.modal-close {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
color: #666;
}
.modal-body {
padding: 20px;
}
.modal-footer {
padding: 15px 20px;
border-top: 1px solid #eee;
display: flex;
justify-content: flex-end;
gap: 10px;
}
.bolo-item {
background-color: #fff9e6;
border: 1px solid #ffe0b2;
border-radius: 6px;
padding: 15px;
margin-bottom: 15px;
}
.bolo-header {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
}
.bolo-title {
font-weight: bold;
color: var(--warning-color);
}
.bolo-date {
color: #666;
font-size: 0.9rem;
}
.bolo-description {
margin-bottom: 10px;
}
.bolo-details {
background-color: rgba(255, 255, 255, 0.7);
padding: 10px;
border-radius: 4px;
}
.detail-row {
display: flex;
margin-bottom: 5px;
}
.detail-label {
font-weight: 500;
width: 120px;
color: #555;
}
.notification {
position: fixed;
top: 20px;
right: 20px;
background-color: var(--primary-color);
color: white;
padding: 15px 20px;
border-radius: 6px;
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
z-index: 1100;
transform: translateX(150%);
transition: transform 0.3s ease-out;
}
.notification.show {
transform: translateX(0);
}
.notification-title {
font-weight: bold;
margin-bottom: 5px;
}
.notification-body {
font-size: 0.9rem;
}
.search-bar {
margin-bottom: 20px;
display: flex;
gap: 10px;
}
.search-bar input {
flex: 1;
}
.tabs {
display: flex;
border-bottom: 1px solid #ddd;
margin-bottom: 20px;
}
.tab {
padding: 10px 20px;
cursor: pointer;
border-bottom: 3px solid transparent;
}
.tab.active {
border-bottom-color: var(--secondary-color);
color: var(--secondary-color);
font-weight: 500;
}
.inner-tab-content {
display: none;
}
.inner-tab-content.active {
display: block;
}
.record-item {
background-color: white;
border-radius: 6px;
padding: 15px;
margin-bottom: 15px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.record-header {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
padding-bottom: 10px;
border-bottom: 1px solid #eee;
}
.record-title {
font-weight: bold;
color: var(--primary-color);
}
.record-id {
color: #666