<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Octal to Text Converter</title>
<style>
body {
font-family: system-ui, sans-serif;
max-width: 600px;
margin: 40px auto;
padding: 20px;
background: #0f172a;
color: #e2e8f0;
}
h2 { color: #38bdf8; }
textarea {
width: 100%;
height: 100px;
margin: 10px 0;
padding: 10px;
background: #1e293b;
border: 1px solid #334155;
border-radius: 6px;
color: #e2e8f0;
font-size: 14px;
}
button {
background: #38bdf8;
color: #0f172a;
border: none;
padding: 10px 20px;
border-radius: 6px;
font-weight: bold;
cursor: pointer;
}
button:hover { background: #0ea5e9; }
label { font-size: 14px; color: #94a3b8; }
</style>
</head>
<body>
<h2>Octal to Text Converter</h2>
<label>Enter octal codes separated by spaces:</label>
<textarea id="octalInput" placeholder="Ex: 110 145 154 157"></textarea>
<button onclick="convertOctal()">Convert to Text</button>
<label>Result:</label>
<textarea id="textOutput" placeholder="Your text will appear here..." readonly></textarea>
<script>
function convertOctal() {
const input = document.getElementById('octalInput').value.trim();
if (!input) {
document.getElementById('textOutput').value = '';
return;
}
try {
const octalArray = input.split(/\s+/);
const text = octalArray.map(oct => {
const decimal = parseInt
No comments:
Post a Comment