Spaces:
Running
Running
Update index.html
Browse files- index.html +103 -19
index.html
CHANGED
|
@@ -1,19 +1,103 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Case Converter</title>
|
| 7 |
+
<style>
|
| 8 |
+
body {
|
| 9 |
+
font-family: Arial, sans-serif;
|
| 10 |
+
background-color: #f4f4f4;
|
| 11 |
+
margin: 0;
|
| 12 |
+
padding: 0;
|
| 13 |
+
display: flex;
|
| 14 |
+
justify-content: center;
|
| 15 |
+
align-items: center;
|
| 16 |
+
height: 100vh;
|
| 17 |
+
}
|
| 18 |
+
.container {
|
| 19 |
+
background-color: #fff;
|
| 20 |
+
border-radius: 8px;
|
| 21 |
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
| 22 |
+
width: 80%;
|
| 23 |
+
max-width: 600px;
|
| 24 |
+
padding: 20px;
|
| 25 |
+
text-align: center;
|
| 26 |
+
}
|
| 27 |
+
.container h1 {
|
| 28 |
+
color: #333;
|
| 29 |
+
margin-bottom: 20px;
|
| 30 |
+
}
|
| 31 |
+
.input-group {
|
| 32 |
+
margin-bottom: 20px;
|
| 33 |
+
}
|
| 34 |
+
.input-group textarea {
|
| 35 |
+
width: 100%;
|
| 36 |
+
height: 150px;
|
| 37 |
+
padding: 10px;
|
| 38 |
+
border: 1px solid #ccc;
|
| 39 |
+
border-radius: 4px;
|
| 40 |
+
resize: none;
|
| 41 |
+
}
|
| 42 |
+
.buttons {
|
| 43 |
+
display: flex;
|
| 44 |
+
justify-content: center;
|
| 45 |
+
gap: 10px;
|
| 46 |
+
}
|
| 47 |
+
.buttons button {
|
| 48 |
+
padding: 10px 20px;
|
| 49 |
+
background-color: #007BFF;
|
| 50 |
+
color: #fff;
|
| 51 |
+
border: none;
|
| 52 |
+
border-radius: 4px;
|
| 53 |
+
cursor: pointer;
|
| 54 |
+
transition: background-color 0.3s ease;
|
| 55 |
+
}
|
| 56 |
+
.buttons button:hover {
|
| 57 |
+
background-color: #0056b3;
|
| 58 |
+
}
|
| 59 |
+
</style>
|
| 60 |
+
</head>
|
| 61 |
+
<body>
|
| 62 |
+
|
| 63 |
+
<div class="container">
|
| 64 |
+
<h1>Case Converter</h1>
|
| 65 |
+
<div class="input-group">
|
| 66 |
+
<textarea id="input-text" placeholder="Enter text here..."></textarea>
|
| 67 |
+
</div>
|
| 68 |
+
<div class="buttons">
|
| 69 |
+
<button onclick="convertToUppercase()">Uppercase</button>
|
| 70 |
+
<button onclick="convertToLowercase()">Lowercase</button>
|
| 71 |
+
<button onclick="convertToTitleCase()">Title Case</button>
|
| 72 |
+
<button onclick="convertToSentenceCase()">Sentence Case</button>
|
| 73 |
+
</div>
|
| 74 |
+
</div>
|
| 75 |
+
|
| 76 |
+
<script>
|
| 77 |
+
function convertToUppercase() {
|
| 78 |
+
const inputText = document.getElementById('input-text').value;
|
| 79 |
+
document.getElementById('input-text').value = inputText.toUpperCase();
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
function convertToLowercase() {
|
| 83 |
+
const inputText = document.getElementById('input-text').value;
|
| 84 |
+
document.getElementById('input-text').value = inputText.toLowerCase();
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
function convertToTitleCase() {
|
| 88 |
+
const inputText = document.getElementById('input-text').value;
|
| 89 |
+
const words = inputText.split(' ');
|
| 90 |
+
const titleCaseWords = words.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase());
|
| 91 |
+
document.getElementById('input-text').value = titleCaseWords.join(' ');
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
function convertToSentenceCase() {
|
| 95 |
+
const inputText = document.getElementById('input-text').value;
|
| 96 |
+
const sentences = inputText.split('. ');
|
| 97 |
+
const sentenceCaseSentences = sentences.map(sentence => sentence.charAt(0).toUpperCase() + sentence.slice(1).toLowerCase());
|
| 98 |
+
document.getElementById('input-text').value = sentenceCaseSentences.join('. ');
|
| 99 |
+
}
|
| 100 |
+
</script>
|
| 101 |
+
|
| 102 |
+
</body>
|
| 103 |
+
</html>
|