Spaces:
Running
Running
undefined - Initial Deployment
Browse files- README.md +6 -4
- index.html +215 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
colorTo: yellow
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: conversor-de-n-meros
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: blue
|
| 5 |
colorTo: yellow
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,215 @@
|
|
| 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>Number System Converter</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
.gradient-bg {
|
| 11 |
+
background: linear-gradient(135deg, #6e8efb, #a777e3);
|
| 12 |
+
}
|
| 13 |
+
.result-box {
|
| 14 |
+
transition: all 0.3s ease;
|
| 15 |
+
}
|
| 16 |
+
.result-box:hover {
|
| 17 |
+
transform: translateY(-5px);
|
| 18 |
+
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
|
| 19 |
+
}
|
| 20 |
+
.copy-btn {
|
| 21 |
+
transition: all 0.2s ease;
|
| 22 |
+
}
|
| 23 |
+
.copy-btn:hover {
|
| 24 |
+
background-color: rgba(255,255,255,0.2);
|
| 25 |
+
}
|
| 26 |
+
.copy-btn:active {
|
| 27 |
+
transform: scale(0.95);
|
| 28 |
+
}
|
| 29 |
+
.pulse {
|
| 30 |
+
animation: pulse 1.5s infinite;
|
| 31 |
+
}
|
| 32 |
+
@keyframes pulse {
|
| 33 |
+
0% { transform: scale(1); }
|
| 34 |
+
50% { transform: scale(1.05); }
|
| 35 |
+
100% { transform: scale(1); }
|
| 36 |
+
}
|
| 37 |
+
</style>
|
| 38 |
+
</head>
|
| 39 |
+
<body class="min-h-screen gradient-bg text-white">
|
| 40 |
+
<div class="container mx-auto px-4 py-12">
|
| 41 |
+
<div class="max-w-2xl mx-auto">
|
| 42 |
+
<div class="text-center mb-10">
|
| 43 |
+
<h1 class="text-4xl font-bold mb-2">Number System Converter</h1>
|
| 44 |
+
<p class="text-lg opacity-90">Convert decimal numbers to binary, hexadecimal, and octal</p>
|
| 45 |
+
</div>
|
| 46 |
+
|
| 47 |
+
<div class="bg-white bg-opacity-10 backdrop-filter backdrop-blur-lg rounded-xl shadow-2xl p-6 mb-8">
|
| 48 |
+
<div class="flex items-center mb-6">
|
| 49 |
+
<div class="mr-4">
|
| 50 |
+
<i class="fas fa-exchange-alt text-2xl text-yellow-300"></i>
|
| 51 |
+
</div>
|
| 52 |
+
<div>
|
| 53 |
+
<h2 class="text-xl font-semibold">Input Number</h2>
|
| 54 |
+
<p class="text-sm opacity-80">Enter a decimal number to convert</p>
|
| 55 |
+
</div>
|
| 56 |
+
</div>
|
| 57 |
+
|
| 58 |
+
<div class="relative">
|
| 59 |
+
<input
|
| 60 |
+
type="number"
|
| 61 |
+
id="decimalInput"
|
| 62 |
+
placeholder="Enter decimal number"
|
| 63 |
+
class="w-full bg-white bg-opacity-20 border border-white border-opacity-30 rounded-lg py-3 px-4 text-white placeholder-white placeholder-opacity-70 focus:outline-none focus:ring-2 focus:ring-yellow-300 focus:border-transparent"
|
| 64 |
+
oninput="convertNumber()"
|
| 65 |
+
>
|
| 66 |
+
<button
|
| 67 |
+
onclick="clearInput()"
|
| 68 |
+
class="absolute right-3 top-1/2 transform -translate-y-1/2 text-white opacity-70 hover:opacity-100 transition-opacity"
|
| 69 |
+
>
|
| 70 |
+
<i class="fas fa-times"></i>
|
| 71 |
+
</button>
|
| 72 |
+
</div>
|
| 73 |
+
</div>
|
| 74 |
+
|
| 75 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
| 76 |
+
<!-- Binary Result -->
|
| 77 |
+
<div class="result-box bg-white bg-opacity-10 backdrop-filter backdrop-blur-lg rounded-xl shadow-lg p-6">
|
| 78 |
+
<div class="flex justify-between items-center mb-4">
|
| 79 |
+
<div class="flex items-center">
|
| 80 |
+
<div class="w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center mr-3">
|
| 81 |
+
<span class="font-mono font-bold">BIN</span>
|
| 82 |
+
</div>
|
| 83 |
+
<div>
|
| 84 |
+
<h3 class="font-semibold">Binary</h3>
|
| 85 |
+
<p class="text-xs opacity-70">Base 2</p>
|
| 86 |
+
</div>
|
| 87 |
+
</div>
|
| 88 |
+
<button
|
| 89 |
+
onclick="copyToClipboard('binaryResult')"
|
| 90 |
+
class="copy-btn w-8 h-8 rounded-full bg-white bg-opacity-10 flex items-center justify-center hover:bg-opacity-20"
|
| 91 |
+
title="Copy to clipboard"
|
| 92 |
+
>
|
| 93 |
+
<i class="fas fa-copy text-sm"></i>
|
| 94 |
+
</button>
|
| 95 |
+
</div>
|
| 96 |
+
<div class="bg-black bg-opacity-30 rounded-lg p-3 font-mono overflow-x-auto">
|
| 97 |
+
<span id="binaryResult" class="text-yellow-300">-</span>
|
| 98 |
+
</div>
|
| 99 |
+
</div>
|
| 100 |
+
|
| 101 |
+
<!-- Hexadecimal Result -->
|
| 102 |
+
<div class="result-box bg-white bg-opacity-10 backdrop-filter backdrop-blur-lg rounded-xl shadow-lg p-6">
|
| 103 |
+
<div class="flex justify-between items-center mb-4">
|
| 104 |
+
<div class="flex items-center">
|
| 105 |
+
<div class="w-10 h-10 rounded-full bg-green-500 flex items-center justify-center mr-3">
|
| 106 |
+
<span class="font-mono font-bold">HEX</span>
|
| 107 |
+
</div>
|
| 108 |
+
<div>
|
| 109 |
+
<h3 class="font-semibold">Hexadecimal</h3>
|
| 110 |
+
<p class="text-xs opacity-70">Base 16</p>
|
| 111 |
+
</div>
|
| 112 |
+
</div>
|
| 113 |
+
<button
|
| 114 |
+
onclick="copyToClipboard('hexResult')"
|
| 115 |
+
class="copy-btn w-8 h-8 rounded-full bg-white bg-opacity-10 flex items-center justify-center hover:bg-opacity-20"
|
| 116 |
+
title="Copy to clipboard"
|
| 117 |
+
>
|
| 118 |
+
<i class="fas fa-copy text-sm"></i>
|
| 119 |
+
</button>
|
| 120 |
+
</div>
|
| 121 |
+
<div class="bg-black bg-opacity-30 rounded-lg p-3 font-mono overflow-x-auto">
|
| 122 |
+
<span id="hexResult" class="text-yellow-300">-</span>
|
| 123 |
+
</div>
|
| 124 |
+
</div>
|
| 125 |
+
|
| 126 |
+
<!-- Octal Result -->
|
| 127 |
+
<div class="result-box bg-white bg-opacity-10 backdrop-filter backdrop-blur-lg rounded-xl shadow-lg p-6">
|
| 128 |
+
<div class="flex justify-between items-center mb-4">
|
| 129 |
+
<div class="flex items-center">
|
| 130 |
+
<div class="w-10 h-10 rounded-full bg-purple-500 flex items-center justify-center mr-3">
|
| 131 |
+
<span class="font-mono font-bold">OCT</span>
|
| 132 |
+
</div>
|
| 133 |
+
<div>
|
| 134 |
+
<h3 class="font-semibold">Octal</h3>
|
| 135 |
+
<p class="text-xs opacity-70">Base 8</p>
|
| 136 |
+
</div>
|
| 137 |
+
</div>
|
| 138 |
+
<button
|
| 139 |
+
onclick="copyToClipboard('octalResult')"
|
| 140 |
+
class="copy-btn w-8 h-8 rounded-full bg-white bg-opacity-10 flex items-center justify-center hover:bg-opacity-20"
|
| 141 |
+
title="Copy to clipboard"
|
| 142 |
+
>
|
| 143 |
+
<i class="fas fa-copy text-sm"></i>
|
| 144 |
+
</button>
|
| 145 |
+
</div>
|
| 146 |
+
<div class="bg-black bg-opacity-30 rounded-lg p-3 font-mono overflow-x-auto">
|
| 147 |
+
<span id="octalResult" class="text-yellow-300">-</span>
|
| 148 |
+
</div>
|
| 149 |
+
</div>
|
| 150 |
+
</div>
|
| 151 |
+
|
| 152 |
+
<div class="mt-8 text-center text-sm opacity-80">
|
| 153 |
+
<p>Made with <i class="fas fa-heart text-red-400"></i> using HTML, CSS & JavaScript</p>
|
| 154 |
+
</div>
|
| 155 |
+
</div>
|
| 156 |
+
</div>
|
| 157 |
+
|
| 158 |
+
<script>
|
| 159 |
+
function convertNumber() {
|
| 160 |
+
const decimalInput = document.getElementById('decimalInput').value;
|
| 161 |
+
|
| 162 |
+
if (decimalInput === '') {
|
| 163 |
+
document.getElementById('binaryResult').textContent = '-';
|
| 164 |
+
document.getElementById('hexResult').textContent = '-';
|
| 165 |
+
document.getElementById('octalResult').textContent = '-';
|
| 166 |
+
return;
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
const decimalNumber = parseInt(decimalInput);
|
| 170 |
+
|
| 171 |
+
// Binary conversion
|
| 172 |
+
const binary = decimalNumber.toString(2);
|
| 173 |
+
document.getElementById('binaryResult').textContent = binary;
|
| 174 |
+
|
| 175 |
+
// Hexadecimal conversion
|
| 176 |
+
const hex = decimalNumber.toString(16).toUpperCase();
|
| 177 |
+
document.getElementById('hexResult').textContent = `0x${hex}`;
|
| 178 |
+
|
| 179 |
+
// Octal conversion
|
| 180 |
+
const octal = decimalNumber.toString(8);
|
| 181 |
+
document.getElementById('octalResult').textContent = `0${octal}`;
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
function clearInput() {
|
| 185 |
+
document.getElementById('decimalInput').value = '';
|
| 186 |
+
convertNumber();
|
| 187 |
+
document.getElementById('decimalInput').focus();
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
function copyToClipboard(elementId) {
|
| 191 |
+
const element = document.getElementById(elementId);
|
| 192 |
+
const text = element.textContent;
|
| 193 |
+
|
| 194 |
+
if (text === '-') return;
|
| 195 |
+
|
| 196 |
+
navigator.clipboard.writeText(text.replace(/^0x|^0/, ''));
|
| 197 |
+
|
| 198 |
+
// Visual feedback
|
| 199 |
+
const originalText = element.textContent;
|
| 200 |
+
element.textContent = 'Copied!';
|
| 201 |
+
element.classList.add('text-green-400');
|
| 202 |
+
|
| 203 |
+
setTimeout(() => {
|
| 204 |
+
element.textContent = originalText;
|
| 205 |
+
element.classList.remove('text-green-400');
|
| 206 |
+
}, 1000);
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
// Focus input on page load
|
| 210 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 211 |
+
document.getElementById('decimalInput').focus();
|
| 212 |
+
});
|
| 213 |
+
</script>
|
| 214 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=adrianoL/conversor-de-n-meros" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 215 |
+
</html>
|