mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
Added arrows for navigating through steps
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
<div class="step-item" data-step="4">4. Step</div>
|
||||
</div>
|
||||
|
||||
<div id="middleContainerWrapper" class="middle-container-wrapper">
|
||||
<button id="prevBtn" class="navBtn" disabled>←</button>
|
||||
|
||||
<div class="mitte" id="mitte">
|
||||
<h1 id="h1">Video to document</h1>
|
||||
|
||||
@@ -78,6 +81,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button id ="nextBtn" class="navBtn">→</button>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="languages.js"></script>
|
||||
<script src="script.js"></script>
|
||||
<script src="./renderer.js"></script>
|
||||
|
||||
@@ -89,3 +89,18 @@ manualUploadBtn.addEventListener('click', () => {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
stepButtons.forEach(btn => {
|
||||
btn.addEventListener("click", () => {
|
||||
const step = btn.dataset.step;
|
||||
showStep(step);
|
||||
});
|
||||
});
|
||||
|
||||
prevBtn.addEventListener("click", () => {
|
||||
if (currentStep > 1) showStep(currentStep - 1);
|
||||
});
|
||||
|
||||
nextBtn.addEventListener("click", () => {
|
||||
if(currentStep < totalSteps) showStep(currentStep + 1);
|
||||
});
|
||||
+11
-10
@@ -216,23 +216,24 @@ function generateThumbnail(path){
|
||||
videoElement.autoplay = false;
|
||||
}
|
||||
|
||||
//Step-navigation
|
||||
|
||||
const steps = document.querySelectorAll(".step");
|
||||
const stepButtons = document.querySelectorAll(".step-item");
|
||||
let currentStep = 1;
|
||||
const totalSteps = steps.length;
|
||||
|
||||
function showStep(stepNumber) {
|
||||
// Steps ein/ausblenden
|
||||
steps.forEach(step => step.style.display = "none");
|
||||
document.getElementById("step" + stepNumber).style.display = "block";
|
||||
|
||||
// Navigation highlighten
|
||||
stepButtons.forEach(btn => btn.classList.remove("active"));
|
||||
document.querySelector(`.step-item[data-step="${stepNumber}"]`).classList.add("active");
|
||||
}
|
||||
const activeBtn = document.querySelector(`.step-item[data-step="${stepNumber}"]`);
|
||||
|
||||
// Klick-Events
|
||||
stepButtons.forEach(btn => {
|
||||
btn.addEventListener("click", () => {
|
||||
const step = btn.dataset.step;
|
||||
showStep(step);
|
||||
});
|
||||
});
|
||||
if(activeBtn) activeBtn.classList.add("active");
|
||||
|
||||
prevBtn.disabled = stepNumber == 1;
|
||||
nextBtn.disabled = stepNumber === totalSteps;
|
||||
currentStep = stepNumber;
|
||||
}
|
||||
@@ -233,3 +233,35 @@ h1 {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/*Navigation arrows*/
|
||||
.step-nav-arrows {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.middle-container-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 30px;
|
||||
width: max-content;
|
||||
}
|
||||
|
||||
.navBtn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 10px 25px;
|
||||
background-color: #007BFF;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.navBtn:disabled {
|
||||
background-color: #ccc;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
Reference in New Issue
Block a user