Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
camiska authored Apr 15, 2024
0 parents commit 0119e40
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
18 changes: 18 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Text Analyzer</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>Text Analyzer</h1>
<textarea id="inputText" placeholder="Enter text here..."></textarea>
<button onclick="analyzeText()">Analyze</button>
<textarea id="outputText" placeholder="Results will appear here..." readonly></textarea>
</div>
<script src="script.js"></script>
</body>
</html>
16 changes: 16 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function analyzeText() {
const inputText = document.getElementById('inputText').value;
const outputArea = document.getElementById('outputText');
const keywords = ["ethics", "ethic", "ethical", "moral", "morally", "ethically", "ethik", "ethisch", "moralisch", "dilemma"];
const lines = inputText.split('\n');
const results = [];

lines.forEach(line => {
const lineLower = line.toLowerCase();
if (keywords.some(keyword => lineLower.includes(keyword))) {
results.push(line);
}
});

outputArea.value = results.join('\n\n');
}
23 changes: 23 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
body {
font-family: Arial, sans-serif;
}

.container {
width: 80%;
margin: auto;
padding-top: 20px;
}

textarea {
width: 100%;
height: 200px;
margin-top: 10px;
}

button {
margin-top: 10px;
width: 100px;
padding: 10px;
font-size: 16px;
cursor: pointer;
}

0 comments on commit 0119e40

Please sign in to comment.