Skip to content

Commit

Permalink
fixed styles for progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Crystal Yang authored and Crystal Yang committed May 13, 2022
1 parent 8222b70 commit 172823b
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 50 deletions.
1 change: 1 addition & 0 deletions build/dashboard-chefprogress-order.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ <h2>Progress Bar</h2>
</div>
</div>
</div>




Expand Down
38 changes: 0 additions & 38 deletions build/scripts/chefprogress-orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,41 +50,3 @@ reload();
setInterval(() => {
reload();
}, 10000);


const previousBtn = document.getElementById('previousBtn');
const nextBtn = document.getElementById('nextBtn');
// const finishBtn = document.getElementById('finishBtn');
const content = document.getElementById('content');
const bullets = [...document.querySelectorAll('.circle')];

const MAX_STEPS = 3;
let currentStep = 1;

nextBtn.addEventListener('click', () => {
bullets[currentStep - 1].classList.add('completed');
currentStep += 1;
previousBtn.disabled = false;
if (currentStep === MAX_STEPS) {
nextBtn.disabled = true;
// finishBtn.disabled = false;
}
content.innerText = `Step ${currentStep}`;
});


previousBtn.addEventListener('click', () => {
bullets[currentStep - 2].classList.remove('completed');
currentStep -= 1;
nextBtn.disabled = false;
// finishBtn.disabled = true;
if (currentStep === 1) {
previousBtn.disabled = true;
}
content.innerText = `Step ${currentStep}`;
});

// finishBtn.addEventListener('click', () => {
// location.reload();
// });
// when done with order, page will reload
39 changes: 38 additions & 1 deletion build/scripts/dashboard-chefprogress-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,41 @@ function loadStatus(status) {
appendChildren(orderStatus, [h2, p]);
}

loadOrder()
loadOrder()

const previousBtn = document.getElementById('previousBtn');
const nextBtn = document.getElementById('nextBtn');
// const finishBtn = document.getElementById('finishBtn');
const content = document.getElementById('content');
const bullets = [...document.querySelectorAll('.circle')];

const MAX_STEPS = 3;
let currentStep = 1;

nextBtn.addEventListener('click', () => {
bullets[currentStep - 1].classList.add('completed');
currentStep += 1;
previousBtn.disabled = false;
if (currentStep === MAX_STEPS) {
nextBtn.disabled = true;
// finishBtn.disabled = false;
}
content.innerText = `Step ${currentStep}`;
});


previousBtn.addEventListener('click', () => {
bullets[currentStep - 2].classList.remove('completed');
currentStep -= 1;
nextBtn.disabled = false;
// finishBtn.disabled = true;
if (currentStep === 1) {
previousBtn.disabled = true;
}
content.innerText = `Step ${currentStep}`;
});

// finishBtn.addEventListener('click', () => {
// location.reload();
// });
// when done with order, page will reload
23 changes: 12 additions & 11 deletions build/styles/dashboard-chefprogress-order.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ text-align: center;

.text {
margin-bottom: 10px;
color: #000000;
color: #e351a8;
}


.circle {
border: 1px solid #000000;
height: 20px;
width: 20px;
border: 1px solid #ff72c7;
width: 40px;
height:40px;
border-radius: 100%;
color: #000000;
color: #ff72c7;
display: inline-block;
position: relative;
transition: background-color 500ms;
line-height:20px;
line-height:40px;
}


Expand All @@ -74,13 +74,14 @@ color: #000000;



.bullet.completed::after {
content: '';
.circle.completed::after {
content:'';
position: absolute;
right: -60px;
bottom: 10px;
padding:0.5px;
right: -55px;
bottom: 15px;
height: 1px;
width: 54px;
width: 40px;
background-color: #ff72c7;
}

Expand Down

0 comments on commit 172823b

Please sign in to comment.