I'll create a futuristic IP camera security view page for you. This will include layout selection, IP camera connection simulation, and motion detection area painting functionality.
html Copy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SecureVision Pro - IP Camera Security System</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
color: #00ffff;
min-height: 100vh;
overflow-x: hidden;
}
.header {
background: rgba(0, 255, 255, 0.1);
backdrop-filter: blur(10px);
padding: 20px;
border-bottom: 2px solid #00ffff;
box-shadow: 0 4px 20px rgba(0, 255, 255, 0.3);
}
.header h1 {
text-align: center;
font-size: 2.5em;
text-shadow: 0 0 20px #00ffff;
animation: glow 2s ease-in-out infinite alternate;
}
@keyframes glow {
from { text-shadow: 0 0 20px #00ffff, 0 0 30px #00ffff; }
to { text-shadow: 0 0 30px #00ffff, 0 0 40px #00ffff; }
}
.controls {
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
gap: 20px;
}
.layout-selector {
background: rgba(0, 255, 255, 0.1);
border: 2px solid #00ffff;
border-radius: 10px;
padding: 10px 20px;
color: #00ffff;
font-size: 16px;
cursor: pointer;
transition: all 0.3s ease;
}
.layout-selector:hover {
background: rgba(0, 255, 255, 0.2);
box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}
.paint-mode-btn {
background: linear-gradient(45deg, #ff6b6b, #ee5a24);
border: none;
border-radius: 10px;
padding: 10px 20px;
color: white;
font-size: 16px;
cursor: pointer;
transition: all 0.3s ease;
text-transform: uppercase;
font-weight: bold;
}
.paint-mode-btn.active {
background: linear-gradient(45deg, #00ff00, #32cd32);
box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}
.camera-grid {
padding: 20px;
display: grid;
gap: 20px;
max-width: 1400px;
margin: 0 auto;
}
.grid-1x1 { grid-template-columns: 1fr; }
.grid-2x2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.grid-3x3 { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; }
.grid-2x3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; }
.camera-slot {
position: relative;
aspect-ratio: 16/9;
border: 2px dashed #00ffff;
border-radius: 15px;
background: rgba(0, 255, 255, 0.05);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
min-height: 200px;
overflow: hidden;
}
.camera-slot:hover {
border-color: #ff6b6b;
background: rgba(255, 107, 107, 0.1);
box-shadow: 0 0 25px rgba(0, 255, 255, 0.3);
}
.camera-slot.connected {
border: 2px solid #00ff00;
background: #000;
}
.camera-slot.connected:hover {
border-color: #00ff00;
}
.placeholder-text {
text-align: center;
font-size: 18px;
opacity: 0.7;
}
.camera-feed {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 13px;
}
.camera-info {
position: absolute;
top: 10px;
left: 10px;
background: rgba(0, 0, 0, 0.8);
color: #00ffff;
padding: 5px 10px;
border-radius: 5px;
font-size: 12px;
z-index: 10;
}
.disconnect-btn {
position: absolute;
top: 10px;
right: 10px;
background: #ff4757;
border: none;
color: white;
padding: 5px 10px;
border-radius: 5px;
cursor: pointer;
font-size: 12px;
z-index: 10;
}
.canvas-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 5;
}
.canvas-overlay.paint-mode {
pointer-events: all;
cursor: crosshair;
}
.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
backdrop-filter: blur(5px);
}
.modal-content {
background: linear-gradient(135deg, #1a1a2e, #16213e);
margin: 15% auto;
padding: 30px;
border: 2px solid #00ffff;
border-radius: 15px;
width: 400px;
text-align: center;
box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}
.modal-content h2 {
margin-bottom: 20px;
color: #00ffff;
}
.modal-content input {
width: 100%;
padding: 15px;
margin: 10px 0;
background: rgba(0, 255, 255, 0.1);
border: 2px solid #00ffff;
border-radius: 10px;
color: #00ffff;
font-size: 16px;
}
.modal-content input::placeholder {
color: rgba(0, 255, 255, 0.5);
}
.modal-buttons {
display: flex;
gap: 15px;
margin-top: 20px;
}
.btn {
flex: 1;
padding: 15px;
border: none;
border-radius: 10px;
cursor: pointer;
font-size: 16px;
font-weight: bold;
transition: all 0.3s ease;
}
.btn-primary {
background: linear-gradient(45deg, #00ffff, #0077ff);
color: white;
}
.btn-secondary {
background: linear-gradient(45deg, #666, #888);
color: white;
}
.btn:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.status-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 255, 255, 0.1);
backdrop-filter: blur(10px);
padding: 10px 20px;
border-top: 1px solid #00ffff;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 14px;
}
.recording-indicator {
display: flex;
align-items: center;
gap: 10px;
}
.recording-dot {
width: 10px;
height: 10px;
background: #ff4757;
border-radius: 50%;
animation: pulse 1s infinite;
}
@keyframes pulse {
0% { opacity: 1; }
50% { opacity: 0.3; }
100% { opacity: 1; }
}
</style>
</head>
<body>
<div class="header">
<h1>🛡️ SecureVision Pro</h1>
</div>
<div class="controls">
<select class="layout-selector" id="layoutSelector">
<option value="1x1">Single View (1×1)</option>
<option value="2x2" selected>Quad View (2×2)</option>
<option value="3x3">Grid View (3×3)</option>
<option value="2x3">Six View (2×3)</option>
</select>
<button class="paint-mode-btn" id="paintModeBtn">🎨 Motion Detection Mode</button>
</div>
<div class="camera-grid" id="cameraGrid">
<!-- Camera slots will be generated dynamically -->
</div>
<div class="status-bar">
<div class="recording-indicator">
<div class="recording-dot"></div>
<span>System Active - Motion Detection Enabled</span>
</div>
<div>Connected Cameras: <span id="connectedCount">0</span></div>
<div id="currentTime"></div>
</div>
<!-- Modal for IP address input -->
<div id="ipModal" class="modal">
<div class="modal-content">
<h2>🔗 Connect IP Camera</h2>
<input type="text" id="ipInput" placeholder="Enter IP address (e.g., 192.168.1.100)" />
<input type="text" id="portInput" placeholder="Port (optional, default: 80)" />
<div class="modal-buttons">
<button class="btn btn-primary" id="connectBtn">Connect</button>
<button class="btn btn-secondary" id="cancelBtn">Cancel</button>
</div>
</div>
</div>
<script>
class SecuritySystem {
constructor() {
this.cameras = new Map();
this.currentLayout = '2x2';
this.paintMode = false;
this.selectedSlot = null;
this.connectedCameras = 0;
this.initializeEventListeners();
this.generateLayout();
this.updateTime();
setInterval(() => this.updateTime(), 1000);
}
initializeEventListeners() {
document.getElementById('layoutSelector').addEventListener('change', (e) => {
this.currentLayout = e.target.value;
this.generateLayout();
});
document.getElementById('paintModeBtn').addEventListener('click', () => {
this.togglePaintMode();
});
document.getElementById('connectBtn').addEventListener('click', () => {
this.connectCamera();
});
document.getElementById('cancelBtn').addEventListener('click', () => {
this.closeModal();
});
document.getElementById('ipModal').addEventListener('click', (e) => {
if (e.target.id === 'ipModal') {
this.closeModal();
}
});
}
generateLayout() {
const grid = document.getElementById('cameraGrid');
grid.className = `camera-grid grid-${this.currentLayout}`;
const layouts = {
'1x1': 1,
'2x2': 4,
'3x3': 9,
'2x3': 6
};
const slotCount = layouts[this.currentLayout];
grid.innerHTML = '';
for (let i = 0; i < slotCount; i++) {
const slot = this.createCameraSlot(i);
grid.appendChild(slot);
}
}
createCameraSlot(index) {
const slot = document.createElement('div');
slot.className = 'camera-slot';
slot.dataset.index = index;
const placeholder = document.createElement('div');
placeholder.className = 'placeholder-text';
placeholder.innerHTML = `📹<br>Click to add camera<br>Slot ${index + 1}`;
slot.appendChild(placeholder);
slot.addEventListener('click', () => {
if (!slot.classList.contains('connected')) {
this.selectedSlot = slot;
this.openModal();
}
});
return slot;
}
openModal() {
document.getElementById('ipModal').style.display = 'block';
document.getElementById('ipInput').focus();
}
closeModal() {
document.getElementById('ipModal').style.display = 'none';
document.getElementById('ipInput').value = '';
document.getElementById('portInput').value = '';
this.selectedSlot = null;
}
connectCamera() {
const ip = document.getElementById('ipInput').value.trim();
const port = document.getElementById('portInput').value.trim() || '80';
if (!ip) {
alert('Please enter an IP address');
return;
}
if (!this.validateIP(ip)) {
alert('Please enter a valid IP address');
return;
}
this.setupCameraFeed(this.selectedSlot, ip, port);
this.closeModal();
}
validateIP(ip) {
const ipRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
return ipRegex.test(ip);
}
setupCameraFeed(slot, ip, port) {
slot.innerHTML = '';
slot.classList.add('connected');
// Camera info
const info = document.createElement('div');
info.className = 'camera-info';
info.textContent = `📡 ${ip}:${port}`;
slot.appendChild(info);
// Disconnect button
const disconnectBtn = document.createElement('button');
disconnectBtn.className = 'disconnect-btn';
disconnectBtn.textContent = '✕';
disconnectBtn.addEventListener('click', (e) => {
e.stopPropagation();
this.disconnectCamera(slot);
});
slot.appendChild(disconnectBtn);
// Simulated camera feed (in real implementation, this would be actual stream)
const video = document.createElement('video');
video.className = 'camera-feed';
video.autoplay = true;
video.muted = true;
video.loop = true;
// Create a canvas for simulated feed
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
canvas.width = 640;
canvas.height = 360;
// Simulate camera feed with animated content
this.simulateCameraFeed(ctx, canvas);
const stream = canvas.captureStream(30);
video.srcObject = stream;
slot.appendChild(video);
// Canvas for motion detection painting
const overlay = document.createElement('canvas');
overlay.className = 'canvas-overlay';
overlay.width = slot.offsetWidth;
overlay.height = slot.offsetHeight;
slot.appendChild(overlay);
this.setupMotionDetectionCanvas(overlay);
this.connectedCameras++;
this.updateConnectedCount();
}
simulateCameraFeed(ctx, canvas) {
let frame = 0;
const animate = () => {
// Create simulated security camera feed
ctx.fillStyle = '#1a1a1a';
ctx.fillRect(0, 0, canvas.width, canvas.height);
// Simulated room with moving elements
ctx.fillStyle = '#333';
ctx.fillRect(100, 250, 400, 110); // Floor
// Moving "person" simulation
const personX = 50 + (Math.sin(frame * 0.02) + 1) * 200;
ctx.fillStyle = '#ff6b6b';
ctx.beginPath();
ctx.arc(personX, 200, 20, 0, Math.PI * 2);
ctx.fill();
// Timestamp overlay
ctx.fillStyle = '#00ffff';
ctx.font = '14px monospace';
ctx.fillText(new Date().toLocaleString(), 10, 30);
// Motion indicator
if (Math.sin(frame * 0.1) > 0.5) {
ctx.fillStyle = 'rgba(255, 0, 0, 0.3)';
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = '#ff0000';
ctx.font = '16px bold sans-serif';
ctx.fillText('MOTION DETECTED', canvas.width - 180, 50);
}
frame++;
requestAnimationFrame(animate);
};
animate();
}
setupMotionDetectionCanvas(canvas) {
const ctx = canvas.getContext('2d');
let isDrawing = false;
let lastX = 0;
let lastY = 0;
const resizeCanvas = () => {
const rect = canvas.parentElement.getBoundingClientRect();
canvas.width = rect.width;
canvas.height = rect.height;
};
const observer = new ResizeObserver(resizeCanvas);
observer.observe(canvas.parentElement);
resizeCanvas();
const startDrawing = (e) => {
if (!this.paintMode) return;
isDrawing = true;
const rect = canvas.getBoundingClientRect();
lastX = e.clientX - rect.left;
lastY = e.clientY - rect.top;
};
const draw = (e) => {
if (!isDrawing || !this.paintMode) return;
const rect = canvas.getBoundingClientRect();
const currentX = e.clientX - rect.left;
const currentY = e.clientY - rect.top;
ctx.strokeStyle = 'rgba(255, 107, 107, 0.7)';
ctx.lineWidth = 3;
ctx.lineCap = 'round';
ctx.beginPath();
ctx.moveTo(lastX, lastY);
ctx.lineTo(currentX, currentY);
ctx.stroke();
lastX = currentX;
lastY = currentY;
};
const stopDrawing = () => {
isDrawing = false;
};
canvas.addEventListener('mousedown', startDrawing);
canvas.addEventListener('mousemove', draw);
canvas.addEventListener('mouseup', stopDrawing);
canvas.addEventListener('mouseout', stopDrawing);
// Clear motion detection area on double-click
canvas.addEventListener('dblclick', () => {
if (this.paintMode) {
ctx.clearRect(0, 0, canvas.width, canvas.height);
}
});
}
disconnectCamera(slot) {
slot.innerHTML = '';
slot.classList.remove('connected');
const placeholder = document.createElement('div');
placeholder.className = 'placeholder-text';
placeholder.innerHTML = `📹<br>Click to add camera<br>Slot ${slot.dataset.index * 1 + 1}`;
slot.appendChild(placeholder);
slot.addEventListener('click', () => {
if (!slot.classList.contains('connected')) {
this.selectedSlot = slot;
this.openModal();
}
});
this.connectedCameras--;
this.updateConnectedCount();
}
togglePaintMode() {
this.paintMode = !this.paintMode;
const btn = document.getElementById('paintModeBtn');
const canvases = document.querySelectorAll('.canvas-overlay');
if (this.paintMode) {
btn.classList.add('active');
btn.textContent = '✅ Motion Detection Mode (Active)';
canvases.forEach(canvas => canvas.classList.add('paint-mode'));
} else {
btn.classList.remove('active');
btn.textContent = '🎨 Motion Detection Mode';
canvases.forEach(canvas => canvas.classList.remove('paint-mode'));
}
}
updateConnectedCount() {
document.getElementById('connectedCount').textContent = this.connectedCameras;
}
updateTime() {
document.getElementById('currentTime').textContent = new Date().toLocaleString();
}
}
// Initialize the security system when page loads
document.addEventListener('DOMContentLoaded', () => {
new SecuritySystem();
});
</script>
</body>
</html>
This futuristic IP camera security system includes all the features you requested:
The system simulates actual camera feeds since real IP camera integration would require backend services and proper network configuration. In a production environment, you'd integrate with actual IP camera streams using WebRTC or similar technologies.