Skip to content

Лаб. 1 6411 Клюшин Иван#109

Open
loke112 wants to merge 2 commits intoitsecd:mainfrom
loke112:main
Open

Лаб. 1 6411 Клюшин Иван#109
loke112 wants to merge 2 commits intoitsecd:mainfrom
loke112:main

Conversation

@loke112
Copy link

@loke112 loke112 commented Feb 28, 2026

No description provided.

@AvtoBBus AvtoBBus self-requested a review February 28, 2026 11:06
Copy link
Collaborator

@AvtoBBus AvtoBBus left a comment

Choose a reason for hiding this comment

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

Советую поставить что-то типо Prettier, если конечно пишете в VsCode

Comment on lines +1 to +5
const elA = document.getElementById('a');
const elB = document.getElementById('b');
const elOp = document.getElementById('op');
const elBtn = document.getElementById('calc');
const elOut = document.getElementById('out');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Какой-то из элементов может быть не найден

Comment on lines +7 to +19
function normalizeNumberText(s) {
return String(s).trim().replace(',', '.');
}

function isValidNumberText(s) {
const t = normalizeNumberText(s);
if (t.length === 0) return false;
return /^[-+]?(?:\d+(?:\.\d+)?|\.\d+)$/.test(t);
}

function parseNumber(s) {
return Number(normalizeNumberText(s));
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Вот это всё сжимается в один parseFloat, если у input-ов поставите type='number'

Comment on lines +38 to +39
const s = String(x);
if (s.includes('e')) return x.toPrecision(12).replace(/\.?0+$/,'');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Думаю это слишком, хватит простого toFixed

Comment on lines +93 to +108
@media (max-width: 520px) {
.row{
flex-direction: column;
align-items: stretch;
gap: 14px;
}

.select{
width: 92px;
align-self: center;
}

.btn{
width: 220px;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Где-то на 600 пикселей начинает уже возникать проблемка с адаптивностью, в целом задание опциональное, так что выполнять или нет на ваше усмотрение

Image Image

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.

2 participants