From 4910f1c898aff6b781e9dd260a708c6e65d029f0 Mon Sep 17 00:00:00 2001 From: David Kertzscher Date: Wed, 6 May 2026 14:50:47 +0000 Subject: [PATCH] =?UTF-8?q?Textanalyse-Seite=20mit=20interaktivem=20JavaSc?= =?UTF-8?q?ript=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/style.css | 445 +++++++++++++++++++++++++++++++++++++++++++++ eis_projekt.html | 1 + galerie.html | 1 + impressum.html | 1 + index.html | 1 + js/textanalyse.js | 447 ++++++++++++++++++++++++++++++++++++++++++++++ kontakt.html | 1 + notenrechner.html | 1 + team.html | 1 + textanalyse.html | 245 +++++++++++++++++++++++++ ueber_uns.html | 1 + 11 files changed, 1145 insertions(+) create mode 100644 js/textanalyse.js create mode 100644 textanalyse.html diff --git a/css/style.css b/css/style.css index 6fdfbe8..fe451d0 100644 --- a/css/style.css +++ b/css/style.css @@ -1136,6 +1136,408 @@ textarea { font-size: 1.2rem; } +/* =========================== + Textanalyse Styles + =========================== */ + +.analyzer-section { + animation: slideUp 0.6s ease-out; +} + +/* Tab Navigation */ +.analyzer-tabs { + display: flex; + gap: 0.5rem; + margin: 1.5rem 0; + flex-wrap: wrap; +} + +.tab-btn { + padding: 0.8rem 1.5rem; + background: rgba(255, 105, 180, 0.1); + border: 2px solid rgba(255, 105, 180, 0.2); + border-radius: 12px; + color: #ff1493; + font-weight: 600; + cursor: pointer; + transition: all 0.3s ease; + font-size: 0.95rem; +} + +.tab-btn:hover { + background: rgba(255, 105, 180, 0.2); + border-color: #ff1493; +} + +.tab-btn.active { + background: linear-gradient(135deg, #ff1493 0%, #ff69b4 100%); + color: white; + border-color: #ff1493; +} + +/* Tab Content */ +.tab-content { + display: none; + animation: slideUp 0.5s ease-out; +} + +.tab-content.active { + display: block; +} + +/* Analyzer Container */ +.analyzer-container { + background: rgba(255, 255, 255, 0.85); + border: 2px solid rgba(255, 105, 180, 0.2); + border-radius: 20px; + padding: 2rem; + box-shadow: 0 8px 32px rgba(255, 20, 147, 0.15); +} + +.input-section, +.compare-inputs, +.search-inputs { + margin-bottom: 2rem; +} + +.input-section h3, +.compare-input-group h4, +.search-input-group h4 { + margin-bottom: 1rem; + color: #ff1493; +} + +.text-input, +.search-input { + width: 100%; + padding: 1rem; + border: 2px solid rgba(255, 105, 180, 0.2); + border-radius: 12px; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + font-size: 1rem; + color: #6b3a5f; + background: white; + resize: vertical; + transition: all 0.3s ease; +} + +.text-input:focus, +.search-input:focus { + outline: none; + border-color: #ff1493; + box-shadow: 0 0 12px rgba(255, 20, 147, 0.2); +} + +.text-input::placeholder, +.search-input::placeholder { + color: #b8659c; +} + +.input-info { + display: flex; + gap: 1rem; + margin-top: 0.8rem; + padding: 0.8rem; + background: rgba(255, 192, 203, 0.15); + border-radius: 8px; + font-size: 0.95rem; + color: #6b3a5f; + font-weight: 500; +} + +/* Analyzer Buttons */ +.analyzer-buttons { + display: flex; + gap: 1rem; + margin-top: 1.5rem; + flex-wrap: wrap; +} + +.btn-analyze, +.btn-calculate { + flex: 1; + min-width: 150px; + padding: 0.9rem 1.5rem; + background: linear-gradient(135deg, #ff1493 0%, #ff69b4 100%); + color: white; + border: none; + border-radius: 12px; + font-weight: 600; + font-size: 1rem; + cursor: pointer; + transition: all 0.3s ease; + box-shadow: 0 4px 15px rgba(255, 20, 147, 0.3); +} + +.btn-analyze:hover, +.btn-calculate:hover { + transform: translateY(-3px); + box-shadow: 0 6px 20px rgba(255, 20, 147, 0.4); +} + +/* Compare Inputs */ +.compare-inputs, +.search-inputs { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 1.5rem; + align-items: start; +} + +.compare-input-group, +.search-input-group { + grid-column: 1 / -1; +} + +.search-input { + margin-top: 0.5rem; +} + +/* Result Section */ +.result-section { + margin-top: 2rem; + animation: slideUp 0.5s ease-out; +} + +/* Analysis Results */ +.analysis-result { + display: flex; + flex-direction: column; + gap: 1.5rem; +} + +.analysis-result h4 { + color: #ff1493; + font-size: 1.3rem; + margin-bottom: 0.5rem; +} + +.stats-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); + gap: 1rem; +} + +.stat-card { + background: linear-gradient(135deg, rgba(255, 192, 203, 0.2) 0%, rgba(255, 160, 180, 0.1) 100%); + border: 2px solid rgba(255, 105, 180, 0.2); + border-radius: 12px; + padding: 1rem; + text-align: center; + transition: all 0.3s ease; +} + +.stat-card:hover { + transform: translateY(-5px); + border-color: rgba(255, 105, 180, 0.4); + background: linear-gradient(135deg, rgba(255, 192, 203, 0.3) 0%, rgba(255, 160, 180, 0.2) 100%); +} + +.stat-number { + font-size: 2rem; + font-weight: 800; + color: #ff1493; + margin-bottom: 0.5rem; +} + +.stat-label { + font-size: 0.9rem; + color: #6b3a5f; + font-weight: 500; +} + +/* Text Transformations */ +.text-transformations { + margin-top: 1.5rem; + border-top: 2px solid rgba(255, 105, 180, 0.15); + padding-top: 1.5rem; +} + +.text-transformations h5 { + color: #ff1493; + margin-bottom: 1rem; +} + +.transformation-box { + background: rgba(255, 192, 203, 0.1); + border: 1px solid rgba(255, 105, 180, 0.2); + border-radius: 10px; + padding: 1rem; + margin-bottom: 1rem; +} + +.transformation-box label { + display: block; + font-weight: 600; + color: #ff1493; + margin-bottom: 0.5rem; + font-size: 0.9rem; +} + +.transformation-text { + background: white; + border: 1px solid rgba(255, 105, 180, 0.15); + border-radius: 8px; + padding: 0.8rem; + margin-bottom: 0.8rem; + word-break: break-word; + max-height: 150px; + overflow-y: auto; + color: #6b3a5f; + line-height: 1.6; + font-family: 'Courier New', monospace; + font-size: 0.95rem; +} + +.copy-btn { + background: rgba(255, 105, 180, 0.15); + border: 1px solid rgba(255, 105, 180, 0.3); + color: #ff1493; + padding: 0.5rem 1rem; + border-radius: 8px; + cursor: pointer; + font-weight: 500; + transition: all 0.3s ease; + font-size: 0.9rem; +} + +.copy-btn:hover { + background: rgba(255, 105, 180, 0.25); + border-color: #ff1493; + transform: scale(1.05); +} + +/* Comparison Results */ +.comparison-result { + display: flex; + flex-direction: column; + gap: 1rem; +} + +.comparison-result h4 { + color: #ff1493; + font-size: 1.3rem; +} + +.comparison-cards { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); + gap: 1rem; +} + +.comparison-card { + background: linear-gradient(135deg, rgba(255, 192, 203, 0.2) 0%, rgba(255, 160, 180, 0.1) 100%); + border: 2px solid rgba(255, 105, 180, 0.2); + border-radius: 12px; + padding: 1.5rem; + transition: all 0.3s ease; +} + +.comparison-card:hover { + transform: translateY(-5px); + border-color: rgba(255, 105, 180, 0.4); +} + +.comparison-card h5 { + color: #ff1493; + margin-bottom: 1rem; +} + +.comparison-card p { + color: #6b3a5f; + margin: 0.5rem 0; +} + +.comparison-result-box { + grid-column: 1 / -1; + background: rgba(255, 105, 180, 0.1); + border: 2px solid rgba(255, 105, 180, 0.3); + border-radius: 12px; + padding: 1.5rem; + text-align: center; +} + +.comparison-result-box p { + font-size: 1.1rem; + font-weight: 600; + color: #ff1493; +} + +/* Search Results */ +.search-result { + display: flex; + flex-direction: column; + gap: 1rem; +} + +.search-result h4 { + color: #ff1493; + font-size: 1.3rem; +} + +.search-summary { + background: linear-gradient(135deg, rgba(255, 192, 203, 0.2) 0%, rgba(255, 160, 180, 0.1) 100%); + border: 2px solid rgba(255, 105, 180, 0.2); + border-radius: 12px; + padding: 1.5rem; + color: #6b3a5f; +} + +.search-summary p { + margin: 0.8rem 0; + font-size: 1.05rem; +} + +/* Metrics Grid */ +.metrics-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); + gap: 1.5rem; + margin-top: 1.5rem; +} + +.metric-card { + background: rgba(255, 255, 255, 0.85); + border: 2px solid rgba(255, 105, 180, 0.2); + border-radius: 15px; + padding: 1.5rem; + text-align: center; + transition: all 0.3s ease; + animation: slideUp 0.6s ease-out; +} + +.metric-card:hover { + transform: translateY(-8px); + border-color: rgba(255, 105, 180, 0.4); + box-shadow: 0 8px 25px rgba(255, 20, 147, 0.2); +} + +.metric-icon { + font-size: 2.5rem; + margin-bottom: 0.8rem; +} + +.metric-card h4 { + color: #ff1493; + margin-bottom: 0.5rem; +} + +.metric-card p { + color: #6b3a5f; + font-size: 0.95rem; + line-height: 1.6; +} + +.error-message { + background: rgba(220, 20, 60, 0.1); + border: 2px solid rgba(220, 20, 60, 0.3); + color: #dc143c; + padding: 1rem; + border-radius: 10px; + font-weight: 600; + text-align: center; +} + /* =========================== Responsive Design =========================== */ @@ -1154,6 +1556,49 @@ textarea { gap: 1.5rem; } + .compare-inputs, + .search-inputs { + grid-template-columns: 1fr; + } + + .analyzer-tabs { + flex-direction: column; + } + + .tab-btn { + width: 100%; + } + + .analyzer-buttons { + flex-direction: column; + } + + .btn-analyze, + .btn-calculate { + width: 100%; + } + + .stats-grid { + grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); + gap: 0.8rem; + } + + .stat-card { + padding: 0.8rem; + } + + .stat-number { + font-size: 1.5rem; + } + + .stat-label { + font-size: 0.8rem; + } + + .metrics-grid { + grid-template-columns: 1fr; + } + .grade-input-wrapper { flex-wrap: wrap; } diff --git a/eis_projekt.html b/eis_projekt.html index 247e5ea..cdb1ff6 100644 --- a/eis_projekt.html +++ b/eis_projekt.html @@ -25,6 +25,7 @@ Team Galerie Notenrechner + Textanalyse Kontakt Impressum diff --git a/galerie.html b/galerie.html index aa95622..2136af4 100644 --- a/galerie.html +++ b/galerie.html @@ -25,6 +25,7 @@ Team Galerie Notenrechner + Textanalyse Kontakt Impressum diff --git a/impressum.html b/impressum.html index 13e1aa8..c6025a6 100644 --- a/impressum.html +++ b/impressum.html @@ -25,6 +25,7 @@ Team Galerie Notenrechner + Textanalyse Kontakt Impressum diff --git a/index.html b/index.html index bf9fcf4..9b5e055 100644 --- a/index.html +++ b/index.html @@ -25,6 +25,7 @@ Team Galerie Notenrechner + Textanalyse Kontakt Impressum diff --git a/js/textanalyse.js b/js/textanalyse.js new file mode 100644 index 0000000..7b986ad --- /dev/null +++ b/js/textanalyse.js @@ -0,0 +1,447 @@ +/** + * Textanalyse - Analysiert Texte und zeigt Statistiken + * David & Karo - EIS Projekt + */ + +/** + * Analysiert einen Text und gibt Statistiken zurück + * @param {string} text - Der zu analysierende Text + * @returns {object} - Enthält Analyseresultate und Details + */ +function analyseText(text) { + // Eingabe validieren + if (text === null) { + return { + valid: false, + fehler: 'Eingabe abgebrochen!', + nachricht: '❌ Die Textanalyse wurde abgebrochen.' + }; + } + + // Text trimmen (führende und nachfolgende Leerzeichen entfernen) + const textTrimmed = text.trim(); + + if (textTrimmed === '') { + return { + valid: false, + fehler: 'Text ist leer!', + nachricht: '❌ Bitte geben Sie einen Text ein, der analysiert werden soll!' + }; + } + + // Zeichen zählen + const anzahlZeichen = text.length; + const anzahlZeichenOhneLeerzeichen = text.replace(/\s/g, '').length; + + // Wörter zählen + const woerter = textTrimmed.split(/\s+/).filter(wort => wort.length > 0); + const anzahlWoerter = woerter.length; + + // Sätze zählen (vereinfacht: Punkt, Frage- und Ausrufezeichen) + const anzahlSaetze = (text.match(/[.!?]/g) || []).length || 1; + + // Text in Großbuchstaben + const textGross = text.toUpperCase(); + + // Text in Kleinbuchstaben + const textKlein = text.toLowerCase(); + + // Durchschnittliche Wortlänge + const durchschnittlicheWortlaenge = anzahlWoerter > 0 + ? (anzahlZeichenOhneLeerzeichen / anzahlWoerter).toFixed(2) + : 0; + + // Vokale zählen + const vokale = (text.match(/[aeiouäöüAEIOUÄÖÜ]/g) || []).length; + + // Konsonanten zählen + const konsonanten = (text.match(/[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ]/g) || []).length; + + // Zahlen zählen + const zahlen = (text.match(/[0-9]/g) || []).length; + + // Längster und kürzester Satz + const saetze = text.split(/[.!?]/).map(s => s.trim()).filter(s => s.length > 0); + const laengsterSatz = saetze.length > 0 + ? saetze.reduce((prev, current) => (prev.length > current.length) ? prev : current, '') + : ''; + + const kuerzeesterSatz = saetze.length > 0 + ? saetze.reduce((prev, current) => (prev.length < current.length) ? prev : current, '') + : ''; + + // Formatierte Ausgabe mit Template Literals + const formatiertesErgebnis = ` +📊 TEXTANALYSE-ERGEBNISSE: +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +📝 Zeichen & Wörter: + • Gesamte Zeichen: ${anzahlZeichen} + • Zeichen ohne Leerzeichen: ${anzahlZeichenOhneLeerzeichen} + • Anzahl der Wörter: ${anzahlWoerter} + • Anzahl der Sätze: ${anzahlSaetze} + • Durchschn. Wortlänge: ${durchschnittlicheWortlaenge} Zeichen + +🔤 Buchstaben & Laute: + • Vokale: ${vokale} + • Konsonanten: ${konsonanten} + • Zahlen: ${zahlen} + +🔤 ORIGINAL TEXT: +${text} + +🔤 GROSSBUCHSTABEN: +${textGross} + +🔤 KLEINBUCHSTABEN: +${textKlein} +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`; + + return { + valid: true, + originalText: text, + anzahlZeichen: anzahlZeichen, + anzahlZeichenOhneLeerzeichen: anzahlZeichenOhneLeerzeichen, + anzahlWoerter: anzahlWoerter, + anzahlSaetze: anzahlSaetze, + durchschnittlicheWortlaenge: durchschnittlicheWortlaenge, + vokale: vokale, + konsonanten: konsonanten, + zahlen: zahlen, + textGross: textGross, + textKlein: textKlein, + saetze: saetze, + laengsterSatz: laengsterSatz, + kuerzeesterSatz: kuerzeesterSatz, + formatiertesErgebnis: formatiertesErgebnis, + nachricht: `✅ Text erfolgreich analysiert! ${anzahlWoerter} Wörter, ${anzahlZeichen} Zeichen.` + }; +} + +/** + * Vergleicht zwei Texte + * @param {string} text1 - Erster Text + * @param {string} text2 - Zweiter Text + * @returns {object} - Vergleichsergebnisse + */ +function vergleicheTexte(text1, text2) { + const analyse1 = analyseText(text1); + const analyse2 = analyseText(text2); + + if (!analyse1.valid || !analyse2.valid) { + return { + valid: false, + fehler: 'Mindestens einer der Texte ist leer!', + nachricht: '❌ Bitte geben Sie zwei nicht-leere Texte ein!' + }; + } + + const unterschied = Math.abs(analyse1.anzahlZeichen - analyse2.anzahlZeichen); + const laenger = analyse1.anzahlZeichen > analyse2.anzahlZeichen ? 'Text 1' : 'Text 2'; + + const vergleichsErgebnis = ` +📊 TEXTVERGLEICH: +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +Text 1 Statistik: + • Zeichen: ${analyse1.anzahlZeichen} + • Wörter: ${analyse1.anzahlWoerter} + +Text 2 Statistik: + • Zeichen: ${analyse2.anzahlZeichen} + • Wörter: ${analyse2.anzahlWoerter} + +Vergleich: + • Unterschied: ${unterschied} Zeichen + • Längerer Text: ${laenger} +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`; + + return { + valid: true, + vergleichsErgebnis: vergleichsErgebnis, + unterschied: unterschied, + laenger: laenger, + nachricht: `✅ Vergleich abgeschlossen! Unterschied: ${unterschied} Zeichen` + }; +} + +/** + * Sucht nach Wörtern in einem Text + * @param {string} text - Der Text zum Durchsuchen + * @param {string} suchbegriff - Das Wort zum Suchen + * @returns {object} - Suchergebnisse + */ +function sucheWort(text, suchbegriff) { + if (!text.trim() || !suchbegriff.trim()) { + return { + valid: false, + fehler: 'Eingabe unvollständig!', + nachricht: '❌ Bitte geben Sie Text und Suchbegriff ein!' + }; + } + + const regex = new RegExp(suchbegriff, 'gi'); + const treffer = (text.match(regex) || []).length; + const indexTreffer = []; + let match; + + while ((match = regex.exec(text)) !== null) { + indexTreffer.push(match.index); + } + + const suchergebnis = ` +🔍 SUCHE: "${suchbegriff}" +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +• Treffer gefunden: ${treffer} +• Positionen: ${indexTreffer.join(', ') || 'Keine'} +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`; + + return { + valid: true, + suchbegriff: suchbegriff, + treffer: treffer, + positionen: indexTreffer, + suchergebnis: suchergebnis, + nachricht: `✅ ${treffer} Treffer für "${suchbegriff}" gefunden!` + }; +} + +// DOM-Manipulation und Event-Listener +document.addEventListener('DOMContentLoaded', function() { + const analyzeBtn = document.getElementById('analyze-btn'); + const compareBtn = document.getElementById('compare-btn'); + const searchBtn = document.getElementById('search-btn'); + const resetBtn = document.getElementById('reset-btn'); + + if (analyzeBtn) { + analyzeBtn.addEventListener('click', performTextAnalysis); + } + + if (compareBtn) { + compareBtn.addEventListener('click', performTextComparison); + } + + if (searchBtn) { + searchBtn.addEventListener('click', performTextSearch); + } + + if (resetBtn) { + resetBtn.addEventListener('click', resetAnalyzer); + } + + // Live-Zeichenzähler + const textInput = document.getElementById('text-input'); + const charCount = document.getElementById('char-count'); + + if (textInput && charCount) { + textInput.addEventListener('input', function() { + charCount.textContent = this.value.length; + }); + } +}); + +/** + * Führt Textanalyse durch + */ +function performTextAnalysis() { + const textInput = document.getElementById('text-input'); + const resultDiv = document.getElementById('result'); + + if (!textInput) return; + + const text = textInput.value; + const result = analyseText(text); + + if (!result.valid) { + resultDiv.innerHTML = `
⚠️ ${result.fehler}
${result.nachricht}
`; + alert(result.nachricht); + console.error(result.fehler, result); + return; + } + + // HTML-Ergebnis formatieren + let resultHTML = ` +
+

📊 Analyseresultate

+
+
+
${result.anzahlZeichen}
+
Zeichen (gesamt)
+
+
+
${result.anzahlZeichenOhneLeerzeichen}
+
Ohne Leerzeichen
+
+
+
${result.anzahlWoerter}
+
Wörter
+
+
+
${result.anzahlSaetze}
+
Sätze
+
+
+
${result.vokale}
+
Vokale
+
+
+
${result.konsonanten}
+
Konsonanten
+
+
+
${result.zahlen}
+
Zahlen
+
+
+
${result.durchschnittlicheWortlaenge}
+
Ø Wortlänge
+
+
+ +
+
🔤 Texttransformationen:
+ +
+ +
${escapeHtml(result.textGross)}
+ +
+ +
+ +
${escapeHtml(result.textKlein)}
+ +
+
+
+ `; + + resultDiv.innerHTML = resultHTML; + + // Console und Alert Output + console.log(result.formatiertesErgebnis); + alert(result.nachricht); +} + +/** + * Führt Textvergleich durch + */ +function performTextComparison() { + const text1Input = document.getElementById('text1-compare'); + const text2Input = document.getElementById('text2-compare'); + const compareResultDiv = document.getElementById('compare-result'); + + if (!text1Input || !text2Input) return; + + const text1 = text1Input.value; + const text2 = text2Input.value; + + const result = vergleicheTexte(text1, text2); + + if (!result.valid) { + compareResultDiv.innerHTML = `
⚠️ ${result.fehler}
${result.nachricht}
`; + alert(result.nachricht); + return; + } + + let resultHTML = ` +
+

📊 Vergleichsergebnisse

+
+
+
Text 1
+

Zeichen: ${result.vergleichsErgebnis.match(/Zeichen: (\d+)/)[1] || '0'}

+

Wörter: ${result.vergleichsErgebnis.match(/Wörter: (\d+)/)[1] || '0'}

+
+
+
Text 2
+

Zeichen: ${result.vergleichsErgebnis.match(/Zeichen: (\d+)[\s\S]*?Wörter: (\d+)[\s\S]*?Text 2 Statistik[\s\S]*?Zeichen: (\d+)/)[3] || '0'}

+

Wörter: ${result.vergleichsErgebnis.match(/Text 2[\s\S]*?Wörter: (\d+)/)[1] || '0'}

+
+
+

Längerer Text: ${result.laenger}

+

Unterschied: ${result.unterschied} Zeichen

+
+
+
+ `; + + compareResultDiv.innerHTML = resultHTML; + console.log(result.vergleichsErgebnis); + alert(result.nachricht); +} + +/** + * Führt Wortsuche durch + */ +function performTextSearch() { + const searchTextInput = document.getElementById('search-text'); + const searchTermInput = document.getElementById('search-term'); + const searchResultDiv = document.getElementById('search-result'); + + if (!searchTextInput || !searchTermInput) return; + + const text = searchTextInput.value; + const suchbegriff = searchTermInput.value; + + const result = sucheWort(text, suchbegriff); + + if (!result.valid) { + searchResultDiv.innerHTML = `
⚠️ ${result.fehler}
${result.nachricht}
`; + alert(result.nachricht); + return; + } + + let resultHTML = ` +
+

🔍 Suchergebnisse

+
+

Suchbegriff: "${escapeHtml(result.suchbegriff)}"

+

Treffer gefunden: ${result.treffer}

+ ${result.treffer > 0 ? `

Positionen: ${result.positionen.join(', ')}

` : ''} +
+
+ `; + + searchResultDiv.innerHTML = resultHTML; + console.log(result.suchergebnis); + alert(result.nachricht); +} + +/** + * Setzt den Analyzer zurück + */ +function resetAnalyzer() { + document.getElementById('text-input').value = ''; + document.getElementById('text1-compare').value = ''; + document.getElementById('text2-compare').value = ''; + document.getElementById('search-text').value = ''; + document.getElementById('search-term').value = ''; + document.getElementById('result').innerHTML = ''; + document.getElementById('compare-result').innerHTML = ''; + document.getElementById('search-result').innerHTML = ''; + document.getElementById('char-count').textContent = '0'; +} + +/** + * HTML-escape für sicherer Ausgabe + */ +function escapeHtml(text) { + const map = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + return text.replace(/[&<>"']/g, m => map[m]); +} + +/** + * Text in Zwischenablage kopieren + */ +function copyToClipboard(text) { + navigator.clipboard.writeText(text).then(() => { + alert('✅ Text kopiert!'); + }).catch(() => { + alert('❌ Fehler beim Kopieren'); + }); +} diff --git a/kontakt.html b/kontakt.html index 018781a..8c01aef 100644 --- a/kontakt.html +++ b/kontakt.html @@ -25,6 +25,7 @@ Team Galerie Notenrechner + Textanalyse Kontakt Impressum diff --git a/notenrechner.html b/notenrechner.html index 7344c8e..8b4c1e4 100644 --- a/notenrechner.html +++ b/notenrechner.html @@ -25,6 +25,7 @@ Team Galerie Notenrechner + Textanalyse Kontakt Impressum diff --git a/team.html b/team.html index b365d33..b72b51b 100644 --- a/team.html +++ b/team.html @@ -25,6 +25,7 @@ Team Galerie Notenrechner + Textanalyse Kontakt Impressum diff --git a/textanalyse.html b/textanalyse.html new file mode 100644 index 0000000..f0cbc34 --- /dev/null +++ b/textanalyse.html @@ -0,0 +1,245 @@ + + + + + + + Textanalyse – David & Karo + + + + +
+
+ + +
+
+ +
+
+

📝 Textanalyse 🔍

+

Analysiere Texte in Echtzeit! Zähle Zeichen, Wörter, Vokale und mehr. Perfekt für Schreiben und Sprachanalyse! ✨

+
+ +
+

🎯 Was kann der Textanalyzer?

+
+
+

1️⃣ Schnelle Analyse

+

Geben Sie einen Text ein und erhalten Sie sofort detaillierte Statistiken über Zeichen, Wörter und mehr.

+
+
+

2️⃣ Textvergleich

+

Vergleichen Sie zwei Texte und sehen Sie, welcher länger ist und um wie viele Zeichen er sich unterscheidet.

+
+
+

3️⃣ Wortsuche

+

Suchen Sie nach bestimmten Wörtern oder Phrasen und sehen Sie, wie oft sie vorkommen und wo.

+
+
+

4️⃣ Transformationen

+

Wandeln Sie Ihren Text in Großbuchstaben oder Kleinbuchstaben um und kopieren Sie das Ergebnis!

+
+
+
+ +
+

🔨 Textanalyzer-Tools

+ + +
+ + + +
+ + +
+
+
+

📝 Text eingeben:

+ +
+ Zeichen: 0 +
+ +
+ + +
+
+ +
+ +
+
+
+ + +
+
+
+
+

📝 Text 1:

+ +
+ +
+

📝 Text 2:

+ +
+ + +
+ +
+ +
+
+
+ + +
+
+
+
+

📝 Zu durchsuchender Text:

+ +
+ +
+

🔍 Suchbegriff:

+ +
+ + +
+ +
+ +
+
+
+
+ +
+

📚 Analysierte Metriken

+
+
+
🔤
+

Zeichen

+

Gesamtzahl aller Zeichen inklusive Leerzeichen und Sonderzeichen

+
+
+
📝
+

Wörter

+

Anzahl der durch Leerzeichen getrennten Wörter

+
+
+
✏️
+

Sätze

+

Anzahl der Sätze (erkannt an . ! ?)

+
+
+
🔉
+

Vokale

+

Anzahl der Selbstlaute (a, e, i, o, u mit Umlauten)

+
+
+
🔊
+

Konsonanten

+

Anzahl der Mittellaute (alle anderen Buchstaben)

+
+
+
🔢
+

Zahlen

+

Anzahl der im Text vorkommenden Ziffern

+
+
+
+ +
+

💡 Tipps & Tricks

+
+
    +
  • Live-Zähler: Der Zeichenzähler aktualisiert sich automatisch während des Tippens!
  • +
  • Copy-Funktion: Mit dem 📋 Button können Sie transformierte Texte sofort kopieren!
  • +
  • Wortsuche: Die Suche ist case-insensitive (unterscheidet nicht zwischen Groß- und Kleinbuchstaben)
  • +
  • Template Literals: Das Skript verwendet moderne JavaScript Template Literals für formatierte Ausgaben
  • +
  • Fehlerbehandlung: Der Analyzer überprüft auf leere Eingaben und zeigt hilfreiche Fehlermeldungen
  • +
  • Browser-Kompatibilität: Funktioniert auf allen modernen Browsern (Chrome, Firefox, Safari, Edge)
  • +
+
+
+ +
+

© 2026 David & Karo – EIS Projekt. Alle Rechte vorbehalten. 💕

+
+
+ + + + + + diff --git a/ueber_uns.html b/ueber_uns.html index c38970f..e8282be 100644 --- a/ueber_uns.html +++ b/ueber_uns.html @@ -25,6 +25,7 @@ Team Galerie Notenrechner + Textanalyse Kontakt Impressum