Skip to content

Conversation

@Rodika94
Copy link
Contributor

@Rodika94 Rodika94 commented May 19, 2025

@keksobot keksobot changed the title Module9 task2 Помощь друга May 19, 2025
@keksobot
Copy link
Contributor

♻️ Я собрал ваш пулреквест. Посмотреть можно здесь.

keksobot pushed a commit that referenced this pull request May 19, 2025
@keksobot
Copy link
Contributor

♻️ Я собрал ваш пулреквест. Посмотреть можно здесь.

keksobot pushed a commit that referenced this pull request May 25, 2025
const SCALE_STEP = 25; // шаг в 25
const SCALE_MIN = 25; // минимальный процент
const SCALE_MAX = 100; // максимальный процент
let currentScale = 100; // изначальное значение

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);

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})`; // перезаписываем размер картинки

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 = { // эффекты

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переносим в начало файла
Объекту нужно подобрать другое имя, чтобы не путать с массивом
В нем много константных значений, можно попробовать оставить как есть или сделать его как перечисление (посмотри в критериях пример)

'none': {} // Оригинал
};

let currentEffect = 'none'; // выбранный эффект

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'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь брать из константы

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants