separado de python y max 12 caracteres rut admin + easter egg

This commit is contained in:
2026-03-22 20:34:43 -03:00
parent 030159cb66
commit cdb17a77bf
10 changed files with 987 additions and 962 deletions

View File

@@ -27,7 +27,7 @@
<div class="row g-3">
<div class="col-md-2">
<label class="form-label">RUT</label>
<input type="text" class="form-control" name="rut" id="rutInput" placeholder="12.345.678-9" value="{{ form.get('rut', '') }}" required>
<input type="text" class="form-control" name="rut" id="rutInput" placeholder="12.345.678-9" value="{{ form.get('rut', '') }}" maxlength="12" required>
</div>
<div class="col-md-3">
<label class="form-label">Nombre Completo</label>
@@ -179,6 +179,12 @@
document.getElementById('rutInput').addEventListener('input', function(e) {
let value = this.value.replace(/[^0-9kK]/g, '').toUpperCase();
// Bloquear el largo interno a 9 caracteres (8 cuerpo + 1 dv)
if (value.length > 9) {
value = value.slice(0, 9);
}
if (value.length > 1) {
let body = value.slice(0, -1);
let dv = value.slice(-1);

View File

@@ -3,7 +3,7 @@
<a class="navbar-brand d-flex flex-column align-items-start text-primary-emphasis" href="{{ url_for('index') }}" style="gap: 0;">
<div class="d-flex align-items-center">
<i class="bi bi-receipt-cutoff fs-3 text-info me-2"></i>
<i id="brandIcon" class="bi bi-receipt-cutoff fs-3 text-info me-2"></i>
<span class="fw-bold fs-4">KSNE</span>
</div>
@@ -70,4 +70,54 @@
{% endif %}
</div>
</div>
</nav>
</nav>
<style>
@keyframes baguetteRoll {
0% { transform: rotate(0deg) scale(1.2); }
50% { transform: rotate(180deg) scale(1.5); }
100% { transform: rotate(360deg) scale(1); }
}
.baguette-spin {
display: inline-block;
animation: baguetteRoll 1s ease-in-out;
font-style: normal;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function() {
const brandIcon = document.getElementById("brandIcon");
if (brandIcon) {
let clickCount = 0;
let clickResetTimer;
brandIcon.addEventListener("click", function(e) {
e.preventDefault();
e.stopPropagation();
clickCount++;
clearTimeout(clickResetTimer);
clickResetTimer = setTimeout(() => {
clickCount = 0;
}, 800);
if (clickCount >= 5) {
clickCount = 0;
clearTimeout(clickResetTimer);
const originalClass = this.className;
this.className = "fs-3 me-2 baguette-spin";
this.innerHTML = "&#129366;";
setTimeout(() => {
this.className = originalClass;
this.innerHTML = "";
}, 1000);
}
});
}
});
</script>