[Update] Main Page: Message Input Box Ratio. Save the ratio when window is resized.

This commit is contained in:
Sakamoto Shiina
2024-09-25 13:37:21 +09:00
parent b3d7d3f87e
commit 69d835855c
4 changed files with 33 additions and 5 deletions

View File

@@ -0,0 +1,8 @@
export const clampMinMax = (value, min, max) => {
return Math.min(Math.max(value, min), max);
};
// console.log(clamp(5, 1, 10)); // 5 (範囲内)
// console.log(clamp(-3, 0, 10)); // 0 (minより小さい)
// console.log(clamp(15, 1, 10)); // 10 (maxより大きい)
// console.log(clamp(7.5, 1, 10)); // 7.5 (範囲内、少数)