Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Elto Borges authored and Elto Borges committed Aug 21, 2024
1 parent e8c398f commit 42a0463
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 43 deletions.
5 changes: 3 additions & 2 deletions ask.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,13 @@ <h2>Qual é a sua experiência em academia?</h2>
</div>
<button class="ask-option-button">já pratico treinamento fisico na academia a mais de 1 ano</button>
<button class="ask-continue-button">Continuar</button>

</div>

<!-- Etapa 9 -->
<div class="ask-form-step">
<h2>Envie uma foto sua para o perfil</h2>
<input type="file" id="ask-profile-image" accept="image/*" placeholder="Envie uma foto de perfil">
<button onclick="updateUser()" class="updatebutton">Salvar</button>
<button onclick="updateUser()" class="ask-continue-button">Salvar</button>
</div>

<div class="ask-back-step">
Expand Down
66 changes: 25 additions & 41 deletions src/javascript/askscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,8 @@ document.addEventListener("DOMContentLoaded", () => {
}, 500);
}

const nextButton = document.querySelectorAll(".ask-continue-button");

nextButton.forEach((button) => {
button.addEventListener("click", () => {
nextStep();
// Remove the extra closing curly braces
});

function nextStep() {
const currentStepElement = steps[currentStep];
console.log("currentStepElement", currentStepElement);

switch (currentStep) {
case 0:
Expand Down Expand Up @@ -127,7 +118,7 @@ document.addEventListener("DOMContentLoaded", () => {
};
reader.readAsDataURL(file);
} else {
user.profileImage = responses.profileImage || "";
user.profileImage = user.profileImage || "";
}
break;
default:
Expand Down Expand Up @@ -166,6 +157,7 @@ document.addEventListener("DOMContentLoaded", () => {
continueButtons.forEach((button) => {
button.addEventListener("click", () => {
if (currentStep < steps.length - 1) {
nextStep();
showStep(currentStep + 1, true);
} else {
updateUser(); // Chama updateUser ao final do formulário
Expand All @@ -188,35 +180,27 @@ document.addEventListener("DOMContentLoaded", () => {
});
});

const optionButtons = document.querySelectorAll(".ask-option-button");
optionButtons.forEach((button) => {
button.addEventListener("click", () => {
optionButtons.forEach((btn) => btn.classList.remove("selected"));
button.classList.add("selected");
});
});
});

function proxpage() {
window.location.href =
"https://ifpi-picos.github.io/projeto-integrador-ugym/perf.html";
}

function showInput() {
const input = document.getElementById("disease-input");
input.style.display = "block";
}

function hideInput() {
const input = document.getElementById("disease-input");
input.style.display = "none";
}

function handleOptionChange(option, inputId) {
const inputElement = document.getElementById(inputId);
if (option === "Sim") {
inputElement.style.display = "block";
} else {
inputElement.style.display = "none";
function proxpage() {
window.location.href =
"https://ifpi-picos.github.io/projeto-integrador-ugym/perf.html";
}

function showInput() {
const input = document.getElementById("disease-input");
input.style.display = "block";
}

function hideInput() {
const input = document.getElementById("disease-input");
input.style.display = "none";
}

function handleOptionChange(option, inputId) {
const inputElement = document.getElementById(inputId);
if (option === "Sim") {
inputElement.style.display = "block";
} else {
inputElement.style.display = "none";
}
}
}

0 comments on commit 42a0463

Please sign in to comment.