CSS/JS question for Pomodoro project

CSS/JS question for Pomodoro project
0

#1

So I managed to add a progress bar to the timer (it will run in the last 60 seconds of the timer), but I can’t figure out how to center the actual timer (ie, the text that says 0:59, 0:58 etc). Right now it is aligned to the left to start with and gradually moves to the center along with the progress bar. You will see that it will start moving when the timer has about 40 seconds left to go. Any ideas how to fix this?

Thanks in advance!


#2

Try using flexbox. Add display: flex and justify-content: center on the parent element of timer-numbers.


#3

hey thanks for the suggestion. it doesnt center it perfectly though. I`ve added the flexbox codes to the codepen - you can check it out if you have time!


#4

Try adding some width to timer-progress.


#5

mm nope didnt do the trick :frowning:


#6

Line 75 in javascript resets the width to 0.


#7

right, i forgot about that. but you see, i need the width to start at 0 because it should only appear once the timer starts counting down the last 60 seconds.


#8

Set text color opacity as transparent?