JIT
Creating an advanced ECG monitor with object tracking capabilities
make an advanced ECG monitor that tracks actual objects close to this device

Creating an advanced ECG monitor that tracks nearby objects would require combining physiological signal processing with proximity detection. Here's a comprehensive implementation:

This implementation includes:

  1. A simulated ECG monitor with realistic waveform generation
  2. Proximity detection visualization
  3. Combined analysis that detects when elevated heart rate coincides with nearby objects
  4. Responsive UI with status indicators and alerts

The simulation uses:

  • Canvas for real-time waveform rendering
  • Simulated data generation for both ECG and proximity
  • Combined analysis logic to detect potential stress responses to nearby objects
Updated files
v1
can you make it the classic sumberine circle line spinning thing that tracks actual objects or organisms close to this device by temperature and heart rate

Here's an implementation of a classic submarine sonar-style display that tracks objects/organisms using simulated temperature and heart rate data:

This implementation features:

  1. Classic submarine sonar circular display with rotating sweep
  2. Simulated targets with:
    • Distance tracking
    • Temperature detection (color-coded)
    • Heart rate monitoring (pulsing indicators)
  3. Fading echo trails for detected objects
  4. Status panel showing:
    • Target count
    • Nearest distance
    • Average temperature
    • Average heart rate
  5. Alert system for warm-blooded organisms
  6. Realistic sonar effects with fading history

The display updates in real-time with the rotating sweep detecting objects within its path. Warm-blooded organisms (temperature >30°C) trigger alerts.

Updated files
v2
can you make the sonar sound? can you also make an alert noise of a close target?

Here's the updated version with sonar sound effects and proximity alerts:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Submarine Sonar with Audio</title>
  <style>
    body {
      margin: 0;
      padding: 0;
      background-color: #000;
      overflow: hidden;
      font-family: 'Courier New', monospace;
      color: #0f0;
    }
    .container {
      display: flex;
      flex-direction: column;
      align-items: center;
      height: 100vh;
    }
    canvas {
      display: block;
      margin: 20px auto;
    }
    .status-panel {
      position: absolute;
      bottom: 20px;
      left: 20px;
      background-color: rgba(0, 50, 0, 0.7);
      padding: 10px;
      border-radius: 5px;
      border: 1px solid #0f0;
    }
    .alert {
      color: #f00;
      font-weight: bold;
      animation: blink 1s infinite;
    }
    @keyframes blink {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.5; }
    }
    #audioControls {
      position: absolute;
      top: 20px;
      right: 20px;
      background-color: rgba(0, 50, 0, 0.7);
      padding: 10px;
      border-radius: 5px;
      border: 1px solid #0f0;
    }
  </style>
</head>
<body>
  <div class="container">
    <canvas id="sonarCanvas"></canvas>
    <div class="status-panel">
      <div>Active targets: <span id="targetCount">0</span></div>
      <div>Nearest target: <span id="nearestDistance">--</span> m</div>
      <div>Avg temp: <span id="avgTemp">--</span>°C</div>
      <div>Avg BPM: <span id="avgBpm">--</span></div>
      <div>Status: <span id="status">OPERATIONAL</span></div>
    </div>
    <div id="audioControls">
      <button id="toggleAudio">Toggle Audio</button>
    </div>
  </div>

  <audio id="sonarPing" src="https://assets.mixkit.co/sfx/preview/mixkit-sonar-ping-1000.mp3" preload="auto"></audio>
  <audio id="alertSound" src="https://assets.mixkit.co/sfx/preview/mixkit-alarm-digital-clock-beep-989.mp3" preload="auto"></audio>

  <script>
    // Sonar Configuration
    const config = {
      radius: 300,
      sweepSpeed: 0.5,
      maxDistance: 100, // meters
      detectionThreshold: 0.7,
      maxTargets: 10,
      pingInterval: 2000, // ms
      alertDistance: 30 // meters
    };

    // Audio elements
    const sonarPing = document.getElementById('sonarPing');
    const alertSound = document.getElementById('alertSound');
    const toggleAudioBtn = document.getElementById('toggleAudio');
    let audioEnabled = true;
    let lastPingTime = 0;
    let alertPlaying = false;

    // Canvas setup
    const canvas = document.getElementById('sonarCanvas');
    const ctx = canvas.getContext('2d');
    canvas.width = Math.min(800, window.innerWidth - 40);
    canvas.height = Math.min(800, window.innerHeight - 40);
    const center = { x: canvas.width / 2, y: canvas.height / 2 };

    // Sonar state
    let sweepAngle = 0;
    let targets = [];
    let lastDetectionTime = 0;

    // Audio controls
    toggleAudioBtn.addEventListener('click', () => {
      audioEnabled = !audioEnabled;
      toggleAudioBtn.textContent = audioEnabled ? 'Disable Audio' : 'Enable Audio';
    });