Closed Tessabaxter12 closed 9 months ago
So you've got a lot of margin on your #gameboard
which is pushing your board over, rather than centering it. How about we implement flexbox. I see that in your body you're using the attributes justify-content: center
and align-items: center
however we've not yet told our body we want it to be displayed as a flexbox.
I'm also seeing new CountdownTimer
- could you provide the documentation for that constructor, as I am unfamiliar with it. Perhaps it would be better if you implemented something like setInterval()
(see this documentation for use case examples).
As for images, you might try caching your "card" elements and then updating their style.backgroundImage
properties like in this documentation.
Finally for card shuffling, you'll likely want to utilize an array.
I got the game board centered corrected thanks. I have an array for shuffling but have some new issues. I will reopen if I can figure them out today.
What's the problem you're trying to solve?
Board centering, clock count down, card images, and card shuffling
Post any code you think might be relevant (one fenced block per file) For clock count downlet countdownTime = new Time().setMinutes(new Time().getMinutes () + 5)
let timeInterval const minutesElem = document.querySelector('#minutes'), secondsElem = document.querySelector('seconds'), timerRunningContent = document.querySelector('#timer-running'), timerEndContent = document.querySelector('#timer-end')
const startCountdown = () => { const now = new Time().getTime() const countdown = new Time(countdownTime).getTime() const difference = (countdown - now) / 1000 let minutes = math.floor((difference % 60)) let seconds = Math.floor(difference %) console.log(minutes) }
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
nothing happening. I have made changes now and I'm confused on which way to go
What is your best guess as to the source of the problem?
I tired and then when it didn't work I over complicated it
What things have you already tried to solve the problem?
watched 3 videos on creating a count down clock
Paste a link to your repository here
https://github.com/Tessabaxter12/Memory_Game