Spaces:
Running
Running
Add 3 files
Browse files- README.md +7 -5
- index.html +1069 -19
- prompts.txt +3 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 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: meus-estudos
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: yellow
|
| 5 |
+
colorTo: blue
|
| 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,1069 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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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 |
+
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Roboto:wght@300;400;500&display=swap');
|
| 11 |
+
|
| 12 |
+
body {
|
| 13 |
+
font-family: 'Roboto', sans-serif;
|
| 14 |
+
background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
|
| 15 |
+
min-height: 100vh;
|
| 16 |
+
color: #e2e8f0;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
.calculator-display {
|
| 20 |
+
font-family: 'Orbitron', sans-serif;
|
| 21 |
+
text-shadow: 0 0 5px rgba(79, 192, 210, 0.7);
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
.glow-effect {
|
| 25 |
+
box-shadow: 0 0 15px rgba(79, 192, 210, 0.5);
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
.btn-operator {
|
| 29 |
+
background: linear-gradient(145deg, #334155, #1e293b);
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
.btn-number {
|
| 33 |
+
background: linear-gradient(145deg, #1e293b, #0f172a);
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
.btn-special {
|
| 37 |
+
background: linear-gradient(145deg, #7c3aed, #5b21b6);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
.btn:hover {
|
| 41 |
+
transform: translateY(-2px);
|
| 42 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
.tab-active {
|
| 46 |
+
border-bottom: 3px solid #7c3aed;
|
| 47 |
+
color: #7c3aed;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
.cyber-border {
|
| 51 |
+
position: relative;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
.cyber-border::before {
|
| 55 |
+
content: '';
|
| 56 |
+
position: absolute;
|
| 57 |
+
top: -2px;
|
| 58 |
+
left: -2px;
|
| 59 |
+
right: -2px;
|
| 60 |
+
bottom: -2px;
|
| 61 |
+
background: linear-gradient(45deg, #7c3aed, #5b21b6, #4f46e5);
|
| 62 |
+
z-index: -1;
|
| 63 |
+
border-radius: inherit;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
.pulse {
|
| 67 |
+
animation: pulse 2s infinite;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
@keyframes pulse {
|
| 71 |
+
0% {
|
| 72 |
+
box-shadow: 0 0 0 0 rgba(79, 192, 210, 0.4);
|
| 73 |
+
}
|
| 74 |
+
70% {
|
| 75 |
+
box-shadow: 0 0 0 10px rgba(79, 192, 210, 0);
|
| 76 |
+
}
|
| 77 |
+
100% {
|
| 78 |
+
box-shadow: 0 0 0 0 rgba(79, 192, 210, 0);
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
.loading {
|
| 83 |
+
display: inline-block;
|
| 84 |
+
width: 20px;
|
| 85 |
+
height: 20px;
|
| 86 |
+
border: 3px solid rgba(255,255,255,.3);
|
| 87 |
+
border-radius: 50%;
|
| 88 |
+
border-top-color: #7c3aed;
|
| 89 |
+
animation: spin 1s ease-in-out infinite;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
@keyframes spin {
|
| 93 |
+
to { transform: rotate(360deg); }
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
.result-card {
|
| 97 |
+
background: linear-gradient(145deg, #1e293b, #0f172a);
|
| 98 |
+
border-left: 4px solid #7c3aed;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
.info-tooltip {
|
| 102 |
+
position: relative;
|
| 103 |
+
display: inline-block;
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
.info-tooltip .tooltip-text {
|
| 107 |
+
visibility: hidden;
|
| 108 |
+
width: 200px;
|
| 109 |
+
background-color: #1e293b;
|
| 110 |
+
color: #fff;
|
| 111 |
+
text-align: center;
|
| 112 |
+
border-radius: 6px;
|
| 113 |
+
padding: 5px;
|
| 114 |
+
position: absolute;
|
| 115 |
+
z-index: 1;
|
| 116 |
+
bottom: 125%;
|
| 117 |
+
left: 50%;
|
| 118 |
+
margin-left: -100px;
|
| 119 |
+
opacity: 0;
|
| 120 |
+
transition: opacity 0.3s;
|
| 121 |
+
font-size: 12px;
|
| 122 |
+
box-shadow: 0 0 10px rgba(0,0,0,0.3);
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
.info-tooltip:hover .tooltip-text {
|
| 126 |
+
visibility: visible;
|
| 127 |
+
opacity: 1;
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
.logo-img {
|
| 131 |
+
max-width: 180px;
|
| 132 |
+
margin: 0 auto 10px;
|
| 133 |
+
filter: drop-shadow(0 0 8px rgba(124, 58, 237, 0.7));
|
| 134 |
+
border-radius: 50%;
|
| 135 |
+
border: 3px solid #7c3aed;
|
| 136 |
+
}
|
| 137 |
+
</style>
|
| 138 |
+
</head>
|
| 139 |
+
<body class="flex items-center justify-center p-4">
|
| 140 |
+
<div class="w-full max-w-md">
|
| 141 |
+
<div class="text-center mb-6">
|
| 142 |
+
<!-- Nova imagem adicionada aqui -->
|
| 143 |
+
<img src="https://raw.githubusercontent.com/DiegoShadow/meu-lab-devops/refs/heads/main/DevDog.png" alt="TechCalc Logo" class="logo-img">
|
| 144 |
+
<h1 class="text-3xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-purple-400 to-cyan-400 mb-2">TECHCALC PRO</h1>
|
| 145 |
+
<p class="text-sm text-gray-400">Sistema Avançado de Cálculos</p>
|
| 146 |
+
</div>
|
| 147 |
+
|
| 148 |
+
<div class="cyber-border rounded-xl overflow-hidden bg-gray-900 p-1 mb-6">
|
| 149 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden">
|
| 150 |
+
<!-- Tabs -->
|
| 151 |
+
<div class="flex border-b border-gray-700">
|
| 152 |
+
<button id="standard-tab" class="flex-1 py-3 font-medium tab-active">
|
| 153 |
+
<i class="fas fa-calculator mr-2"></i> Padrão
|
| 154 |
+
</button>
|
| 155 |
+
<button id="currency-tab" class="flex-1 py-3 font-medium text-gray-400">
|
| 156 |
+
<i class="fas fa-exchange-alt mr-2"></i> Câmbio
|
| 157 |
+
</button>
|
| 158 |
+
<button id="labor-tab" class="flex-1 py-3 font-medium text-gray-400">
|
| 159 |
+
<i class="fas fa-briefcase mr-2"></i> Trabalhista
|
| 160 |
+
</button>
|
| 161 |
+
</div>
|
| 162 |
+
|
| 163 |
+
<!-- Standard Calculator -->
|
| 164 |
+
<div id="standard-calc" class="p-4">
|
| 165 |
+
<!-- Display -->
|
| 166 |
+
<div class="calculator-display bg-gray-900 rounded-lg p-4 mb-4 text-right text-3xl font-bold h-20 overflow-x-auto flex items-center justify-end">
|
| 167 |
+
<span id="display">0</span>
|
| 168 |
+
</div>
|
| 169 |
+
|
| 170 |
+
<!-- Keypad -->
|
| 171 |
+
<div class="grid grid-cols-4 gap-3">
|
| 172 |
+
<!-- Row 1 -->
|
| 173 |
+
<button class="btn-special rounded-lg p-4 text-white font-bold glow-effect" onclick="clearAll()">AC</button>
|
| 174 |
+
<button class="btn-special rounded-lg p-4 text-white font-bold glow-effect" onclick="clearEntry()">CE</button>
|
| 175 |
+
<button class="btn-special rounded-lg p-4 text-white font-bold glow-effect" onclick="percentage()">%</button>
|
| 176 |
+
<button class="btn-operator rounded-lg p-4 text-purple-400 font-bold glow-effect" onclick="appendOperator('/')">/</button>
|
| 177 |
+
|
| 178 |
+
<!-- Row 2 -->
|
| 179 |
+
<button class="btn-number rounded-lg p-4 text-white font-bold glow-effect" onclick="appendNumber('7')">7</button>
|
| 180 |
+
<button class="btn-number rounded-lg p-4 text-white font-bold glow-effect" onclick="appendNumber('8')">8</button>
|
| 181 |
+
<button class="btn-number rounded-lg p-4 text-white font-bold glow-effect" onclick="appendNumber('9')">9</button>
|
| 182 |
+
<button class="btn-operator rounded-lg p-4 text-purple-400 font-bold glow-effect" onclick="appendOperator('*')">×</button>
|
| 183 |
+
|
| 184 |
+
<!-- Row 3 -->
|
| 185 |
+
<button class="btn-number rounded-lg p-4 text-white font-bold glow-effect" onclick="appendNumber('4')">4</button>
|
| 186 |
+
<button class="btn-number rounded-lg p-4 text-white font-bold glow-effect" onclick="appendNumber('5')">5</button>
|
| 187 |
+
<button class="btn-number rounded-lg p-4 text-white font-bold glow-effect" onclick="appendNumber('6')">6</button>
|
| 188 |
+
<button class="btn-operator rounded-lg p-4 text-purple-400 font-bold glow-effect" onclick="appendOperator('-')">-</button>
|
| 189 |
+
|
| 190 |
+
<!-- Row 4 -->
|
| 191 |
+
<button class="btn-number rounded-lg p-4 text-white font-bold glow-effect" onclick="appendNumber('1')">1</button>
|
| 192 |
+
<button class="btn-number rounded-lg p-4 text-white font-bold glow-effect" onclick="appendNumber('2')">2</button>
|
| 193 |
+
<button class="btn-number rounded-lg p-4 text-white font-bold glow-effect" onclick="appendNumber('3')">3</button>
|
| 194 |
+
<button class="btn-operator rounded-lg p-4 text-purple-400 font-bold glow-effect" onclick="appendOperator('+')">+</button>
|
| 195 |
+
|
| 196 |
+
<!-- Row 5 -->
|
| 197 |
+
<button class="btn-number rounded-lg p-4 text-white font-bold glow-effect col-span-2" onclick="appendNumber('0')">0</button>
|
| 198 |
+
<button class="btn-number rounded-lg p-4 text-white font-bold glow-effect" onclick="appendDecimal()">.</button>
|
| 199 |
+
<button class="btn-operator rounded-lg p-4 text-purple-400 font-bold glow-effect pulse" onclick="calculate()">=</button>
|
| 200 |
+
</div>
|
| 201 |
+
</div>
|
| 202 |
+
|
| 203 |
+
<!-- Currency Converter -->
|
| 204 |
+
<div id="currency-calc" class="p-4 hidden">
|
| 205 |
+
<div class="mb-4">
|
| 206 |
+
<label class="block text-gray-400 text-sm mb-2">Valor</label>
|
| 207 |
+
<input type="number" id="currency-amount" class="w-full bg-gray-7 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="Digite o valor" value="1">
|
| 208 |
+
</div>
|
| 209 |
+
|
| 210 |
+
<div class="grid grid-cols-2 gap-4 mb-4">
|
| 211 |
+
<div>
|
| 212 |
+
<label class="block text-gray-400 text-sm mb-2">De</label>
|
| 213 |
+
<select id="from-currency" class="w-full bg-gray-700 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 214 |
+
<option value="USD">USD - Dólar Americano</option>
|
| 215 |
+
<option value="EUR">EUR - Euro</option>
|
| 216 |
+
<option value="GBP">GBP - Libra Esterlina</option>
|
| 217 |
+
<option value="JPY">JPY - Iene Japonês</option>
|
| 218 |
+
<option value="BRL" selected>BRL - Real Brasileiro</option>
|
| 219 |
+
<option value="CAD">CAD - Dólar Canadense</option>
|
| 220 |
+
<option value="AUD">AUD - Dólar Australiano</option>
|
| 221 |
+
<option value="CNY">CNY - Yuan Chinês</option>
|
| 222 |
+
</select>
|
| 223 |
+
</div>
|
| 224 |
+
<div>
|
| 225 |
+
<label class="block text-gray-400 text-sm mb-2">Para</label>
|
| 226 |
+
<select id="to-currency" class="w-full bg-gray-700 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 227 |
+
<option value="USD" selected>USD - Dólar Americano</option>
|
| 228 |
+
<option value="EUR">EUR - Euro</option>
|
| 229 |
+
<option value="GBP">GBP - Libra Esterlina</option>
|
| 230 |
+
<option value="JPY">JPY - Iene Japonês</option>
|
| 231 |
+
<option value="BRL">BRL - Real Brasileiro</option>
|
| 232 |
+
<option value="CAD">CAD - Dólar Canadense</option>
|
| 233 |
+
<option value="AUD">AUD - Dólar Australiano</option>
|
| 234 |
+
<option value="CNY">CNY - Yuan Chinês</option>
|
| 235 |
+
</select>
|
| 236 |
+
</div>
|
| 237 |
+
</div>
|
| 238 |
+
|
| 239 |
+
<div class="flex items-center justify-between mb-4">
|
| 240 |
+
<div class="text-sm text-gray-400">
|
| 241 |
+
<span id="last-update">Última atualização: --/--/----</span>
|
| 242 |
+
</div>
|
| 243 |
+
<button id="refresh-rates" class="text-purple-400 hover:text-purple-300">
|
| 244 |
+
<i class="fas fa-sync-alt"></i>
|
| 245 |
+
</button>
|
| 246 |
+
</div>
|
| 247 |
+
|
| 248 |
+
<button id="convert-btn" class="w-full bg-gradient-to-r from-purple-600 to-blue-500 rounded-lg p-3 text-white font-bold glow-effect hover:from-purple-700 hover:to-blue-600 transition-all duration-300 flex items-center justify-center">
|
| 249 |
+
<span id="convert-text">Converter</span>
|
| 250 |
+
<span id="convert-loader" class="loading ml-2 hidden"></span>
|
| 251 |
+
</button>
|
| 252 |
+
|
| 253 |
+
<div id="currency-result" class="mt-6 bg-gray-900 rounded-lg p-4 text-center hidden">
|
| 254 |
+
<div class="text-2xl font-bold mb-2" id="converted-amount">0</div>
|
| 255 |
+
<div class="text-gray-400 text-sm" id="conversion-rate">1 BRL = 0.20 USD</div>
|
| 256 |
+
<div class="text-xs text-gray-500 mt-2" id="api-source">Dados fornecidos por ExchangeRate-API</div>
|
| 257 |
+
</div>
|
| 258 |
+
</div>
|
| 259 |
+
|
| 260 |
+
<!-- Labor Calculator -->
|
| 261 |
+
<div id="labor-calc" class="p-4 hidden">
|
| 262 |
+
<div class="mb-4">
|
| 263 |
+
<label class="block text-gray-400 text-sm mb-2">Tipo de Cálculo</label>
|
| 264 |
+
<select id="labor-type" class="w-full bg-gray-700 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 265 |
+
<option value="ferias">Férias</option>
|
| 266 |
+
<option value="rescisao">Rescisão</option>
|
| 267 |
+
<option value="aposentadoria">Aposentadoria</option>
|
| 268 |
+
</select>
|
| 269 |
+
</div>
|
| 270 |
+
|
| 271 |
+
<!-- Common Fields -->
|
| 272 |
+
<div class="mb-4">
|
| 273 |
+
<label class="block text-gray-400 text-sm mb-2">Salário Bruto (R$)</label>
|
| 274 |
+
<input type="number" id="salary", class="w-full bg-gray-700 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="Digite o salário bruto">
|
| 275 |
+
</div>
|
| 276 |
+
|
| 277 |
+
<!-- Férias Fields -->
|
| 278 |
+
<div id="ferias-fields">
|
| 279 |
+
<div class="grid grid-cols-2 gap-4 mb-4">
|
| 280 |
+
<div>
|
| 281 |
+
<label class="block text-gray-400 text-sm mb-2">Tempo de Serviço (meses)</label>
|
| 282 |
+
<input type="number" id="service-time", class="w-full bg-gray-700 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="Meses trabalhados", min="1", max="12", value="12">
|
| 283 |
+
</div>
|
| 284 |
+
<div>
|
| 285 |
+
<label class="block text-gray-400 text-sm mb-2">Abono Pecuniário</label>
|
| 286 |
+
<select id="abono", class="w-full bg-gray-700 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 287 |
+
<option value="0">Não</option>
|
| 288 |
+
<option value="1">Sim (1/3)</option>
|
| 289 |
+
</select>
|
| 290 |
+
</div>
|
| 291 |
+
</div>
|
| 292 |
+
</div>
|
| 293 |
+
|
| 294 |
+
<!-- Rescisão Fields -->
|
| 295 |
+
<div id="rescisao-fields" class="hidden">
|
| 296 |
+
<div class="grid grid-cols-2 gap-4 mb-4">
|
| 297 |
+
<div>
|
| 298 |
+
<label class="block text-gray-400 text-sm mb-2">Tipo de Demissão</label>
|
| 299 |
+
<select id="demission-type", class="w-full bg-gray-700 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 300 |
+
<option value="semJustaCausa">Sem justa causa</option>
|
| 301 |
+
<option value="comJustaCausa">Com justa causa</option>
|
| 302 |
+
<option value="pedidoDemissao">Pedido de demissão</option>
|
| 303 |
+
</select>
|
| 304 |
+
</div>
|
| 305 |
+
<div>
|
| 306 |
+
<label class="block text-gray-400 text-sm mb-2">Tempo de Serviço (anos)</label>
|
| 307 |
+
<input type="number" id="service-years", class="w-full bg-gray-700 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="Anos trabalhados", min="0", value="1">
|
| 308 |
+
</div>
|
| 309 |
+
</div>
|
| 310 |
+
<div class="mb-4">
|
| 311 |
+
<label class="block text-gray-400 text-sm mb-2">Aviso Prévio</label>
|
| 312 |
+
<select id="aviso-previo", class="w-full bg-gray-700 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 313 |
+
<option value="trabalhado">Trabalhado</option>
|
| 314 |
+
<option value="indenizado">Indenizado</option>
|
| 315 |
+
</select>
|
| 316 |
+
</div>
|
| 317 |
+
<div class="mb-4">
|
| 318 |
+
<label class="block text-gray-400 text-sm mb-2">Saldo FGTS + Multa</label>
|
| 319 |
+
<select id="fgts", class="w-full bg-gray-700 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 320 |
+
<option value="1">Sim</option>
|
| 321 |
+
<option value="0">Não</option>
|
| 322 |
+
</select>
|
| 323 |
+
</div>
|
| 324 |
+
</div>
|
| 325 |
+
|
| 326 |
+
<!-- Aposentadoria Fields -->
|
| 327 |
+
<div id="aposentadoria-fields" class="hidden">
|
| 328 |
+
<div class="grid grid-cols-2 gap-4 mb-4">
|
| 329 |
+
<div>
|
| 330 |
+
<label class="block text-gray-400 text-sm mb-2">Idade</label>
|
| 331 |
+
<input type="number" id="age", class="w-full bg-gray-700 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="Idade atual", min="18", value="30">
|
| 332 |
+
</div>
|
| 333 |
+
<div>
|
| 334 |
+
<label class="block text-gray-400 text-sm mb-2">Tempo de Contribuição</label>
|
| 335 |
+
<input type="number" id="contribution-time", class="w-full bg-gray-700 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="Anos contribuídos", min="0", value="5">
|
| 336 |
+
</div>
|
| 337 |
+
</div>
|
| 338 |
+
<div class="mb-4">
|
| 339 |
+
<label class="block text-gray-400 text-sm mb-2">Gênero</label>
|
| 340 |
+
<select id="gender", class="w-full bg-gray-700 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 341 |
+
<option value="masculino">Masculino</option>
|
| 342 |
+
<option value="feminino">Feminino</option>
|
| 343 |
+
</select>
|
| 344 |
+
</div>
|
| 345 |
+
<div class="mb-4">
|
| 346 |
+
<label class="block text-gray-400 text-sm mb-2">Regime</label>
|
| 347 |
+
<select id="regime", class="w-full bg-gray-700 rounded-lg p-3 text-white focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 348 |
+
<option value="INSS">INSS</option>
|
| 349 |
+
<option value="RPPS">RPPS (Servidor Público)</option>
|
| 350 |
+
</select>
|
| 351 |
+
</div>
|
| 352 |
+
</div>
|
| 353 |
+
|
| 354 |
+
<button id="calculate-labor", class="w-full bg-gradient-to-r from-purple-600 to-blue-500 rounded-lg p-3 text-white font-bold glow-effect hover:from-purple-700 hover:to-blue-600 transition-all duration-300 flex items-center justify-center">
|
| 355 |
+
<span id="labor-text">Calcular</span>
|
| 356 |
+
<span id="labor-loader", class="loading ml-2 hidden"></span>
|
| 357 |
+
</button>
|
| 358 |
+
|
| 359 |
+
<div id="labor-result", class="mt-6 hidden">
|
| 360 |
+
<div class="result-card rounded-lg p-4 mb-3">
|
| 361 |
+
<h3 class="font-bold text-lg mb-2 text-purple-400" id="labor-title">Resultado</h3>
|
| 362 |
+
<div class="space-y-2">
|
| 363 |
+
<div class="flex justify-between">
|
| 364 |
+
<span>Valor Bruto:</span>
|
| 365 |
+
<span class="font-bold" id="gross-value">R$ 0,00</span>
|
| 366 |
+
</div>
|
| 367 |
+
<div class="flex justify-between">
|
| 368 |
+
<span>Descontos:</span>
|
| 369 |
+
<span class="font-bold" id="discounts">R$ 0,00</span>
|
| 370 |
+
</div>
|
| 371 |
+
<div class="flex justify-between">
|
| 372 |
+
<span>Valor Líquido:</span>
|
| 373 |
+
<span class="font-bold text-green-400" id="net-value">R$ 0,00</span>
|
| 374 |
+
</div>
|
| 375 |
+
</div>
|
| 376 |
+
</div>
|
| 377 |
+
|
| 378 |
+
<div id="ferias-details", class="hidden">
|
| 379 |
+
<div class="result-card rounded-lg p-4 mb-3">
|
| 380 |
+
<h4 class="font-bold mb-2">Detalhes das Férias</h4>
|
| 381 |
+
<div class="space-y-2 text-sm">
|
| 382 |
+
<div class="flex justify-between">
|
| 383 |
+
<span>1/3 de Férias:</span>
|
| 384 |
+
<span id="one-third">R$ 0,00</span>
|
| 385 |
+
</div>
|
| 386 |
+
<div class="flex justify-between">
|
| 387 |
+
<span>Abono Pecuniário:</span>
|
| 388 |
+
<span id="abono-value">R$ 0,00</span>
|
| 389 |
+
</div>
|
| 390 |
+
<div class="flex justify-between">
|
| 391 |
+
<span>INSS:</span>
|
| 392 |
+
<span id="inss-ferias">R$ 0,00</span>
|
| 393 |
+
</div>
|
| 394 |
+
<div class="flex justify-between">
|
| 395 |
+
<span>IRRF:</span>
|
| 396 |
+
<span id="irrf-ferias">R$ 0,00</span>
|
| 397 |
+
</div>
|
| 398 |
+
</div>
|
| 399 |
+
</div>
|
| 400 |
+
</div>
|
| 401 |
+
|
| 402 |
+
<div id="rescisao-details", class="hidden">
|
| 403 |
+
<div class="result-card rounded-lg p-4 mb-3">
|
| 404 |
+
<h4 class="font-bold mb-2">Detalhes da Rescisão</h4>
|
| 405 |
+
<div class="space-y-2 text-sm">
|
| 406 |
+
<div class="flex justify-between">
|
| 407 |
+
<span>Saldo Salário:</span>
|
| 408 |
+
<span id="saldo-salario">R$ 0,00</span>
|
| 409 |
+
</div>
|
| 410 |
+
<div class="flex justify-between">
|
| 411 |
+
<span>Férias Proporcionais:</span>
|
| 412 |
+
<span id="ferias-proporcionais">R$ 0,00</span>
|
| 413 |
+
</div>
|
| 414 |
+
<div class="flex justify-between">
|
| 415 |
+
<span>13º Proporcional:</span>
|
| 416 |
+
<span id="decimo-terceiro">R$ 0,00</span>
|
| 417 |
+
</div>
|
| 418 |
+
<div class="flex justify-between">
|
| 419 |
+
<span>Aviso Prévio:</span>
|
| 420 |
+
<span id="aviso-previo-value">R$ 0,00</span>
|
| 421 |
+
</div>
|
| 422 |
+
<div class="flex justify-between">
|
| 423 |
+
<span>Multa FGTS (40%):</span>
|
| 424 |
+
<span id="fgts-multa">R$ 0,00</span>
|
| 425 |
+
</div>
|
| 426 |
+
</div>
|
| 427 |
+
</div>
|
| 428 |
+
</div>
|
| 429 |
+
|
| 430 |
+
<div id="aposentadoria-details", class="hidden">
|
| 431 |
+
<div class="result-card rounded-lg p-4">
|
| 432 |
+
<h4 class="font-bold mb-2">Detalhes da Aposentadoria</h4>
|
| 433 |
+
<div class="space-y-2 text-sm">
|
| 434 |
+
<div class="flex justify-between">
|
| 435 |
+
<span>Tempo Restante:</span>
|
| 436 |
+
<span id="remaining-time">0 anos</span>
|
| 437 |
+
</div>
|
| 438 |
+
<div class="flex justify-between">
|
| 439 |
+
<span>Idade Mínima:</span>
|
| 440 |
+
<span id="min-age">65 anos</span>
|
| 441 |
+
</div>
|
| 442 |
+
<div class="flex justify-between">
|
| 443 |
+
<span>Tempo Mínimo:</span>
|
| 444 |
+
<span id="min-contribution">15 anos</span>
|
| 445 |
+
</div>
|
| 446 |
+
<div class="flex justify-between">
|
| 447 |
+
<span>Valor Estimado:</span>
|
| 448 |
+
<span id="estimated-pension">R$ 0,00</span>
|
| 449 |
+
</div>
|
| 450 |
+
</div>
|
| 451 |
+
</div>
|
| 452 |
+
</div>
|
| 453 |
+
</div>
|
| 454 |
+
</div>
|
| 455 |
+
</div>
|
| 456 |
+
</div>
|
| 457 |
+
|
| 458 |
+
<div class="text-center text-gray-500 text-xs">
|
| 459 |
+
<p>TechCalc Pro v3.0 | Cálculos Trabalhistas Atualizados 2024</p>
|
| 460 |
+
</div>
|
| 461 |
+
</div>
|
| 462 |
+
|
| 463 |
+
<script>
|
| 464 |
+
// Calculator logic
|
| 465 |
+
let currentInput = '0';
|
| 466 |
+
let previousInput = '';
|
| 467 |
+
let operation = null;
|
| 468 |
+
let resetScreen = false;
|
| 469 |
+
|
| 470 |
+
const display = document.getElementById('display');
|
| 471 |
+
const standardCalc = document.getElementById('standard-calc');
|
| 472 |
+
const currencyCalc = document.getElementById('currency-calc');
|
| 473 |
+
const laborCalc = document.getElementById('labor-calc');
|
| 474 |
+
const standardTab = document.getElementById('standard-tab');
|
| 475 |
+
const currencyTab = document.getElementById('currency-tab');
|
| 476 |
+
const laborTab = document.getElementById('labor-tab');
|
| 477 |
+
|
| 478 |
+
// Tab switching
|
| 479 |
+
standardTab.addEventListener('click', () => {
|
| 480 |
+
standardTab.classList.add('tab-active');
|
| 481 |
+
standardTab.classList.remove('text-gray-400');
|
| 482 |
+
currencyTab.classList.remove('tab-active');
|
| 483 |
+
currencyTab.classList.add('text-gray-400');
|
| 484 |
+
laborTab.classList.remove('tab-active');
|
| 485 |
+
laborTab.classList.add('text-gray-400');
|
| 486 |
+
standardCalc.classList.remove('hidden');
|
| 487 |
+
currencyCalc.classList.add('hidden');
|
| 488 |
+
laborCalc.classList.add('hidden');
|
| 489 |
+
});
|
| 490 |
+
|
| 491 |
+
currencyTab.addEventListener('click', () => {
|
| 492 |
+
currencyTab.classList.add('tab-active');
|
| 493 |
+
currencyTab.classList.remove('text-gray-400');
|
| 494 |
+
standardTab.classList.remove('tab-active');
|
| 495 |
+
standardTab.classList.add('text-gray-400');
|
| 496 |
+
laborTab.classList.remove('tab-active');
|
| 497 |
+
laborTab.classList.add('text-gray-400');
|
| 498 |
+
currencyCalc.classList.remove('hidden');
|
| 499 |
+
standardCalc.classList.add('hidden');
|
| 500 |
+
laborCalc.classList.add('hidden');
|
| 501 |
+
|
| 502 |
+
// Fetch rates when currency tab is opened
|
| 503 |
+
fetchExchangeRates();
|
| 504 |
+
});
|
| 505 |
+
|
| 506 |
+
laborTab.addEventListener('click', () => {
|
| 507 |
+
laborTab.classList.add('tab-active');
|
| 508 |
+
laborTab.classList.remove('text-gray-400');
|
| 509 |
+
standardTab.classList.remove('tab-active');
|
| 510 |
+
standardTab.classList.add('text-gray-400');
|
| 511 |
+
currencyTab.classList.remove('tab-active');
|
| 512 |
+
currencyTab.classList.add('text-gray-400');
|
| 513 |
+
laborCalc.classList.remove('hidden');
|
| 514 |
+
standardCalc.classList.add('hidden');
|
| 515 |
+
currencyCalc.classList.add('hidden');
|
| 516 |
+
|
| 517 |
+
// Reset labor calculator fields
|
| 518 |
+
resetLaborFields();
|
| 519 |
+
});
|
| 520 |
+
|
| 521 |
+
// Update display
|
| 522 |
+
function updateDisplay() {
|
| 523 |
+
display.textContent = currentInput;
|
| 524 |
+
}
|
| 525 |
+
|
| 526 |
+
// Append number
|
| 527 |
+
function appendNumber(number) {
|
| 528 |
+
if (currentInput === '0' || resetScreen) {
|
| 529 |
+
currentInput = number;
|
| 530 |
+
resetScreen = false;
|
| 531 |
+
} else {
|
| 532 |
+
currentInput += number;
|
| 533 |
+
}
|
| 534 |
+
updateDisplay();
|
| 535 |
+
}
|
| 536 |
+
|
| 537 |
+
// Append decimal
|
| 538 |
+
function appendDecimal() {
|
| 539 |
+
if (resetScreen) {
|
| 540 |
+
currentInput = '0.';
|
| 541 |
+
resetScreen = false;
|
| 542 |
+
updateDisplay();
|
| 543 |
+
return;
|
| 544 |
+
}
|
| 545 |
+
|
| 546 |
+
if (!currentInput.includes('.')) {
|
| 547 |
+
currentInput += '.';
|
| 548 |
+
updateDisplay();
|
| 549 |
+
}
|
| 550 |
+
}
|
| 551 |
+
|
| 552 |
+
// Append operator
|
| 553 |
+
function appendOperator(op) {
|
| 554 |
+
if (operation !== null) calculate();
|
| 555 |
+
previousInput = currentInput;
|
| 556 |
+
operation = op;
|
| 557 |
+
resetScreen = true;
|
| 558 |
+
}
|
| 559 |
+
|
| 560 |
+
// Calculate
|
| 561 |
+
function calculate() {
|
| 562 |
+
if (operation === null || resetScreen) return;
|
| 563 |
+
|
| 564 |
+
let result;
|
| 565 |
+
const prev = parseFloat(previousInput);
|
| 566 |
+
const current = parseFloat(currentInput);
|
| 567 |
+
|
| 568 |
+
switch (operation) {
|
| 569 |
+
case '+':
|
| 570 |
+
result = prev + current;
|
| 571 |
+
break;
|
| 572 |
+
case '-':
|
| 573 |
+
result = prev - current;
|
| 574 |
+
break;
|
| 575 |
+
case '*':
|
| 576 |
+
result = prev * current;
|
| 577 |
+
break;
|
| 578 |
+
case '/':
|
| 579 |
+
result = prev / current;
|
| 580 |
+
break;
|
| 581 |
+
default:
|
| 582 |
+
return;
|
| 583 |
+
}
|
| 584 |
+
|
| 585 |
+
currentInput = result.toString();
|
| 586 |
+
operation = null;
|
| 587 |
+
updateDisplay();
|
| 588 |
+
}
|
| 589 |
+
|
| 590 |
+
// Clear all
|
| 591 |
+
function clearAll() {
|
| 592 |
+
currentInput = '0';
|
| 593 |
+
previousInput = '';
|
| 594 |
+
operation = null;
|
| 595 |
+
updateDisplay();
|
| 596 |
+
}
|
| 597 |
+
|
| 598 |
+
// Clear entry
|
| 599 |
+
function clearEntry() {
|
| 600 |
+
currentInput = '0';
|
| 601 |
+
updateDisplay();
|
| 602 |
+
}
|
| 603 |
+
|
| 604 |
+
// Percentage
|
| 605 |
+
function percentage() {
|
| 606 |
+
currentInput = (parseFloat(currentInput) / 100).toString();
|
| 607 |
+
updateDisplay();
|
| 608 |
+
}
|
| 609 |
+
|
| 610 |
+
// Initialize
|
| 611 |
+
updateDisplay();
|
| 612 |
+
|
| 613 |
+
// Currency converter logic
|
| 614 |
+
const convertBtn = document.getElementById('convert-btn');
|
| 615 |
+
const currencyResult = document.getElementById('currency-result');
|
| 616 |
+
const convertedAmount = document.getElementById('converted-amount');
|
| 617 |
+
const conversionRate = document.getElementById('conversion-rate');
|
| 618 |
+
const lastUpdate = document.getElementById('last-update');
|
| 619 |
+
const refreshRates = document.getElementById('refresh-rates');
|
| 620 |
+
const convertText = document.getElementById('convert-text');
|
| 621 |
+
const convertLoader = document.getElementById('convert-loader');
|
| 622 |
+
|
| 623 |
+
let exchangeRates = {};
|
| 624 |
+
let lastUpdated = null;
|
| 625 |
+
|
| 626 |
+
// Fetch exchange rates from API
|
| 627 |
+
async function fetchExchangeRates() {
|
| 628 |
+
try {
|
| 629 |
+
showLoading(true);
|
| 630 |
+
|
| 631 |
+
// Using ExchangeRate-API (free tier)
|
| 632 |
+
const response = await fetch('https://api.exchangerate-api.com/v4/latest/BRL');
|
| 633 |
+
|
| 634 |
+
if (!response.ok) {
|
| 635 |
+
throw new Error('Falha ao obter taxas de câmbio');
|
| 636 |
+
}
|
| 637 |
+
|
| 638 |
+
const data = await response.json();
|
| 639 |
+
exchangeRats = data.rates;
|
| 640 |
+
lastUpdated = new Date(data.time_last_updated * 1000);
|
| 641 |
+
|
| 642 |
+
// Update last updated time
|
| 643 |
+
const options = { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' };
|
| 644 |
+
lastUpdate.textContent = `Última atualização: ${lastUpdated.toLocaleDateString('pt-BR', options)}`;
|
| 645 |
+
|
| 646 |
+
// Perform conversion with updated rates
|
| 647 |
+
performConversion();
|
| 648 |
+
} catch (error) {
|
| 649 |
+
console.error('Erro ao buscar taxas:', error);
|
| 650 |
+
alert('Erro ao buscar taxas de câmbio. Usando dados locais como fallback.');
|
| 651 |
+
useFallbackRates();
|
| 652 |
+
} finally {
|
| 653 |
+
showLoading(false);
|
| 654 |
+
}
|
| 655 |
+
}
|
| 656 |
+
|
| 657 |
+
// Fallback rates if API fails
|
| 658 |
+
function useFallbackRates() {
|
| 659 |
+
exchangeRates = {
|
| 660 |
+
USD: 0.20,
|
| 661 |
+
EUR: 0.18,
|
| 662 |
+
GBP: 0.16,
|
| 663 |
+
JPY: 30.30,
|
| 664 |
+
BRL: 1,
|
| 665 |
+
CAD: 0.27,
|
| 666 |
+
AUD: 0.30,
|
| 667 |
+
CNY: 1.43
|
| 668 |
+
};
|
| 669 |
+
|
| 670 |
+
lastUpdated = new Date();
|
| 671 |
+
const options = { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' };
|
| 672 |
+
lastUpdate.textContent = `Última atualização: ${lastUpdated.toLocaleDateString('pt-BR', options)} (offline)`;
|
| 673 |
+
|
| 674 |
+
performConversion();
|
| 675 |
+
}
|
| 676 |
+
|
| 677 |
+
// Perform the currency conversion
|
| 678 |
+
function performConversion() {
|
| 679 |
+
const amount = parseFloat(document.getElementById('currency-amount').value);
|
| 680 |
+
const fromCurrency = document.getElementById('from-currency').value;
|
| 681 |
+
const toCurrency = document.getElementById('to-currency').value;
|
| 682 |
+
|
| 683 |
+
if (isNaN(amount)) {
|
| 684 |
+
alert('Por favor, digite um valor válido');
|
| 685 |
+
return;
|
| 686 |
+
}
|
| 687 |
+
|
| 688 |
+
if (fromCurrency === toCurrency) {
|
| 689 |
+
convertedAmount.textContent = amount.toFixed(2);
|
| 690 |
+
conversionRate.textContent = `1 ${fromCurrency} = 1 ${toCurrency}`;
|
| 691 |
+
} else {
|
| 692 |
+
// Convert via USD as base if needed (since free API often has USD as base)
|
| 693 |
+
let rate;
|
| 694 |
+
|
| 695 |
+
if (fromCurrency === 'BRL') {
|
| 696 |
+
rate = exchangeRates[toCurrency];
|
| 697 |
+
} else if (toCurrency === 'BRL') {
|
| 698 |
+
rate = 1 / exchangeRates[fromCurrency];
|
| 699 |
+
} else {
|
| 700 |
+
// Convert fromCurrency -> BRL -> toCurrency
|
| 701 |
+
rate = (1 / exchangeRates[fromCurrency]) * exchangeRates[toCurrency];
|
| 702 |
+
}
|
| 703 |
+
|
| 704 |
+
const result = amount * rate;
|
| 705 |
+
|
| 706 |
+
convertedAmount.textContent = result.toFixed(2);
|
| 707 |
+
conversionRate.textContent = `1 ${fromCurrency} = ${rate.toFixed(6)} ${toCurrency}`;
|
| 708 |
+
}
|
| 709 |
+
|
| 710 |
+
currencyResult.classList.remove('hidden');
|
| 711 |
+
}
|
| 712 |
+
|
| 713 |
+
// Show loading state
|
| 714 |
+
function showLoading(isLoading) {
|
| 715 |
+
if (isLoading) {
|
| 716 |
+
convertText.textContent = 'Buscando dados...';
|
| 717 |
+
convertLoader.classList.remove('hidden');
|
| 718 |
+
convertBtn.disabled = true;
|
| 719 |
+
} else {
|
| 720 |
+
convertText.textContent = 'Converter';
|
| 721 |
+
convertLoader.classList.add('hidden');
|
| 722 |
+
convertBtn.disabled = false;
|
| 723 |
+
}
|
| 724 |
+
}
|
| 725 |
+
|
| 726 |
+
// Labor calculator logic
|
| 727 |
+
const laborType = document.getElementById('labor-type');
|
| 728 |
+
const feriasFields = document.getElementById('ferias-fields');
|
| 729 |
+
const rescisaoFields = document.getElementById('rescisao-fields');
|
| 730 |
+
const aposentadoriaFields = document.getElementById('aposentadoria-fields');
|
| 731 |
+
const calculateLaborBtn = document.getElementById('calculate-labor');
|
| 732 |
+
const laborResult = document.getElementById('labor-result');
|
| 733 |
+
const laborText = document.getElementById('labor-text');
|
| 734 |
+
const laborLoader = document.getElementById('labor-loader');
|
| 735 |
+
|
| 736 |
+
// Show/hide fields based on labor type
|
| 737 |
+
laborType.addEventListener('change', function() {
|
| 738 |
+
resetLaborFields();
|
| 739 |
+
|
| 740 |
+
const type = this.value;
|
| 741 |
+
|
| 742 |
+
feriasFields.classList.add('hidden');
|
| 743 |
+
rescisaoFields.classList.add('hidden');
|
| 744 |
+
aposentadoriaFields.classList.add('hidden');
|
| 745 |
+
|
| 746 |
+
if (type === 'ferias') {
|
| 747 |
+
feriasFields.classList.remove('hidden');
|
| 748 |
+
} else if (type === 'rescisao') {
|
| 749 |
+
rescisaoFields.classList.remove('hidden');
|
| 750 |
+
} else if (type === 'aposentadoria') {
|
| 751 |
+
aposentadoriaFields.classList.remove('hidden');
|
| 752 |
+
}
|
| 753 |
+
});
|
| 754 |
+
|
| 755 |
+
// Reset labor fields
|
| 756 |
+
function resetLaborFields() {
|
| 757 |
+
document.getElementById('ferias-details').classList.add('hidden');
|
| 758 |
+
document.getElementById('rescisao-details').classList.add('hidden');
|
| 759 |
+
document.getElementById('aposentadoria-details').classList.add('hidden');
|
| 760 |
+
laborResult.classList.add('hidden');
|
| 761 |
+
}
|
| 762 |
+
|
| 763 |
+
// Format currency
|
| 764 |
+
function formatCurrency(value) {
|
| 765 |
+
return new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(value);
|
| 766 |
+
}
|
| 767 |
+
|
| 768 |
+
// Calculate labor values
|
| 769 |
+
calculateLaborBtn.addEventListener('click', function() {
|
| 770 |
+
const type = laborType.value;
|
| 771 |
+
const salary = parseFloat(document.getElementById('salary').value);
|
| 772 |
+
|
| 773 |
+
if (isNaN(salary) || salary <= 0) {
|
| 774 |
+
alert('Por favor, digite um salário válido');
|
| 775 |
+
return;
|
| 776 |
+
}
|
| 777 |
+
|
| 778 |
+
showLaborLoading(true);
|
| 779 |
+
|
| 780 |
+
// Simulate calculation delay
|
| 781 |
+
setTimeout(() => {
|
| 782 |
+
if (type === 'ferias') {
|
| 783 |
+
calculateFerias(salary);
|
| 784 |
+
} else if (type === 'rescisao') {
|
| 785 |
+
calculateRescisao(salary);
|
| 786 |
+
} else if (type === 'aposentadoria') {
|
| 787 |
+
calculateAposentadoria(salary);
|
| 788 |
+
}
|
| 789 |
+
|
| 790 |
+
showLaborLoading(false);
|
| 791 |
+
laborResult.classList.remove('hidden');
|
| 792 |
+
}, 500);
|
| 793 |
+
});
|
| 794 |
+
|
| 795 |
+
// Calculate férias
|
| 796 |
+
function calculateFerias(salary) {
|
| 797 |
+
const serviceTime = parseInt(document.getElementById('service-time').value);
|
| 798 |
+
const abono = parseInt(document.getElementById('abono').value);
|
| 799 |
+
|
| 800 |
+
// Validate service time (1-12 months)
|
| 801 |
+
const months = Math.min(Math.max(serviceTime, 1), 12);
|
| 802 |
+
|
| 803 |
+
// Calculate proportional value
|
| 804 |
+
const proportionalValue = (salary * months) / 12;
|
| 805 |
+
|
| 806 |
+
// 1/3 of férias (constitutional right)
|
| 807 |
+
const oneThird = proportionalValue / 3;
|
| 808 |
+
|
| 809 |
+
// Abono pecuniário (optional 1/3 more)
|
| 810 |
+
const abonoValue = abono ? proportionalValue / 3 : 0;
|
| 811 |
+
|
| 812 |
+
// Total gross value
|
| 813 |
+
const grossValue = proportionalValue + oneThird + abonoValue;
|
| 814 |
+
|
| 815 |
+
// Calculate INSS (using 2024 rates)
|
| 816 |
+
let inss = 0;
|
| 817 |
+
if (grossValue <= 1412.00) {
|
| 818 |
+
inss = grossValue * 0.075;
|
| 819 |
+
} else if (grossValue <= 2666.68) {
|
| 820 |
+
inss = (1412.00 * 0.075) + ((grossValue - 1412.00) * 0.09);
|
| 821 |
+
} else if (grossValue <= 4000.03) {
|
| 822 |
+
inss = (1412.00 * 0.075) + ((2666.68 - 1412.00) * 0.09) + ((grossValue - 2666.68) * 0.12);
|
| 823 |
+
} else if (grossValue <= 7786.02) {
|
| 824 |
+
inss = (1412.00 * 0.075) + ((2666.68 - 1412.00) * 0.09) + ((4000.03 - 2666.68) * 0.12) + ((grossValue - 4000.03) * 0.14);
|
| 825 |
+
} else {
|
| 826 |
+
inss = 7786.02 * 0.14;
|
| 827 |
+
}
|
| 828 |
+
|
| 829 |
+
// Calculate IRRF (using 2024 rates)
|
| 830 |
+
const baseIR = grossValue - inss;
|
| 831 |
+
let irrf = 0;
|
| 832 |
+
|
| 833 |
+
if (baseIR <= 2112.00) {
|
| 834 |
+
irrf = 0;
|
| 835 |
+
} else if (baseIR <= 2826.65) {
|
| 836 |
+
irrf = (baseIR * 0.075) - 158.40;
|
| 837 |
+
} else if (baseIR <= 3751.05) {
|
| 838 |
+
irrf = (baseIR * 0.15) - 370.40;
|
| 839 |
+
} else if (baseIR <= 4664.68) {
|
| 840 |
+
irrf = (baseIR * 0.225) - 651.73;
|
| 841 |
+
} else {
|
| 842 |
+
irrf = (baseIR * 0.275) - 884.96;
|
| 843 |
+
}
|
| 844 |
+
|
| 845 |
+
// Ensure IRRF is not negative
|
| 846 |
+
irrf = Math.max(irrf, 0);
|
| 847 |
+
|
| 848 |
+
// Net value
|
| 849 |
+
const netValue = grossValue - inss - irrf;
|
| 850 |
+
|
| 851 |
+
// Update UI
|
| 852 |
+
document.getElementById('labor-title').textContent = 'Cálculo de Férias';
|
| 853 |
+
document.getElementById('gross-value').textContent = formatCurrency(grossValue);
|
| 854 |
+
document.getElementById('discounts').textContent = formatCurrency(inss + irrf);
|
| 855 |
+
document.getElementById('net-value').textContent = formatCurrency(netValue);
|
| 856 |
+
|
| 857 |
+
// Show details
|
| 858 |
+
document.getElementById('ferias-details').classList.remove('hidden');
|
| 859 |
+
document.getElementById('rescisao-details').classList.add('hidden');
|
| 860 |
+
document.getElementById('aposentadoria-details').classList.add('hidden');
|
| 861 |
+
|
| 862 |
+
// Update details
|
| 863 |
+
document.getElementById('one-third').textContent = formatCurrency(oneThird);
|
| 864 |
+
document.getElementById('abono-value').textContent = formatCurrency(abonoValue);
|
| 865 |
+
document.getElementById('inss-ferias').textContent = formatCurrency(inss);
|
| 866 |
+
document.getElementById('irrf-ferias').textContent = formatCurrency(irrf);
|
| 867 |
+
}
|
| 868 |
+
|
| 869 |
+
// Calculate rescisão
|
| 870 |
+
function calculateRescisao(salary) {
|
| 871 |
+
const demissionType = document.getElementById('demission-type').value;
|
| 872 |
+
const serviceYears = parseInt(document.getElementById('service-years').value);
|
| 873 |
+
const avisoPrevio = document.getElementById('aviso-previo').value;
|
| 874 |
+
const fgts = document.getElementById('fgts').value === '1';
|
| 875 |
+
|
| 876 |
+
// Calculate proportional 13th salary
|
| 877 |
+
const decimoTerceiro = (salary * serviceYears) / 12;
|
| 878 |
+
|
| 879 |
+
// Calculate proportional vacation + 1/3
|
| 880 |
+
const feriasProporcionais = (salary * serviceYears) / 12;
|
| 881 |
+
const oneThirdFerias = feriasProporcionais / 3;
|
| 882 |
+
|
| 883 |
+
// Calculate saldo de salário (assuming 1 month)
|
| 884 |
+
const saldoSalario = salary;
|
| 885 |
+
|
| 886 |
+
// Calculate aviso prévio (1 month salary)
|
| 887 |
+
const avisoPrevioValue = avisoPrevio === 'indenizado' ? salary : 0;
|
| 888 |
+
|
| 889 |
+
// Calculate FGTS + 40% multa (if applicable)
|
| 890 |
+
let fgtsMulta = 0;
|
| 891 |
+
if (fgts && demissionType === 'semJustaCausa') {
|
| 892 |
+
// 8% of salary per year + 40% of total FGTS
|
| 893 |
+
const totalFGTS = salary * 0.08 * serviceYears;
|
| 894 |
+
fgtsMulta = totalFGTS * 0.4;
|
| 895 |
+
}
|
| 896 |
+
|
| 897 |
+
// Calculate total based on demission type
|
| 898 |
+
let grossValue = 0;
|
| 899 |
+
|
| 900 |
+
if (demissionType === 'semJustaCausa') {
|
| 901 |
+
grossValue = saldoSalario + decimoTerceiro + feriasProporcionais + oneThirdFerias + avisoPrevioValue + fgtsMulta;
|
| 902 |
+
} else if (demissionType === 'comJustaCausa') {
|
| 903 |
+
grossValue = saldoSalario + decimoTerceiro + feriasProporcionais + oneThirdFerias;
|
| 904 |
+
} else { // pedidoDemissao
|
| 905 |
+
grossValue = saldoSalario + decimoTerceiro + feriasProporcionais + oneThirdFerias;
|
| 906 |
+
}
|
| 907 |
+
|
| 908 |
+
// Calculate INSS (using 2024 rates)
|
| 909 |
+
let inss = 0;
|
| 910 |
+
if (grossValue <= 1412.00) {
|
| 911 |
+
inss = grossValue * 0.075;
|
| 912 |
+
} else if (grossValue <= 2666.68) {
|
| 913 |
+
inss = (1412.00 * 0.075) + ((grossValue - 1412.00) * 0.09);
|
| 914 |
+
} else if (grossValue <= 4000.03) {
|
| 915 |
+
inss = (1412.00 * 0.075) + ((2666.68 - 1412.00) * 0.09) + ((grossValue - 2666.68) * 0.12);
|
| 916 |
+
} else if (grossValue <= 7786.02) {
|
| 917 |
+
inss = (1412.00 * 0.075) + ((2666.68 - 1412.00) * 0.09) + ((4000.03 - 2666.68) * 0.12) + ((grossValue - 4000.03) * 0.14);
|
| 918 |
+
} else {
|
| 919 |
+
inss = 7786.02 * 0.14;
|
| 920 |
+
}
|
| 921 |
+
|
| 922 |
+
// Calculate IRRF (using 2024 rates)
|
| 923 |
+
const baseIR = grossValue - inss;
|
| 924 |
+
let irrf = 0;
|
| 925 |
+
|
| 926 |
+
if (baseIR <= 2112.00) {
|
| 927 |
+
irrf = 0;
|
| 928 |
+
} else if (baseIR <= 2826.65) {
|
| 929 |
+
irrf = (baseIR * 0.075) - 158.40;
|
| 930 |
+
} else if (baseIR <= 3751.05) {
|
| 931 |
+
irrf = (baseIR * 0.15) - 370.40;
|
| 932 |
+
} else if (baseIR <= 4664.68) {
|
| 933 |
+
irrf = (baseIR * 0.225) - 651.73;
|
| 934 |
+
} else {
|
| 935 |
+
irrf = (baseIR * 0.275) - 884.96;
|
| 936 |
+
}
|
| 937 |
+
|
| 938 |
+
// Ensure IRRF is not negative
|
| 939 |
+
irrf = Math.max(irrf, 0);
|
| 940 |
+
|
| 941 |
+
// Net value
|
| 942 |
+
const netValue = grossValue - inss - irrf;
|
| 943 |
+
|
| 944 |
+
// Update UI
|
| 945 |
+
document.getElementById('labor-title').textContent = 'Cálculo de Rescisão';
|
| 946 |
+
document.getElementById('gross-value').textContent = formatCurrency(grossValue);
|
| 947 |
+
document.getElementById('discounts').textContent = formatCurrency(inss + irrf);
|
| 948 |
+
document.getElementById('net-value').textContent = formatCurrency(netValue);
|
| 949 |
+
|
| 950 |
+
// Show details
|
| 951 |
+
document.getElementById('ferias-details').classList.add('hidden');
|
| 952 |
+
document.getElementById('rescisao-details').classList.remove('hidden');
|
| 953 |
+
document.getElementById('aposentadoria-details').classList.add('hidden');
|
| 954 |
+
|
| 955 |
+
// Update details
|
| 956 |
+
document.getElementById('saldo-salario').textContent = formatCurrency(saldoSalario);
|
| 957 |
+
document.getElementById('ferias-proporcionais').textContent = formatCurrency(feriasProporcionais + oneThirdFerias);
|
| 958 |
+
document.getElementById('decimo-terceiro').textContent = formatCurrency(decimoTerceiro);
|
| 959 |
+
document.getElementById('aviso-previo-value').textContent = formatCurrency(avisoPrevioValue);
|
| 960 |
+
document.getElementById('fgts-multa').textContent = formatCurrency(fgtsMulta);
|
| 961 |
+
}
|
| 962 |
+
|
| 963 |
+
// Calculate aposentadoria
|
| 964 |
+
function calculateAposentadoria(salary) {
|
| 965 |
+
const age = parseInt(document.getElementById('age').value);
|
| 966 |
+
const contributionTime = parseInt(document.getElementById('contribution-time').value);
|
| 967 |
+
const gender = document.getElementById('gender').value;
|
| 968 |
+
const regime = document.getElementById('regime').value;
|
| 969 |
+
|
| 970 |
+
// Calculate remaining time based on current rules (2024)
|
| 971 |
+
let minAge, minContribution;
|
| 972 |
+
|
| 973 |
+
if (regime === 'INSS') {
|
| 974 |
+
// INSS rules (after 2019 reform)
|
| 975 |
+
if (gender === 'masculino') {
|
| 976 |
+
minAge = 65;
|
| 977 |
+
minContribution = 20;
|
| 978 |
+
} else {
|
| 979 |
+
minAge = 62;
|
| 980 |
+
minContribution = 15;
|
| 981 |
+
}
|
| 982 |
+
} else {
|
| 983 |
+
// RPPS rules (more favorable for public servants)
|
| 984 |
+
if (gender === 'masculino') {
|
| 985 |
+
minAge = 60;
|
| 986 |
+
minContribution = 25;
|
| 987 |
+
} else {
|
| 988 |
+
minAge = 55;
|
| 989 |
+
minContribution = 20;
|
| 990 |
+
}
|
| 991 |
+
}
|
| 992 |
+
|
| 993 |
+
const remainingAge = Math.max(0, minAge - age);
|
| 994 |
+
const remainingContribution = Math.max(0, minContribution - contributionTime);
|
| 995 |
+
const remainingTime = Math.max(remainingAge, remainingContribution);
|
| 996 |
+
|
| 997 |
+
// Calculate estimated pension (average of last salaries with limit)
|
| 998 |
+
const averageSalary = salary; // Simplified for this example
|
| 999 |
+
const pensionLimit = regime === 'INSS' ? 7786.02 : averageSalary * 0.8; // 80% for RPPS
|
| 1000 |
+
const estimatedPension = Math.min(averageSalary, pensionLimit);
|
| 1001 |
+
|
| 1002 |
+
// Update UI
|
| 1003 |
+
document.getElementById('labor-title').textContent = 'Cálculo de Aposentadoria';
|
| 1004 |
+
document.getElementById('gross-value').textContent = formatCurrency(estimatedPension);
|
| 1005 |
+
document.getElementById('discounts').textContent = formatCurrency(0); // No discounts in pension
|
| 1006 |
+
document.getElementById('net-value').textContent = formatCurrency(estimatedPension);
|
| 1007 |
+
|
| 1008 |
+
// Show details
|
| 1009 |
+
document.getElementById('ferias-details').classList.add('hidden');
|
| 1010 |
+
document.getElementById('rescisao-details').classList.add('hidden');
|
| 1011 |
+
document.getElementById('aposentadoria-details').classList.remove('hidden');
|
| 1012 |
+
|
| 1013 |
+
// Update details
|
| 1014 |
+
document.getElementById('remaining-time').textContent = `${remainingTime} anos`;
|
| 1015 |
+
document.getElementById('min-age').textContent = `${minAge} anos`;
|
| 1016 |
+
document.getElementById('min-contribution').textContent = `${minContribution} anos`;
|
| 1017 |
+
document.getElementById('estimated-pension').textContent = formatCurrency(estimatedPension);
|
| 1018 |
+
}
|
| 1019 |
+
|
| 1020 |
+
// Show loading state for labor calculator
|
| 1021 |
+
function showLaborLoading(isLoading) {
|
| 1022 |
+
if (isLoading) {
|
| 1023 |
+
laborText.textContent = 'Calculando...';
|
| 1024 |
+
laborLoader.classList.remove('hidden');
|
| 1025 |
+
calculateLaborBtn.disabled = true;
|
| 1026 |
+
} else {
|
| 1027 |
+
laborText.textContent = 'Calcular';
|
| 1028 |
+
laborLoader.classList.add('hidden');
|
| 1029 |
+
calculateLaborBtn.disabled = false;
|
| 1030 |
+
}
|
| 1031 |
+
}
|
| 1032 |
+
|
| 1033 |
+
// Event listeners
|
| 1034 |
+
convertBtn.addEventListener('click', performConversion);
|
| 1035 |
+
refreshRates.addEventListener('click', fetchExchangeRates);
|
| 1036 |
+
|
| 1037 |
+
// When currency inputs change, update conversion
|
| 1038 |
+
document.getElementById('currency-amount').addEventListener('input', performConversion);
|
| 1039 |
+
document.getElementById('from-currency').addEventListener('change', performConversion);
|
| 1040 |
+
document.getElementById('to-currency').addEventListener('change', performConversion);
|
| 1041 |
+
|
| 1042 |
+
// Keyboard support
|
| 1043 |
+
document.addEventListener('keydown', (e) => {
|
| 1044 |
+
if (standardCalc.classList.contains('hidden')) return;
|
| 1045 |
+
|
| 1046 |
+
if (e.key >= '0' && e.key <= '9') {
|
| 1047 |
+
appendNumber(e.key);
|
| 1048 |
+
} else if (e.key === '.') {
|
| 1049 |
+
appendDecimal();
|
| 1050 |
+
} else if (e.key === '+' || e.key === '-' || e.key === '*' || e.key === '/') {
|
| 1051 |
+
appendOperator(e.key);
|
| 1052 |
+
} else if (e.key === 'Enter' || e.key === '=') {
|
| 1053 |
+
calculate();
|
| 1054 |
+
} else if (e.key === 'Escape') {
|
| 1055 |
+
clearAll();
|
| 1056 |
+
} else if (e.key === 'Backspace') {
|
| 1057 |
+
if (currentInput.length === 1) {
|
| 1058 |
+
currentInput = '0';
|
| 1059 |
+
} else {
|
| 1060 |
+
currentInput = currentInput.slice(0, -1);
|
| 1061 |
+
}
|
| 1062 |
+
updateDisplay();
|
| 1063 |
+
} else if (e.key === '%') {
|
| 1064 |
+
percentage();
|
| 1065 |
+
}
|
| 1066 |
+
});
|
| 1067 |
+
</script>
|
| 1068 |
+
<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=vikingrancoroso/meus-estudos" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 1069 |
+
</html>
|
prompts.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
adicione também cálculos trabalhistas, como simulaçÃO de férias, demissão, aposentadoria de acordo com as regras brasileiras atualizadas
|
| 2 |
+
Adicione essa imagem https://drive.google.com/file/d/10aKazr1szDD8wQux_paD_asbPifq8dmL/view?usp=sharing no topo do site, ligo acima do texto TECHCALC PRO
|
| 3 |
+
Altere a imagem enviada anteriormente para essa https://raw.githubusercontent.com/DiegoShadow/meu-lab-devops/refs/heads/main/DevDog.png
|