-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #1030
base: master
Are you sure you want to change the base?
Develop #1030
Conversation
IrynaMariiko00
commented
Nov 11, 2024
- DEMO LINK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GJ 👍 Let's improve it a bit)
src/scripts/main.js
Outdated
}); | ||
|
||
if (game.status === WIN || game.status === LOSE) { | ||
hideMessage(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/modules/Game.class.js
Outdated
// Затримка для видалення класу 'merged' після завершення анімації | ||
setTimeout(() => { | ||
toCell.classList.remove('merged'); | ||
}, 300); // Час анімації (300ms) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change some property in merged
class you should add transition for this property in scss file
Now it doesn't work (but not required in the task - so it's only a suggestion)
src/modules/Game.class.js
Outdated
cell.textContent = ''; | ||
} else { | ||
cell.classList.add(`field-cell--${value}`); | ||
cell.textContent = value; // оновлюємо текст |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's clear without comment 🙂 And it's related to 90% of comments - no need to comment smth if it's clear from the code. If there is complicated logic, unusual behavior, etc. we need to add comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, sorry, I wrote it for myself and forgot to delete it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/scripts/main.js
Outdated
} | ||
} | ||
|
||
// Функція для відображення рекорду |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all comments
// Функція для відображення рекорду |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/styles/main.scss
Outdated
.message-lose { | ||
width: 100%; | ||
box-sizing: border-box; | ||
height: 60px !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use important, it's a bad practice
height: 60px !important; | |
height: 60px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job in general!
I have improved my code again. Could you look at it, please? |