Skip to content

Commit

Permalink
v1.10.11 - Ajustes de Layout Shift: Help modal refeito, ajuste no footer
Browse files Browse the repository at this point in the history
 e page loader.
  • Loading branch information
rcarlos-ig committed May 12, 2022
1 parent 7590941 commit b72ee24
Show file tree
Hide file tree
Showing 8 changed files with 143 additions and 189 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "igai",
"version": "1.10.10",
"version": "1.10.11",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down
2 changes: 1 addition & 1 deletion public/css/styles.min.css

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ function zebraPattern() {
});
}

// Toggle the Page Load animation
$(window).on("load", function () {
$(".loader-trigger").hide();
});

// jQuery functions on Page Load
$(function () {
// Hide and show "inactive" schools on the Dashboard page
Expand Down Expand Up @@ -86,11 +91,4 @@ $(function () {
replaceAllStrings("cercaTela", "Cerca/Tela");
replaceAllStrings("iluminacao", "iluminação");
replaceAllStrings("calcada", "calçada");

// Toggle the Page Load animation
$(window).on("unload", function () {
$(".loader-trigger").toggle(true);
});

$(".loader-trigger").toggle(false);
});
117 changes: 17 additions & 100 deletions tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ img {
/* background-color: #d1d5db */
}

.img404 {
.img-filter {
filter: var(--bg-gray-50-shadow-filter);
}

Expand Down Expand Up @@ -731,120 +731,37 @@ img {

/* Modal de ajuda */
/* modal open|close controller */
#help-modal-controller {
@apply absolute left-[-999em] opacity-0;
}

.help-modal-open:checked ~ .help-modal-wrap {
@apply block;
.help-modal {
@apply w-11/12 bg-gray-100 p-0 rounded-md md:w-3/4 xl:w-1/2;
box-shadow: var(--bg-gray-50-shadow-box);
}

.help-modal-open:checked ~ .help-modal-wrap:before,
.help-modal-overlay {
@apply block;
.help-modal::backdrop {
@apply bg-gray-600/90 backdrop-blur-sm;
}

.help-modal-close {
@apply absolute top-0 right-0 text-[2rem] font-bold px-3 cursor-pointer z-[100];
}

/* modal */
.help-modal-wrap {
@apply hidden;
}

.help-modal-wrap:before {
@apply hidden fixed top-0 left-0 right-0 bottom-0 z-[101];
content: "";
background: rgba(0, 0, 0, 0.7);
}

.help-modal-overlay {
@apply hidden fixed top-0 left-0 right-0 bottom-0 z-[102];
}

.help-modal-body {
@apply absolute top-1/2 left-1/2 w-3/4 bg-gray-50 py-4 rounded-md overflow-hidden z-[103] -translate-x-1/2 -translate-y-1/2 md:w-1/2;
}

.help-modal-body h2 {
@apply mt-14 mb-2;
}

.help-modal-content {
@apply relative py-8 px-2 overflow-hidden;
}

.help-modal-slide {
@apply absolute w-full transition-all duration-300 ease-in;
}

.modal-content-2 {
@apply left-full;
}

.modal-content-3 {
@apply left-[200%];
}

#modal-content-1:checked ~ .content-1 {
@apply relative left-0 overflow-auto;
}

#modal-content-1:checked ~ .content-2 {
@apply left-full;
}

#modal-content-1:checked ~ .content-3 {
@apply left-[200%];
}

#modal-content-2:checked ~ .content-1 {
@apply -left-full;
}

#modal-content-2:checked ~ .content-2 {
@apply relative left-0 overflow-auto;
}

#modal-content-2:checked ~ .content-3 {
@apply left-full;
}

#modal-content-3:checked ~ .content-1 {
@apply -left-[200%];
}

#modal-content-3:checked ~ .content-2 {
@apply -left-full;
}

#modal-content-3:checked ~ .content-3 {
@apply relative left-0 overflow-auto;
@apply text-[2rem] leading-none px-2 cursor-pointer md:text-5xl md:px-4;
}

.help-modal-nav {
@apply absolute top-8 w-full;
@apply flex justify-between my-2 px-4 md:px-8;
}

.help-modal-nav label {
@apply flex justify-center content-center absolute w-12 h-12 bg-gray-200 text-5xl rounded-md cursor-pointer;
[class*="-slide"] {
@apply bg-accent text-light text-[2rem] leading-none pb-1 px-3 rounded-md cursor-pointer md:text-5xl md:pb-2 md:px-5;
}

.help-modal-nav label.prev-slide {
@apply left-4;
content: "";
.help-modal-nav > .disabled {
@apply bg-gray-300 text-gray-400 cursor-not-allowed;
}

.help-modal-nav label.next-slide {
@apply right-4;
content: "";
.help-modal-content {
@apply w-full pb-8 px-4 md:pb-12 md:px-8;
}

@media only screen and (max-width: 767px) {
.help-modal-body {
@apply w-11/12;
}
.help-modal-buttons {
@apply flex justify-end items-center gap-4 mt-8 pb-4;
}

/* Dark Mode */
Expand Down Expand Up @@ -998,7 +915,7 @@ html.dark .senha-olho-riscado:hover {
}

/* Images */
html.dark .img404 {
html.dark .img-filter {
filter: unset;
}

Expand Down
2 changes: 1 addition & 1 deletion views/404.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h2>Uh oh!</h2>
<div class="px-4">
<h3>Erro 404 - Página não encontrada</h3>
<img class="py-8 img404" src="/img/404.svg" alt="Página não encontrada." aria-label="Página não encontrada.">
<img class="py-8 img-filter" src="/img/404.svg" alt="Página não encontrada." aria-label="Página não encontrada.">
<p class="text-lg py-4">Sentimos muito, mas não conseguimos encontar a página <span class="font-medium text-xl text-primary"><%= url %></span> em nosso sistema.</p>
<div class="flex justify-center pb-3 mt-6">
<button class="button button-primary" onclick="window.location='\dashboard'">Início</button>
Expand Down
176 changes: 110 additions & 66 deletions views/partials/ajuda.ejs
Original file line number Diff line number Diff line change
@@ -1,73 +1,117 @@
<div class="help-modal">
<input type="checkbox" id="help-modal-controller" class="help-modal-open" hidden>
<div class="help-modal-wrap">
<label for="help-modal-controller" class="help-modal-overlay"></label>
<div class="help-modal-body">

<label for="help-modal-controller" class="help-modal-close" id="help-modal-close">&times;</label>

<input type="radio" name="content-nav" id="modal-content-1" class="modal-radio" checked hidden/>
<input type="radio" name="content-nav" id="modal-content-2" class="modal-radio" hidden/>
<input type="radio" name="content-nav" id="modal-content-3" class="modal-radio" hidden/>

<div class="help-modal-slide content-1">
<div class="help-modal-content">
<h2 class="text-primary">O que é o IGAIE</h2>
<img class="mb-2 img404 md:w-3/4 md:mx-auto md:my-4" src="/img/help-1.svg" alt="Imagem ilustrativa de um gráfico.">
<p class="text-lg p-4">
É um indicador para <span class="font-semibold text-primary">avaliação de cada um dos componentes</span> das instalações escolares.
</p>

<div class="help-modal-nav">
<label for="modal-content-2" class="next-slide">&#8250;</label>
</div>
</div>
</div>

<div class="help-modal-slide content-2">
<div class="help-modal-content">
<h2 class="text-primary">Qual é o seu objetivo?</h2>
<img class="mb-2 img404 md:w-3/4 md:mx-auto md:my-4" src="/img/help-2.svg" alt="Imagem ilustrativa de uma equipe trabalhando.">
<p class="text-lg p-4">
Apresentar visão global do <span class="font-semibold text-primary">desempenho dos serviços de manutenção e intervenções</span> executadas nas unidades de ensino municipais de Angra dos Reis, abordando os procedimentos adotados para a execução destes serviços, objetivando a integração e a motivação entre os atores envolvidos no processo.
</p>

<div class="help-modal-nav">
<label for="modal-content-1" class="prev-slide">&#8249;</label>
<label for="modal-content-3" class="next-slide">&#8250;</label>
</div>
</div>
</div>
<dialog class="help-modal" id="helpModal">
<div class="flex justify-end">
<span class="help-modal-close" id="helpModalClose">&times;</span>
</div>
<div class="help-modal-nav">
<span class="prev-slide disabled" id="prevSlide">&#8249;</span>
<span class="next-slide" id="nextSlide">&#8250;</span>
</div>
<div class="help-modal-content" id="helpModalContent1">
<h2 class="text-primary">O que é o IGAIE</h2>
<img
class="mb-6 img-filter mx-auto w-[320px] md:w-4/5 md:mb-8"
src="/img/help-1.svg"
alt="Imagem ilustrativa de um gráfico."
/>
<p class="text-lg md:text-2xl">
É um indicador para
<span class="font-semibold text-primary"
>avaliação de cada um dos componentes</span
>
das instalações escolares.
</p>
</div>
<div class="help-modal-content hidden" id="helpModalContent2">
<h2 class="text-primary">Qual é o seu objetivo?</h2>
<img
class="mb-6 img-filter mx-auto w-[320px] md:w-4/5 md:mb-8"
src="/img/help-2.svg"
alt="Imagem ilustrativa de uma equipe trabalhando."
/>
<p class="text-lg md:text-2xl">
Apresentar visão global do
<span class="font-semibold text-primary"
>desempenho dos serviços de manutenção e intervenções</span
>
executadas nas unidades de ensino municipais de Angra dos Reis, abordando
os procedimentos adotados para a execução destes serviços, objetivando a
integração e a motivação entre os atores envolvidos no processo.
</p>
</div>
<div class="help-modal-content hidden" id="helpModalContent3">
<h2 class="text-primary">E sua metodologia?</h2>
<img
class="mb-6 img-filter mx-auto w-[320px] md:w-4/5 md:mb-8"
src="/img/help-3.svg"
alt="Imagem ilustrativa de um gráfico."
/>
<p class="text-lg md:text-2xl">
O IGAIE é calculado utilizando os
<span class="font-semibold text-primary"
>conceitos de péssimo a ótimo (1 a 5)</span
>
com a utilização de pesos, onde o maior peso é atribuído à pior nota,
obtendo-se uma média de todos os componentes;
<span class="font-semibold text-primary"
>quanto maior o IGAIE, pior a estimativa física</span
>
da unidade de ensino.
</p>
</div>
</dialog>

<div class="help-modal-slide content-3">
<div class="help-modal-content">
<h2 class="text-primary">E sua metodologia?</h2>
<img class="mb-2 img404 md:w-3/4 md:mx-auto md:my-4" src="/img/help-3.svg" alt="Imagem ilustrativa de um gráfico.">
<p class="text-lg p-4">
O IGAIE é calculado utilizando os <span class="font-semibold text-primary">conceitos de péssimo a ótimo (1 a 5)</span> com a utilização de pesos, onde o maior peso é atribuído à pior nota, obtendo-se uma média de todos os componentes; <span class="font-semibold text-primary">quanto maior o IGAIE, pior a estimativa física</span> da unidade de ensino.
</p>
<script>
const helpModalController = document.getElementById("helpModalController");
const helpModalClose = document.getElementById("helpModalClose");
const helpModal = document.getElementById("helpModal");
const content1 = document.getElementById("helpModalContent1");
const content2 = document.getElementById("helpModalContent2");
const content3 = document.getElementById("helpModalContent3");
const prevSlideButton = document.getElementById("prevSlide");
const nextSlideButton = document.getElementById("nextSlide");
<div class="help-modal-nav">
<label for="modal-content-2" class="prev-slide">&#8249;</label>
</div>
</div>
</div>
helpModalController.addEventListener("click", () => {
helpModal.showModal();
});
helpModalClose.addEventListener("click", () => {
helpModal.close();
});
</div>
</div>
let activeSlide = 1;
<script>
const helpModalController = document.getElementById("help-modal-controller-label");
const helpModalCloseButton = document.getElementById("help-modal-close");
const modalContent1Radio = document.getElementById("modal-content-1");
nextSlideButton.addEventListener("click", () => {
switch (activeSlide) {
case 1:
content1.style.display = "none";
content2.style.display = "block";
prevSlideButton.classList.remove("disabled");
activeSlide = 2;
break;
helpModalController.addEventListener("click", () => {
window.scrollTo(0, 0);
});
case 2:
content2.style.display = "none";
content3.style.display = "block";
nextSlideButton.classList.add("disabled");
activeSlide = 3;
break;
}
});
helpModalCloseButton.addEventListener("click", () => {
modalContent1Radio.checked = true;
});
</script>
prevSlideButton.addEventListener("click", () => {
switch (activeSlide) {
case 2:
content2.style.display = "none";
content1.style.display = "block";
prevSlideButton.classList.add("disabled");
activeSlide = 1;
break;
</div>
case 3:
content3.style.display = "none";
content2.style.display = "block";
nextSlideButton.classList.remove("disabled");
activeSlide = 2;
break;
}
});
</script>
Loading

0 comments on commit b72ee24

Please sign in to comment.