Add a settings page for profit display and default stack

- Per-device toggle to hide your own net and the net ranking at tables
- Default starting stack set in settings; creating a table saves the
  stack, SB and BB used as the next defaults
- Number fields on create and settings select all on focus

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
agomizi1cmandClaude Opus 5.5 committed 2026-10-23 12:31:32 +09:00
1 parent ed3d1e437e
commit 22ee28ba03
9 files changed
+160 -8

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
// 設定: この端末だけに保存する(localStorage)
(function () {
'use strict';
const { Store, selectOnFocus } = App;
const $ = (id) => document.getElementById(id);
Fluid.navBar($('nav'), $('large-title'));
const showNet = $('show-net');
showNet.checked = Store.showNet;
showNet.addEventListener('change', () => {
Store.showNet = showNet.checked;
Fluid.haptic(6);
});
const stack = $('default-stack');
stack.value = Store.defaultStack;
selectOnFocus(stack);
// 正しい値のときだけ保存する。外したときに不正なら保存済みの値に戻す
stack.addEventListener('input', () => {
const n = Number(stack.value);
const ok = Number.isInteger(n) && n >= 10 && n <= 100000000;
stack.classList.toggle('invalid', stack.value !== '' && !ok);
if (ok) Store.defaultStack = n;
});
stack.addEventListener('blur', () => {
stack.classList.remove('invalid');
stack.value = Store.defaultStack;
});
stack.addEventListener('keydown', (e) => {
if (e.key === 'Enter') stack.blur();
});
})();