Alice/pages/index.html

51 lines
1.4 KiB
HTML

---
layout: default
title: Inicio
displaymenu: true
permalink: /
---
{% include pages/home.html %}
{% include pages/trens.html %}
{% include pages/peoples.html %}
{% include pages/publications.html %}
<script>
$(document).ready(function() {
var sectionIds = ['#home', '#trens']; // Lista de IDs das seções
var sectionIndex = 0;
var scrolling = false; // Controla o estado de rolagem
function scrollToSection(index) {
$('html, body').stop().animate({
scrollTop: $(sectionIds[index]).offset().top
}, 800); // 800ms é o tempo de animação
}
$(window).on('wheel', function(e) {
if (scrolling) return; // Impede múltiplos acionamentos enquanto rola
scrolling = true;
var delta = e.originalEvent.deltaY;
if (delta > 0) { // Scroll down
sectionIndex = Math.min(sectionIds.length - 1, sectionIndex + 1);
} else if (delta < 0) { // Scroll up
sectionIndex = Math.max(0, sectionIndex - 1);
}
scrollToSection(sectionIndex);
// Permite rolar novamente após 800ms (ajuste conforme necessário)
setTimeout(function() {
scrolling = false;
}, 800);
});
// Inicializa a rolagem para a primeira seção
scrollToSection(sectionIndex);
});
</script>