All Rounder Tools Blogger-Best blog for blogger: Text to Binary converter Tool with colorful styling and all its features use any free library...

Wednesday, September 25, 2024

Text to Binary converter Tool with colorful styling and all its features use any free library...

 

Text to Binary Converter

Text to Binary Converter

Binary Output:

body { font-family: Arial, sans-serif; background: linear-gradient(to right, #6a11cb, #2575fc); color: #ffffff; margin: 0; padding: 20px; } .container { max-width: 600px; margin: auto; background: rgba(0, 0, 0, 0.7); border-radius: 10px; padding: 20px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); } h1 { text-align: center; color: #ffeb3b; } textarea { width: 100%; height: 150px; border: none; border-radius: 5px; padding: 10px; font-size: 16px; margin-bottom: 20px; } button { background-color: #ff5722; border: none; border-radius: 5px; color: white; padding: 10px 15px; cursor: pointer; font-size: 16px; transition: background-color 0.3s; width: 100%; } button:hover { background-color: #e64a19; } .result { margin-top: 20px; padding: 10px; background: rgba(255, 255, 255, 0.1); border-radius: 5px; } #binaryOutput { white-space: pre-wrap; /* Preserve whitespace and formatting */ } document.getElementById("convertButton").addEventListener("click", function() { const inputText = document.getElementById("inputText").value; const binaryOutput = document.getElementById("binaryOutput"); if (inputText.trim() === "") { binaryOutput.textContent = "Please enter some text to convert."; return; } const binaryResult = textToBinary(inputText); binaryOutput.textContent = binaryResult; }); function textToBinary(text) { return text.split('').map(char => { return char.charCodeAt(0).toString(2).padStart(8, '0'); }).join(' '); }

No comments:

Post a Comment