-
Notifications
You must be signed in to change notification settings - Fork 1
Помощь друга #10
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
base: master
Are you sure you want to change the base?
Помощь друга #10
Conversation
|
♻️ Я собрал ваш пулреквест. Посмотреть можно здесь. |
|
♻️ Я собрал ваш пулреквест. Посмотреть можно здесь. |
| const SCALE_STEP = 25; // шаг в 25 | ||
| const SCALE_MIN = 25; // минимальный процент | ||
| const SCALE_MAX = 100; // максимальный процент | ||
| let currentScale = 100; // изначальное значение |
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.
100 нужно взять из константы
|
|
||
| const updateScale = (newScale) => { // функция изменения размера картинки | ||
| currentScale = Math.min(Math.max(newScale, SCALE_MIN), SCALE_MAX); // получаем цифру в инете нашла не понимаю до конца | ||
| console.log(currentScale); |
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.
Это убираем
| console.log(currentScale); | ||
|
|
||
| scaleValueInput.value = `${currentScale}%`; // записываем новое значение в инпут | ||
| previewImage.style.transform = `scale(${currentScale / 100})`; // перезаписываем размер картинки |
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.
100 тоже константа
| // по умолчанию значение 100 | ||
| updateScale(currentScale); | ||
|
|
||
| const effects = { // эффекты |
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.
Переносим в начало файла
Объекту нужно подобрать другое имя, чтобы не путать с массивом
В нем много константных значений, можно попробовать оставить как есть или сделать его как перечисление (посмотри в критериях пример)
| 'none': {} // Оригинал | ||
| }; | ||
|
|
||
| let currentEffect = 'none'; // выбранный эффект |
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.
Название эффекта в константу
| let currentEffect = 'none'; // выбранный эффект | ||
|
|
||
| function updateEffectSlider(effect) { | ||
| if (effect === 'none') { // если выбран эффект 'none' |
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.
Здесь брать из константы
🎓 Помощь друга
💥 https://htmlacademy-javascript.github.io/2114175-kekstagram-2/10/