Spaces:
Running
Running
| export interface Substance { | |
| id: string; | |
| name: string; | |
| formula: string; | |
| category: 'acid' | 'base' | 'salt' | 'indicator' | 'solvent' | 'metal' | 'organic' | 'gas'; | |
| color: string; | |
| bgColor: string; | |
| borderColor: string; | |
| state: 'solid' | 'liquid' | 'gas' | 'aqueous'; | |
| hazard: 'none' | 'low' | 'medium' | 'high'; | |
| description: string; | |
| } | |
| export const substances: Substance[] = [ | |
| // Acides | |
| { | |
| id: 'hcl', | |
| name: 'Acide chlorhydrique', | |
| formula: 'HCl', | |
| category: 'acid', | |
| color: 'text-red-600', | |
| bgColor: 'bg-red-50', | |
| borderColor: 'border-red-500', | |
| state: 'aqueous', | |
| hazard: 'high', | |
| description: 'Acide fort corrosif', | |
| }, | |
| { | |
| id: 'h2so4', | |
| name: 'Acide sulfurique', | |
| formula: 'H₂SO₄', | |
| category: 'acid', | |
| color: 'text-red-700', | |
| bgColor: 'bg-red-100', | |
| borderColor: 'border-red-600', | |
| state: 'liquid', | |
| hazard: 'high', | |
| description: 'Acide fort très corrosif', | |
| }, | |
| { | |
| id: 'hno3', | |
| name: 'Acide nitrique', | |
| formula: 'HNO₃', | |
| category: 'acid', | |
| color: 'text-yellow-700', | |
| bgColor: 'bg-yellow-50', | |
| borderColor: 'border-yellow-600', | |
| state: 'aqueous', | |
| hazard: 'high', | |
| description: 'Acide oxydant', | |
| }, | |
| { | |
| id: 'ch3cooh', | |
| name: 'Acide acétique', | |
| formula: 'CH₃COOH', | |
| category: 'acid', | |
| color: 'text-orange-600', | |
| bgColor: 'bg-orange-50', | |
| borderColor: 'border-orange-500', | |
| state: 'liquid', | |
| hazard: 'medium', | |
| description: 'Acide faible (vinaigre)', | |
| }, | |
| { | |
| id: 'h3po4', | |
| name: 'Acide phosphorique', | |
| formula: 'H₃PO₄', | |
| category: 'acid', | |
| color: 'text-red-500', | |
| bgColor: 'bg-red-50', | |
| borderColor: 'border-red-400', | |
| state: 'aqueous', | |
| hazard: 'medium', | |
| description: 'Acide moyennement fort', | |
| }, | |
| // Bases | |
| { | |
| id: 'naoh', | |
| name: 'Hydroxyde de sodium', | |
| formula: 'NaOH', | |
| category: 'base', | |
| color: 'text-blue-600', | |
| bgColor: 'bg-blue-50', | |
| borderColor: 'border-blue-500', | |
| state: 'aqueous', | |
| hazard: 'high', | |
| description: 'Base forte (soude)', | |
| }, | |
| { | |
| id: 'koh', | |
| name: 'Hydroxyde de potassium', | |
| formula: 'KOH', | |
| category: 'base', | |
| color: 'text-blue-700', | |
| bgColor: 'bg-blue-100', | |
| borderColor: 'border-blue-600', | |
| state: 'aqueous', | |
| hazard: 'high', | |
| description: 'Base forte (potasse)', | |
| }, | |
| { | |
| id: 'nh3', | |
| name: 'Ammoniaque', | |
| formula: 'NH₃', | |
| category: 'base', | |
| color: 'text-cyan-600', | |
| bgColor: 'bg-cyan-50', | |
| borderColor: 'border-cyan-500', | |
| state: 'aqueous', | |
| hazard: 'medium', | |
| description: 'Base faible', | |
| }, | |
| { | |
| id: 'caoh2', | |
| name: 'Hydroxyde de calcium', | |
| formula: 'Ca(OH)₂', | |
| category: 'base', | |
| color: 'text-blue-500', | |
| bgColor: 'bg-blue-50', | |
| borderColor: 'border-blue-400', | |
| state: 'aqueous', | |
| hazard: 'medium', | |
| description: 'Base moyenne (chaux)', | |
| }, | |
| // Sels | |
| { | |
| id: 'nacl', | |
| name: 'Chlorure de sodium', | |
| formula: 'NaCl', | |
| category: 'salt', | |
| color: 'text-gray-600', | |
| bgColor: 'bg-gray-50', | |
| borderColor: 'border-gray-500', | |
| state: 'solid', | |
| hazard: 'none', | |
| description: 'Sel de table', | |
| }, | |
| { | |
| id: 'caco3', | |
| name: 'Carbonate de calcium', | |
| formula: 'CaCO₃', | |
| category: 'salt', | |
| color: 'text-stone-600', | |
| bgColor: 'bg-stone-50', | |
| borderColor: 'border-stone-500', | |
| state: 'solid', | |
| hazard: 'none', | |
| description: 'Calcaire, craie', | |
| }, | |
| { | |
| id: 'cuso4', | |
| name: 'Sulfate de cuivre', | |
| formula: 'CuSO₄', | |
| category: 'salt', | |
| color: 'text-sky-600', | |
| bgColor: 'bg-sky-100', | |
| borderColor: 'border-sky-500', | |
| state: 'solid', | |
| hazard: 'medium', | |
| description: 'Cristaux bleus', | |
| }, | |
| { | |
| id: 'agno3', | |
| name: 'Nitrate d\'argent', | |
| formula: 'AgNO₃', | |
| category: 'salt', | |
| color: 'text-slate-700', | |
| bgColor: 'bg-slate-50', | |
| borderColor: 'border-slate-600', | |
| state: 'solid', | |
| hazard: 'medium', | |
| description: 'Sel d\'argent', | |
| }, | |
| { | |
| id: 'kcl', | |
| name: 'Chlorure de potassium', | |
| formula: 'KCl', | |
| category: 'salt', | |
| color: 'text-gray-500', | |
| bgColor: 'bg-gray-50', | |
| borderColor: 'border-gray-400', | |
| state: 'solid', | |
| hazard: 'low', | |
| description: 'Sel de potassium', | |
| }, | |
| // Indicateurs | |
| { | |
| id: 'phenol', | |
| name: 'Phénolphtaléine', | |
| formula: 'C₂₀H₁₄O₄', | |
| category: 'indicator', | |
| color: 'text-pink-600', | |
| bgColor: 'bg-pink-50', | |
| borderColor: 'border-pink-500', | |
| state: 'liquid', | |
| hazard: 'low', | |
| description: 'Indicateur pH (incolore → rose)', | |
| }, | |
| { | |
| id: 'bbt', | |
| name: 'Bleu de bromothymol', | |
| formula: 'C₂₇H₂₈Br₂O₅S', | |
| category: 'indicator', | |
| color: 'text-blue-500', | |
| bgColor: 'bg-blue-50', | |
| borderColor: 'border-blue-400', | |
| state: 'liquid', | |
| hazard: 'low', | |
| description: 'Indicateur pH (jaune → bleu)', | |
| }, | |
| { | |
| id: 'litmus', | |
| name: 'Tournesol', | |
| formula: '—', | |
| category: 'indicator', | |
| color: 'text-purple-600', | |
| bgColor: 'bg-purple-50', | |
| borderColor: 'border-purple-500', | |
| state: 'liquid', | |
| hazard: 'none', | |
| description: 'Indicateur naturel', | |
| }, | |
| // Solvants | |
| { | |
| id: 'water', | |
| name: 'Eau distillée', | |
| formula: 'H₂O', | |
| category: 'solvent', | |
| color: 'text-cyan-500', | |
| bgColor: 'bg-cyan-50', | |
| borderColor: 'border-cyan-400', | |
| state: 'liquid', | |
| hazard: 'none', | |
| description: 'Solvant universel', | |
| }, | |
| { | |
| id: 'ethanol', | |
| name: 'Éthanol', | |
| formula: 'C₂H₅OH', | |
| category: 'solvent', | |
| color: 'text-amber-600', | |
| bgColor: 'bg-amber-50', | |
| borderColor: 'border-amber-500', | |
| state: 'liquid', | |
| hazard: 'medium', | |
| description: 'Alcool éthylique', | |
| }, | |
| { | |
| id: 'acetone', | |
| name: 'Acétone', | |
| formula: 'C₃H₆O', | |
| category: 'solvent', | |
| color: 'text-amber-500', | |
| bgColor: 'bg-amber-50', | |
| borderColor: 'border-amber-400', | |
| state: 'liquid', | |
| hazard: 'medium', | |
| description: 'Solvant organique', | |
| }, | |
| // Métaux | |
| { | |
| id: 'zn', | |
| name: 'Zinc', | |
| formula: 'Zn', | |
| category: 'metal', | |
| color: 'text-slate-600', | |
| bgColor: 'bg-slate-100', | |
| borderColor: 'border-slate-500', | |
| state: 'solid', | |
| hazard: 'low', | |
| description: 'Métal gris-bleuté', | |
| }, | |
| { | |
| id: 'mg', | |
| name: 'Magnésium', | |
| formula: 'Mg', | |
| category: 'metal', | |
| color: 'text-slate-400', | |
| bgColor: 'bg-slate-50', | |
| borderColor: 'border-slate-400', | |
| state: 'solid', | |
| hazard: 'medium', | |
| description: 'Métal léger argenté', | |
| }, | |
| { | |
| id: 'fe', | |
| name: 'Fer', | |
| formula: 'Fe', | |
| category: 'metal', | |
| color: 'text-stone-700', | |
| bgColor: 'bg-stone-100', | |
| borderColor: 'border-stone-600', | |
| state: 'solid', | |
| hazard: 'low', | |
| description: 'Métal ferromagnétique', | |
| }, | |
| { | |
| id: 'cu', | |
| name: 'Cuivre', | |
| formula: 'Cu', | |
| category: 'metal', | |
| color: 'text-orange-700', | |
| bgColor: 'bg-orange-100', | |
| borderColor: 'border-orange-600', | |
| state: 'solid', | |
| hazard: 'low', | |
| description: 'Métal rouge-orangé', | |
| }, | |
| { | |
| id: 'al', | |
| name: 'Aluminium', | |
| formula: 'Al', | |
| category: 'metal', | |
| color: 'text-gray-400', | |
| bgColor: 'bg-gray-100', | |
| borderColor: 'border-gray-400', | |
| state: 'solid', | |
| hazard: 'low', | |
| description: 'Métal léger argenté', | |
| }, | |
| // Organiques | |
| { | |
| id: 'glucose', | |
| name: 'Glucose', | |
| formula: 'C₆H₁₂O₆', | |
| category: 'organic', | |
| color: 'text-yellow-600', | |
| bgColor: 'bg-yellow-50', | |
| borderColor: 'border-yellow-500', | |
| state: 'solid', | |
| hazard: 'none', | |
| description: 'Sucre simple', | |
| }, | |
| { | |
| id: 'urea', | |
| name: 'Urée', | |
| formula: 'CH₄N₂O', | |
| category: 'organic', | |
| color: 'text-lime-600', | |
| bgColor: 'bg-lime-50', | |
| borderColor: 'border-lime-500', | |
| state: 'solid', | |
| hazard: 'low', | |
| description: 'Composé organique azoté', | |
| }, | |
| // Gaz | |
| { | |
| id: 'o2', | |
| name: 'Dioxygène', | |
| formula: 'O₂', | |
| category: 'gas', | |
| color: 'text-sky-400', | |
| bgColor: 'bg-sky-50', | |
| borderColor: 'border-sky-300', | |
| state: 'gas', | |
| hazard: 'medium', | |
| description: 'Gaz comburant', | |
| }, | |
| { | |
| id: 'co2', | |
| name: 'Dioxyde de carbone', | |
| formula: 'CO₂', | |
| category: 'gas', | |
| color: 'text-gray-500', | |
| bgColor: 'bg-gray-100', | |
| borderColor: 'border-gray-400', | |
| state: 'gas', | |
| hazard: 'low', | |
| description: 'Gaz carbonique', | |
| }, | |
| { | |
| id: 'h2', | |
| name: 'Dihydrogène', | |
| formula: 'H₂', | |
| category: 'gas', | |
| color: 'text-indigo-400', | |
| bgColor: 'bg-indigo-50', | |
| borderColor: 'border-indigo-300', | |
| state: 'gas', | |
| hazard: 'high', | |
| description: 'Gaz inflammable', | |
| }, | |
| ]; | |
| export const categoryLabels: Record<string, string> = { | |
| acid: '🧪 Acides', | |
| base: '⚗️ Bases', | |
| salt: '🧂 Sels', | |
| indicator: '🎨 Indicateurs', | |
| solvent: '💧 Solvants', | |
| metal: '⚙️ Métaux', | |
| organic: '🌿 Organiques', | |
| gas: '💨 Gaz', | |
| }; | |
| export const getSubstancesByCategory = (category: string) => { | |
| return substances.filter(s => s.category === category); | |
| }; | |