diff --git a/public/js/peGuide.js b/public/js/peGuide.js index 5c97a46..d87c86a 100644 --- a/public/js/peGuide.js +++ b/public/js/peGuide.js @@ -249,41 +249,60 @@ // ──────────────────────────────────────────────────────────── // Each entry maps to a key in window.RespSounds (respiratorySounds.js). // Displayed as a dedicated card at the top of the Respiratory system. + // src = real recording path; if absent, the player falls back to synthesis var RESP_SOUNDS = [ - { key: 'normal', title: 'Normal vesicular breath sounds', + { key: 'normal', src: null, title: 'Normal vesicular breath sounds', where: 'Peripheral lung fields', features: 'Soft, rustling. Inspiration louder and longer than expiration.', clinical: 'Baseline — deviation elsewhere is what you listen for.' }, - { key: 'wheeze', title: 'Wheeze', + { key: 'wheeze', src: '/audio/respiratory/wheeze.ogg', title: 'Wheeze', where: 'Diffuse in asthma; localised in foreign body', features: 'Continuous, high-pitched, musical. Usually expiratory; biphasic if severe.', clinical: 'Lower-airway narrowing — asthma, bronchiolitis, foreign body, bronchomalacia. Silent chest in severe asthma is an ominous sign.' }, - { key: 'stridor', title: 'Stridor', + { key: 'stridor', src: '/audio/respiratory/stridor.ogg', title: 'Stridor', where: 'Louder over neck than chest — upper airway', features: 'Continuous, high-pitched, harsh. Classically inspiratory (extrathoracic obstruction); biphasic if fixed.', clinical: 'Croup, epiglottitis, foreign body, laryngomalacia (infant). Distinguish from wheeze by auscultating the neck — stridor is loudest there.' }, - { key: 'finecrackles', title: 'Fine (end-inspiratory) crackles', + { key: 'finecrackles', src: '/audio/respiratory/crackles-fine.ogg', title: 'Fine (end-inspiratory) crackles', where: 'Bibasilar in pulmonary edema/fibrosis; focal in pneumonia', features: 'Discontinuous, brief, high-pitched. "Velcro" quality. Late inspiratory, do NOT clear with cough.', clinical: 'Alveolar opening — pulmonary fibrosis, pulmonary edema, early pneumonia, atelectasis.' }, - { key: 'coarsecrackles', title: 'Coarse crackles', + { key: 'coarsecrackles', src: '/audio/respiratory/crackles-coarse.ogg', title: 'Coarse crackles', where: 'Lower lobes; either side', features: 'Discontinuous, longer and louder than fine crackles. Lower-pitched. Can be early or late inspiratory; often clear partly with cough.', clinical: 'Secretions in larger airways — bronchitis, later pneumonia, bronchiectasis, aspiration.' }, - { key: 'rhonchi', title: 'Rhonchi', + { key: 'rhonchi', src: null, title: 'Rhonchi', where: 'Central or anywhere with airway secretions', features: 'Continuous, low-pitched, snore-like. Typically expiratory. Clear or change with cough.', clinical: 'Large-airway secretions — bronchitis, pneumonia with large-airway involvement, cystic fibrosis, bronchiectasis.' }, - { key: 'pleuralrub', title: 'Pleural friction rub', + { key: 'pleuralrub', src: null, title: 'Pleural friction rub', where: 'Focal, often lateral or posterior lower chest', features: 'Grating, creaky — "leather on leather". Biphasic (heard in inspiration and expiration). Does NOT clear with cough.', clinical: 'Pleural inflammation — pleuritis, pulmonary embolism, pneumonia with pleural involvement, viral pleurisy.' }, - { key: 'grunting', title: 'Expiratory grunting', + { key: 'grunting', src: null, title: 'Expiratory grunting', where: 'Audible without stethoscope in infants', features: 'Short, low-pitched sound at the end of each expiration. Physiologic PEEP against a partially closed glottis.', clinical: 'Sign of significant respiratory distress in an infant — RDS, pneumonia, sepsis, congenital heart disease with heart failure.' } ]; + // ──────────────────────────────────────────────────────────── + // CARDIAC SOUNDS LIBRARY — real recordings from Wikimedia Commons + // ──────────────────────────────────────────────────────────── + var CARDIAC_SOUNDS = [ + { key: 'normal', src: '/audio/cardiac/normal.ogg', title: 'Normal heart sounds (S1, S2)', + where: 'All four classic auscultation points', rate: '61 bpm in this sample', + features: '"lub-dub": S1 (closure of mitral + tricuspid) louder at apex; S2 (closure of aortic + pulmonic) louder at base. Physiologic S2 split on inspiration.', + clinical: 'Reference for rhythm, rate, and the normal S1–S2 interval. Listen for what\'s changed — not just what\'s added.' }, + { key: 'vsd', src: '/audio/cardiac/vsd.wav', title: 'Ventricular septal defect (VSD)', + where: 'Lower left sternal border (4th ICS)', + features: 'Harsh, blowing, holosystolic (pansystolic) murmur — plateau shape through all of systole. Often accompanied by a thrill if large.', + clinical: 'Most common congenital heart defect. Small VSD: loud murmur, usually asymptomatic, may close spontaneously. Large VSD: softer murmur (less pressure gradient) but signs of heart failure, pulmonary hypertension.' }, + { key: 'mvp', src: '/audio/cardiac/mitral-prolapse.wav', title: 'Mitral valve prolapse (MVP) — click + late systolic murmur', + where: 'Apex (5th ICS, mid-clavicular line)', + features: 'Mid-systolic click followed by a late-systolic crescendo murmur. Timing of click changes with maneuvers: earlier with standing or Valsalva, later with squatting.', + clinical: 'Often benign, especially in thin young women. Features suggesting need for echo: thickened/redundant leaflets on exam, associated mitral regurgitation, symptoms (palpitations, chest pain), arrhythmias.' } + ]; + // ──────────────────────────────────────────────────────────── // DATA // ──────────────────────────────────────────────────────────── @@ -1356,6 +1375,46 @@ document.getElementById('pe-generate-btn').addEventListener('click', generate); } + // Responsive two-column grid helper: side-by-side on wide screens, stacked on narrow + var TWO_COL_GRID = 'display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px;align-items:start;'; + + // Render a single sound card with native