Files
Rotafilio_Vantive/contenido/14.html
T
2026-07-01 02:25:52 -06:00

217 lines
7.1 KiB
HTML

<style>
.fake {
background-image: url(img/bg07.jpg);
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}
.hr-style {
opacity: 1;
}
.custom-grid {
position: relative;
display: grid;
grid-template-columns: repeat(6, 1fr);
grid-template-rows: repeat(2, 1fr);
gap: 15px;
justify-content: center;
align-items: center;
max-width: 1320px; /* Esto limita el ancho total */
margin: 0 auto;
width: 100%;
}
.img-sotable {
cursor: move;
}
.img-sotable.disabled {
pointer-events: none;
background-color: #84a816;
}
.sortable-placeholder {
background-color: rgba(132, 168, 22, 0.3);
border: 2px dashed #84a816;
visibility: visible !important;
}
</style>
<div class="page-sco py-2 py-md-0 h-100">
<div class="container h-100">
<div class="row justify-content-center align-items-center h-100">
<div class="col-12">
<div class="row justify-content-center" id="activity1">
<div class="col-10 mb-2 text-center">
<div class="position-relative d-inline-block">
<h2 class="text-center fw-bold text-primary">
Técnica correcta para higiene de manos <br />
de acuerdo con la técnica de la OMS<sup class="fw-bold">12</sup>
</h2>
<hr class="border border-3 border-verde-oscuro hr-style mx-auto my-0" />
</div>
</div>
<div class="col-10 px-0 mb-1 col-instrucciones">
<div class="card bg-lila-rosa border-0 my-2 rounded-4 bg-custom px-3 py-2 text-center">
<div class="d-flex justify-content-center align-items-center flex-row">
<img src="img/14.12.png" class="img-fluid mx-3" />
<p class="mb-0 text-start">Arrastra los pasos del lavado de manos para colocarlos en el orden correcto.</p>
</div>
</div>
</div>
<div class="col-12 col-actividad" style="overflow: hidden">
<div class="custom-grid">
<div class="img-sotable" data-order="0">
<img src="img/14.0.png" class="img-fluid" />
</div>
<div class="img-sotable" data-order="1">
<img src="img/14.1.png" class="img-fluid" />
</div>
<div class="img-sotable" data-order="2">
<img src="img/14.2.png" class="img-fluid" />
</div>
<div class="img-sotable" data-order="3">
<img src="img/14.3.png" class="img-fluid" />
</div>
<div class="img-sotable" data-order="4">
<img src="img/14.4.png" class="img-fluid" />
</div>
<div class="img-sotable" data-order="5">
<img src="img/14.5.png" class="img-fluid" />
</div>
<div class="img-sotable" data-order="6">
<img src="img/14.6.png" class="img-fluid" />
</div>
<div class="img-sotable" data-order="7">
<img src="img/14.7.png" class="img-fluid" />
</div>
<div class="img-sotable" data-order="8">
<img src="img/14.8.png" class="img-fluid" />
</div>
<div class="img-sotable" data-order="9">
<img src="img/14.9.png" class="img-fluid" />
</div>
<div class="img-sotable" data-order="10">
<img src="img/14.10.png" class="img-fluid" />
</div>
<div class="img-sotable" data-order="11">
<img src="img/14.11.png" class="img-fluid" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="d-none">
<div id="pop0">
<div class="container-fluid">
<div class="w-100 text-center">
<img src="img/14.13.png" class="img-fluid" />
</div>
<div class="row justify-content-center">
<!-- <div class="col-12 text-center mb-2">
<h3 class="text-secondary-dark fw-bold">¡Bien hecho!</h3>
</div> -->
<div class="col-12 text-center">
<p>Una vez secas, <strong class="text-verde-ceniza">tus manos son seguras.</strong></p>
<p class="mb-0">
El procedimiento tiene una duración total de
<strong class="text-verde-ceniza">40-60 segundos.</strong>
</p>
</div>
</div>
</div>
</div>
</div>
<script>
$(function () {
'use strict';
$('.wrap-course-content').addClass('fake');
const bad = CourseNav.createSound('audio/feedback-incorrect.mpeg');
const good = CourseNav.createSound('audio/feedback-correct.mpeg');
function shuffleArray(array) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
return array;
}
// Shuffle elements
const $sortables = $('.img-sotable');
const shuffled = shuffleArray($sortables.toArray());
$('.custom-grid').empty().append(shuffled);
// Initialize sortable
$('.custom-grid').sortable({
items: '.img-sotable',
containment: '.wrap-course-content',
cursor: 'grabbing',
tolerance: 'pointer',
forceHelperSize: true,
forcePlaceholderSize: true,
placeholder: 'sortable-placeholder',
distance: 5,
sort: function (event, ui) {
var scale = parseFloat($('.wrap-course-content').css('transform').split('(')[1]) || 1;
var mouseX = event.pageX;
var mouseY = event.pageY;
ui.helper.css({
left: (mouseX - ui.helper.parent().offset().left) / scale - ui.helper.width() / 2,
top: (mouseY - ui.helper.parent().offset().top) / scale - ui.helper.height() / 2,
});
},
update: function () {
checkOrder();
},
});
function checkOrder() {
const $items = $('.custom-grid .img-sotable');
let isCorrect = true;
$items.each(function (index) {
if (parseInt($(this).data('order')) !== index) {
isCorrect = false;
return false;
}
});
if (isCorrect) {
good.play();
$('.custom-grid').sortable('disable');
checkAllCompleted();
}
}
function checkAllCompleted() {
setTimeout(() => {
const html = $('#pop0').html();
Swal.fire({
html: html,
target: document.getElementById('wrap-course-content'),
customClass: {
popup: 'pop_html_style border border-3 border-primary rounded-4',
confirmButton: 'btn text-white bg-primary amor fw-semibold animate__animated animate__pulse animate__infinite',
},
confirmButtonText: 'Cerrar',
showConfirmButton: true,
allowOutsideClick: false,
allowEscapeKey: false,
backdrop: 'rgba(65, 60, 60, .95)',
width: '35em',
didClose: () => {
CourseNav.setSlideVisited();
$('.img-sotable').addClass('disabled');
},
});
}, 250);
}
});
</script>